OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
SceneUtil::LightManager Class Reference

Decorator node implementing the rendering of any number of LightSources that can be anywhere in the subgraph. More...

#include <lightmanager.hpp>

Inheritance diagram for SceneUtil::LightManager:
Collaboration diagram for SceneUtil::LightManager:

Classes

struct  LightSourceTransform
 
struct  LightSourceViewBound
 

Public Types

typedef std::vector< const
LightSourceViewBound * > 
LightList
 

Public Member Functions

 META_Node (SceneUtil, LightManager) LightManager()
 
 LightManager (const LightManager &copy, const osg::CopyOp &copyop)
 
void setLightingMask (unsigned int mask)
 
unsigned int getLightingMask () const
 
void setStartLight (int start)
 Set the first light index that should be used by this manager, typically the number of directional lights in the scene. More...
 
int getStartLight () const
 
void update ()
 Internal use only, called automatically by the LightManager's UpdateCallback. More...
 
void addLight (LightSource *lightSource, const osg::Matrixf &worldMat, unsigned int frameNum)
 Internal use only, called automatically by the LightSource's UpdateCallback. More...
 
const std::vector
< LightSourceTransform > & 
getLights () const
 
const std::vector
< LightSourceViewBound > & 
getLightsInViewSpace (osg::Camera *camera, const osg::RefMatrix *viewMatrix)
 
osg::ref_ptr< osg::StateSet > getLightListStateSet (const LightList &lightList, unsigned int frameNum)
 

Private Types

typedef std::vector
< LightSourceViewBound
LightSourceViewBoundCollection
 
typedef std::map< size_t,
osg::ref_ptr< osg::StateSet > > 
LightStateSetMap
 

Private Attributes

std::vector< LightSourceTransformmLights
 
std::map< osg::observer_ptr
< osg::Camera >
, LightSourceViewBoundCollection
mLightsInViewSpace
 
LightStateSetMap mStateSetCache [2]
 
int mStartLight
 
unsigned int mLightingMask
 

Detailed Description

Decorator node implementing the rendering of any number of LightSources that can be anywhere in the subgraph.

Member Typedef Documentation

typedef std::map<size_t, osg::ref_ptr<osg::StateSet> > SceneUtil::LightManager::LightStateSetMap
private

Constructor & Destructor Documentation

SceneUtil::LightManager::LightManager ( const LightManager copy,
const osg::CopyOp &  copyop 
)

Member Function Documentation

void SceneUtil::LightManager::addLight ( LightSource lightSource,
const osg::Matrixf &  worldMat,
unsigned int  frameNum 
)

Internal use only, called automatically by the LightSource's UpdateCallback.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int SceneUtil::LightManager::getLightingMask ( ) const

Here is the caller graph for this function:

osg::ref_ptr< osg::StateSet > SceneUtil::LightManager::getLightListStateSet ( const LightList lightList,
unsigned int  frameNum 
)

Here is the call graph for this function:

Here is the caller graph for this function:

const std::vector< LightManager::LightSourceTransform > & SceneUtil::LightManager::getLights ( ) const
const std::vector< LightManager::LightSourceViewBound > & SceneUtil::LightManager::getLightsInViewSpace ( osg::Camera *  camera,
const osg::RefMatrix *  viewMatrix 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int SceneUtil::LightManager::getStartLight ( ) const

Here is the caller graph for this function:

SceneUtil::LightManager::META_Node ( SceneUtil  ,
LightManager   
)
void SceneUtil::LightManager::setLightingMask ( unsigned int  mask)
Parameters
maskThis mask is compared with the current Camera's cull mask to determine if lighting is desired. By default, it's ~0u i.e. always on. If you have some views that do not require lighting, then set the Camera's cull mask to not include the lightingMask for a much faster cull and rendering.

Here is the caller graph for this function:

void SceneUtil::LightManager::setStartLight ( int  start)

Set the first light index that should be used by this manager, typically the number of directional lights in the scene.

Here is the caller graph for this function:

void SceneUtil::LightManager::update ( )

Internal use only, called automatically by the LightManager's UpdateCallback.

Here is the caller graph for this function:

Member Data Documentation

unsigned int SceneUtil::LightManager::mLightingMask
private
std::vector<LightSourceTransform> SceneUtil::LightManager::mLights
private
std::map<osg::observer_ptr<osg::Camera>, LightSourceViewBoundCollection> SceneUtil::LightManager::mLightsInViewSpace
private
int SceneUtil::LightManager::mStartLight
private
LightStateSetMap SceneUtil::LightManager::mStateSetCache[2]
private

The documentation for this class was generated from the following files: