1 #ifndef OPENMW_COMPONENTS_SCENEUTIL_LIGHTMANAGER_H
2 #define OPENMW_COMPONENTS_SCENEUTIL_LIGHTMANAGER_H
9 #include <osg/NodeVisitor>
10 #include <osg/observer_ptr>
39 LightSource(const LightSource& copy, const osg::
CopyOp& copyop);
105 void addLight(
LightSource* lightSource,
const osg::Matrixf& worldMat,
unsigned int frameNum);
113 const std::vector<LightSourceTransform>&
getLights()
const;
121 const std::vector<LightSourceViewBound>&
getLightsInViewSpace(osg::Camera* camera,
const osg::RefMatrix* viewMatrix);
123 typedef std::vector<const LightSourceViewBound*>
LightList;
159 : osg::Object(copy, copyop), osg::NodeCallback(copy, copyop)
167 void operator()(osg::Node* node, osg::NodeVisitor* nv);
Definition: lightmanager.hpp:151
Definition: lightmanager.hpp:115
std::set< SceneUtil::LightSource * > mIgnoredLightSources
Definition: lightmanager.hpp:175
void setLightingMask(unsigned int mask)
Definition: lightmanager.cpp:161
osg::Light * getLight(unsigned int frame)
Definition: lightmanager.hpp:55
unsigned int mLightingMask
Definition: lightmanager.hpp:140
osg::ref_ptr< osg::Light > mLight[2]
Definition: lightmanager.hpp:26
std::map< size_t, osg::ref_ptr< osg::StateSet > > LightStateSetMap
Definition: lightmanager.hpp:135
float getRadius() const
Definition: lightmanager.hpp:41
void setStartLight(int start)
Set the first light index that should be used by this manager, typically the number of directional li...
Definition: lightmanager.cpp:265
unsigned int mLastFrameNumber
Definition: lightmanager.hpp:173
void setRadius(float radius)
The LightSource will affect objects within this radius.
Definition: lightmanager.hpp:47
int getStartLight() const
Definition: lightmanager.cpp:281
LightSource * mLightSource
Definition: lightmanager.hpp:117
std::vector< const LightSourceViewBound * > LightList
Definition: lightmanager.hpp:123
std::vector< LightSourceTransform > mLights
Definition: lightmanager.hpp:129
void update()
Internal use only, called automatically by the LightManager's UpdateCallback.
Definition: lightmanager.cpp:171
Definition: lightmanager.hpp:23
LightListCallback()
Definition: lightmanager.hpp:154
META_Node(SceneUtil, SceneUtil::LightManager) LightManager()
LightStateSetMap mStateSetCache[2]
Definition: lightmanager.hpp:136
const std::vector< LightSourceTransform > & getLights() const
Definition: lightmanager.cpp:236
META_Object(SceneUtil, LightListCallback) void operator()(osg getIgnoredLightSources() std::set< SceneUtil::LightSource * > &
Definition: lightmanager.hpp:169
Decorator node implementing the rendering of any number of LightSources that can be anywhere in the s...
Definition: lightmanager.hpp:78
std::vector< LightSourceViewBound > LightSourceViewBoundCollection
Definition: lightmanager.hpp:131
int mStartLight
Definition: lightmanager.hpp:138
osg::ref_ptr< osg::StateSet > getLightListStateSet(const LightList &lightList, unsigned int frameNum)
Definition: lightmanager.cpp:195
LightManager(const LightManager ©, const osg::CopyOp ©op)
Definition: lightmanager.cpp:146
std::map< osg::observer_ptr< osg::Camera >, LightSourceViewBoundCollection > mLightsInViewSpace
Definition: lightmanager.hpp:132
const std::vector< LightSourceViewBound > & getLightsInViewSpace(osg::Camera *camera, const osg::RefMatrix *viewMatrix)
Definition: lightmanager.cpp:241
int getId() const
Get the unique ID for this light source.
Definition: lightmanager.hpp:71
unsigned int getLightingMask() const
Definition: lightmanager.cpp:166
osg::BoundingSphere mViewBound
Definition: lightmanager.hpp:118
META_Node(SceneUtil, SceneUtil::LightSource) LightSource()
float mRadius
Definition: lightmanager.hpp:29
int mId
Definition: lightmanager.hpp:31
void setLight(osg::Light *light)
Definition: lightmanager.hpp:64
void addLight(LightSource *lightSource, const osg::Matrixf &worldMat, unsigned int frameNum)
Internal use only, called automatically by the LightSource's UpdateCallback.
Definition: lightmanager.cpp:184
LightManager * mLightManager
Definition: lightmanager.hpp:172
LightListCallback(const LightListCallback ©, const osg::CopyOp ©op)
Definition: lightmanager.hpp:158
LightManager::LightList mLightList
Definition: lightmanager.hpp:174