#include <lightmanager.hpp>
LightSource managed by a LightManager.
- Typically used for point lights. Spot lights are not supported yet. Directional lights affect the whole scene
- so do not need to be managed by a LightManager - so for directional lights use a plain osg::LightSource instead.
- Note
- LightSources must be decorated by a LightManager node in order to have an effect. Typical use would be one LightManager as the root of the scene graph.
-
One needs to attach LightListCallback's to the scene to have objects receive lighting from LightSources. See the documentation of LightListCallback for more information.
-
The position of the contained osg::Light is automatically updated based on the LightSource's world position.
SceneUtil::LightSource::LightSource |
( |
const LightSource & |
copy, |
|
|
const osg::CopyOp & |
copyop |
|
) |
| |
int SceneUtil::LightSource::getId |
( |
| ) |
const |
|
inline |
Get the unique ID for this light source.
osg::Light* SceneUtil::LightSource::getLight |
( |
unsigned int |
frame | ) |
|
|
inline |
Get the osg::Light safe for modification in the given frame.
- May be used externally to animate the light's color/attenuation properties,
- and is used internally to synchronize the light's position with the position of the LightSource.
float SceneUtil::LightSource::getRadius |
( |
| ) |
const |
|
inline |
void SceneUtil::LightSource::setLight |
( |
osg::Light * |
light | ) |
|
|
inline |
- Warning
- It is recommended not to replace an existing osg::Light, because there might still be references to it in the light StateSet cache that are associated with this LightSource's ID. These references will stay valid due to ref_ptr but will point to the old object.
-
Do not modify the light after you've called this function.
void SceneUtil::LightSource::setRadius |
( |
float |
radius | ) |
|
|
inline |
The LightSource will affect objects within this radius.
int SceneUtil::LightSource::mId |
|
private |
osg::ref_ptr<osg::Light> SceneUtil::LightSource::mLight[2] |
|
private |
float SceneUtil::LightSource::mRadius |
|
private |
The documentation for this class was generated from the following files: