VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgLightModel.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vrvCore/DtLightModel.h>
15 
17 
18 #include <vrvMath/DtVector3.h>
19 #include <vrvMath/DtColorValue.h>
20 
21 namespace makVrv
22 {
23  class DtLight;
24  class DtOsgLightManager;
25 
30  {
31  public:
34 
36  virtual ~DtOsgLightModel();
37 
38  public:
41  DtOsgLightModel() = delete;
42  DtOsgLightModel( const DtOsgLightModel& ) = delete;
43  DtOsgLightModel( const DtOsgLightModel&& ) = delete;
44  DtOsgLightModel& operator=( const DtOsgLightModel& ) = delete;
45  DtOsgLightModel& operator=( const DtOsgLightModel&& ) = delete;
47 
49  virtual void setPosition( int vtx, const DtVector& position ) override;
50  virtual void setOrientation( int vtx, const DtTaitBryan& orientation ) override;
51 
53  virtual void setOn(bool bOn) override;
54 
56  virtual bool isOn() const override;
57 
62  virtual void setLightType(unsigned int lightType) override;
63 
65  virtual unsigned int lightType() const override;
66 
68  virtual const DtVector& lightPosition() const override;
69 
71  virtual void setLightDirection(const DtVector& direction) override;
72 
74  virtual const DtVector& lightDirection() const override;
75 
77  virtual void setDiffuseColor(float r, float g, float b, float a) override;
78 
80  virtual void setAmbientColor(float r, float g, float b, float a) override;
81 
83  virtual void setSpecularColor(float r, float g, float b, float a) override;
84 
86  virtual void setRange(float range) override;
87 
89  virtual float range() const override;
90 
92  virtual void setAttenuation(float constant, float linear, float quadratic) override;
93 
95  virtual void setSpotLightParameters(float innerAngleDegrees, float outerAngleDegrees, float falloff) override;
96 
98  virtual void setSensorMask(unsigned int mask) override;
99 
101  virtual unsigned int sensorMask() const override;
102 
104  virtual void addToScene(const DtUniqueID& sceneObjectId, DtModelSetId modelSet, int visualizerType) override;
105 
107  virtual void removeFromScene() override;
108 
110  DtLight* light() const { return myLight; }
111 
115  virtual void setIsSupportModel( bool isSupport ) override;
116  protected:
118 
120  DtVector myLightPosition;
123  unsigned int myLightTypeId; // used by the light manager
124  unsigned int mySensorMask;
125  float myRange;
126  // Attenuation parameters
130  // Spotlight parameters
137 
139  };
140 }
DtColorValue class.
unsigned int mySensorMask
Definition: DtOsgLightModel.h:124
DtLight * light() const
Get the underlying DtLight object.
Definition: DtOsgLightModel.h:110
DtColorValue myAmbientColor
Definition: DtOsgLightModel.h:135
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtVector myLightDirection
Definition: DtOsgLightModel.h:121
DtOsgLightManager & myOsgLightManager
Definition: DtOsgLightModel.h:117
DtLightModel is the model interface for light sources. This provides a vrvCore interface to control D...
Definition: DtLightModel.h:21
DtVector myLightPosition
Definition: DtOsgLightModel.h:120
DtColorValue myDiffuseColor
Definition: DtOsgLightModel.h:134
3 dimensional vector
float mySpotFalloff
Definition: DtOsgLightModel.h:133
DtColorValue mySpecularColor
Definition: DtOsgLightModel.h:136
DtOsgLightModel is the concrete implementation of DtLightModel. This class creates and manages a DtLi...
Definition: DtOsgLightModel.h:29
DtLight * myLight
Definition: DtOsgLightModel.h:119
Light class.
LightType
Definition: DtLight.h:31
DtOsgLightManager receives LightSource nodes from the DtOsgCullVisitor, and collects them all here wh...
Definition: DtOsgLightManager.h:54
unsigned int myLightTypeId
Definition: DtOsgLightModel.h:123
float myAttenuationQuadratic
Definition: DtOsgLightModel.h:129
float mySpotInnerAngleDegrees
Definition: DtOsgLightModel.h:131
float myRange
Definition: DtOsgLightModel.h:125
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
LightType myLightType
Definition: DtOsgLightModel.h:122
float myAttenuationConstant
Definition: DtOsgLightModel.h:127
Class for generic lights This holds per-light data such as range, attenuation factors, colors, etc.
Definition: DtLight.h:49
float mySpotOuterAngleDegrees
Definition: DtOsgLightModel.h:132
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
float myAttenuationLinear
Definition: DtOsgLightModel.h:128
DtModelSetId
Definition: DtModelSetEnums.h:19
Template for Color values in [0,1] range.
Definition: DtColorValue.h:24
Contains declaration of DtLightModel.
bool myLightIsOn
Definition: DtOsgLightModel.h:138

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)