20 #include <matrix/vlVector.h>
25 #include <osg/observer_ptr>
29 #include <boost/thread.hpp>
30 #include <unordered_map>
45 class DtOsgLightsObserver;
48 class DtThreadCameraStreamDataManager;
61 static const int theMwirLightSourceSensorMask = 0b0100;
62 static const int theLwirLightSourceSensorMask = 0b1000;
63 static const int theIrLightSourceSensorMask = theMwirLightSourceSensorMask | theLwirLightSourceSensorMask;
64 static const int theNvgLightSourceSensorMask = 0b0010;
65 static const int theVisualLightSourceSensorMask = 0b0001;
66 static const int theDefaultLightSourceSensorMask = theNvgLightSourceSensorMask | theVisualLightSourceSensorMask;
89 virtual void initialize();
93 virtual void attachToStateSet(osg::StateSet* stateSet);
96 virtual void setPerPixelLightingEnabled(
bool enabled);
99 virtual bool perPixelLightingEnabled()
const;
105 virtual void setReservedID(
int id);
108 virtual int reservedID()
const;
111 virtual bool registerLight(
const osg::LightSource* light,
const osg::NodePath& nodePath,
const osg::Matrixd& modelingMatrix,
bool globalLights
112 ,
const osg::Camera* osgCamera);
115 virtual void deregisterLight(
const osg::LightSource* light);
118 virtual void update(
const osg::State& state,
const osg::Camera* camera);
121 virtual void releaseGLObjects(
void);
124 virtual unsigned int getOrCreateLightSourceTypeId(
const osg::LightSource& lightSource);
128 virtual unsigned int getOrCreateDynamicLightSourceTypeId(
const DtLight* pDtLight);
131 virtual void deleteDynamicLightSourceTypeId(
const DtLight* pDtLight);
138 virtual void updateLightSourceType(
unsigned int id,
const DtLight* light);
151 static const std::string& theClassName();
155 virtual bool computeLightStatusForTime(
const DtLight* pDtLight,
float ambientLightValue)
const;
168 virtual void proccessLightPath(
DtLight* inLight,
const osg::NodePath& nodePath);
170 virtual void configurePerPixelLighting(osg::StateSet*);
172 virtual void slot_reloadShader();
174 virtual bool existsInLightManager(
const DtLight* light)
const;
177 virtual void convertOsgLightToDtLight(
DtLight* pDtLight,
const osg::LightSource& lightSource,
const osg::Matrixd& modelingMatrix);
180 virtual void getWorldPositionAndDirection(
const osg::LightSource& lightSource,
const osg::Matrixd& modelingMatrix, osg::Vec3d& vWorldPos, osg::Vec3d& vWorldDir)
const;
183 virtual unsigned int getOrCreateLightSourceTypeId(
const DtLight* pDtLight);
186 virtual unsigned int sensorMaskFromLightSource(
const osg::LightSource& lightSource)
const;
189 virtual size_t getNodePathHashValue(
const osg::NodePath& nodePath)
const;
192 virtual void printNodePath(
const osg::NodePath& nodePath)
const;
195 virtual size_t computeHash(
const DtLight* pDtLight)
const;
198 virtual LightType lightType(
const osg::Light* light)
const;
200 virtual unsigned int getOrCreateLightSourceTypeId(
const DtLight* pDtLight,
size_t hash);
203 virtual void slot_preTick(
void);
DtLightManager * myLightManager
Definition: DtOsgLightManager.h:217
Manager for DtThreadCameraStreamData Holds them as cameras come in. Deletes them as cameras go out (v...
Definition: DtThreadCameraStreamDataManager.h:86
LightManager class which allows creation/deletion of lights.
Definition: DtLightManager.h:32
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtDe & myDe
Definition: DtOsgLightManager.h:206
MapLightSourceHashToLights myMapLightSourceHashToLights
Definition: DtOsgLightManager.h:222
DtOsgLightsObserver * myOsgLightsObserver
Definition: DtOsgLightManager.h:226
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtSignalConnectionManager myConnections
Definition: DtOsgLightManager.h:238
Definition: featureContext.h:37
bool myPerPixelLightingEnabled
Definition: DtOsgLightManager.h:211
std::mutex myRegisterUnRegisterPathMutex
Definition: DtOsgLightManager.h:224
bool myInitialized
Definition: DtOsgLightManager.h:207
osg::observer_ptr< osg::StateSet > myStateSet
Definition: DtOsgLightManager.h:215
MapLightSourceTypeToLightID myLightSourceTypeMap
Definition: DtOsgLightManager.h:229
This class represents the per context, per camera data and operations on it via the DtOsgLightManager...
Definition: DtOsgLightManagerTcsUserData.h:26
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
DtOsgLightManagerTcsUserDataCreator & myUserDataCreator
Definition: DtOsgLightManager.h:236
LightType
Definition: DtLight.h:31
DtThreadCameraStreamDataManager & myTcsDataManager
Definition: DtOsgLightManager.h:235
DtOsgLightManager receives LightSource nodes from the DtOsgCullVisitor, and collects them all here wh...
Definition: DtOsgLightManager.h:55
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
int myReservedID
Definition: DtOsgLightManager.h:209
bool myDebugCallbackInitialized
Definition: DtOsgLightManager.h:208
boost::mutex myMutableLightSourceTypeMutex
Definition: DtOsgLightManager.h:233
LightReusableVector myLightSourceTypeLightVector
Definition: DtOsgLightManager.h:230
Base class to provide boost signal/slot management.
std::unordered_set< const DtLight * > myLightsCreatedViaRegister
Definition: DtOsgLightManager.h:223
Contains the DtOsgLightingComponent class.
Contains makVrv::DtReusableMemoryVector class.
Class for generic lights This holds per-light data such as range, attenuation factors, colors, etc.
Definition: DtLight.h:49
std::unordered_map< size_t, LightSourceAndLight > MapLightSourceHashToLights
Definition: DtOsgLightManager.h:221
Contains DLL export macros.
Definition: DtOsgLightsObserver.h:24
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:72
std::map< size_t, unsigned int > MapLightSourceTypeToLightID
Definition: DtOsgLightManager.h:228
osg::ref_ptr< DtOsgLightingComponent > myLightingComponent
Definition: DtOsgLightManager.h:213
Contains the DtOsgLightManagerTcsUserData class.
std::pair< const osg::LightSource *, const makVrv::DtLight * > LightSourceAndLight
Definition: DtOsgLightManager.h:219
State component that injects lighting shaders and uniforms into a state set. It also has a DtLightCom...
Definition: DtOsgLightingComponent.h:57