#include <LightSource.h>
Inheritance diagram for nvsg::LightSource:
Public Member Functions | |
NVSG_API const nvmath::Vec3f & | getAmbientColor (void) const |
Get the ambient color of this light source. | |
NVSG_API void | setAmbientColor (const nvmath::Vec3f &c) |
Set the ambient color of this light source. | |
NVSG_API const nvmath::Vec3f & | getDiffuseColor (void) const |
Get the diffuse color of this light source. | |
NVSG_API void | setDiffuseColor (const nvmath::Vec3f &c) |
Set the diffuse color of this light source. | |
NVSG_API const nvmath::Vec3f & | getSpecularColor (void) const |
Get the specular color of this light source. | |
NVSG_API void | setSpecularColor (const nvmath::Vec3f &c) |
Set the specular color of this light source. | |
NVSG_API float | getIntensity (void) const |
Get the intensity of this light source. | |
NVSG_API void | setIntensity (float i) |
Set the intensity of this light source. | |
NVSG_API const Animation< nvmath::Trafo > * | getAnimation (void) const |
Get the animation of this light. | |
NVSG_API void | setAnimation (const Animation< nvmath::Trafo > *pAnimation) |
Set an animation for this light. | |
NVSG_API void | setAnimationFrame (size_t frame) |
Set the animation frame. | |
virtual NVSG_API size_t | getNumberOfFrames (void) const |
Get the number of animation frames that are part of this LightSource. | |
NVSG_API void | setPosition (const nvmath::Vec3f &position) |
Set the position of the light source. | |
NVSG_API const nvmath::Vec3f & | getPosition (void) const |
Set the position of the light source. | |
NVSG_API nvmath::Vec3f | getDirection (void) const |
Get the direction. | |
NVSG_API void | setDirection (const nvmath::Vec3f &direction) |
Get the direction. | |
NVSG_API const nvmath::Quatf & | getOrientation (void) const |
Get the current rotational transformation. | |
NVSG_API void | setOrientation (const nvmath::Quatf &orientation) |
Set the rotational part of the light transformation. | |
NVSG_API nvmath::Mat44f | getTransformationMatrix (void) const |
Get the current transformation. | |
NVSG_API nvmath::Mat44f | getInverse (void) const |
Get the inverse of the current transformation. | |
virtual NVSG_API bool | isDataShared (void) const |
Determine whether the data of this object is shared. | |
virtual NVSG_API DataID | getDataID (void) const |
Get the DataID of the data of this object. | |
virtual NVSG_API bool | containsLight (void) const |
Ask if this LightSource is a LightSource. | |
Protected Member Functions | |
NVSG_API | LightSource (void) |
Constructor. | |
NVSG_API | LightSource (const LightSource &rhs) |
Copy constructor. | |
virtual NVSG_API | ~LightSource (void) |
Protected destructor to prevent explicit creation on stack. | |
virtual NVSG_API bool | calcBoundingSphere (void) const |
Calculate the bounding sphere of this light source. |
A LightSource contains data and functionality common to all light sources (DirectedLight, SpotLight, ...).
Light sources only influence objects under the same Switch/Group or in a subtree under the same Switch/Group.
Here a short example:
| ----------------------------------------- | | | Ls0 Sw NB | ----------------------- | | | | Ls1 NA Ls2 Gr | ...
|
Constructor.
|
|
Copy constructor.
|
|
Protected destructor to prevent explicit creation on stack.
|
|
Get the ambient color of this light source. The ambient color of a light simply contributes to the global ambient term. It is not dependent on any other lighting factors such as vertex normals, light direction, light position, range, or attenuation. The default is (0.0,0.0,0.0).
|
|
Set the ambient color of this light source. The ambient color of a light simply contributes to the global ambient term. It is not dependent on any other lighting factors such as vertex normals, light direction, light position, range, or attenuation. The default is (0.0,0.0,0.0).
|
|
Get the diffuse color of this light source. The diffuse color of a light is used to calculate lighting contribution that might depend on vertex normals, light direction, light position, range, or attenutation, depending on the type of light source. The default is (1.0,1.0,1.0).
|
|
Set the diffuse color of this light source. The diffuse color of a light is used to calculate lighting contribution from vertex normals, light direction, light position, range, or attenutation, depending on the type of light source. The default is (1.0,1.0,1.0).
|
|
Get the specular color of this light source. The specular color of a light is used to calculate any lighting contribution from vertex normals, vertex position, light direction, light position, range, or attenuation, depending on the type of light source. The default is (1.0,1.0,1.0).
|
|
Set the specular color of this light source. The specular color of a light is used to calculate lighting contribution from vertex normals, vertex position, light direction, light position, range, or attenuation, depending on the type of light source. The default is (1.0,1.0,1.0).
|
|
Get the intensity of this light source. The intensity of a light is a multiplier for all three color types of this light.
|
|
Set the intensity of this light source. The intensity of a light is a multiplier for all three color types of this light.
|
|
Get the animation of this light.
|
|
Set an animation for this light.
|
|
Set the animation frame. The transformation for animation step frame is calculated and used as the current.
|
|
Get the number of animation frames that are part of this LightSource.
Reimplemented from nvsg::Node. |
|
Set the position of the light source.
|
|
Set the position of the light source.
|
|
Get the direction. The direction is the main direction of the light's cone - Default direction: (0, 0, -1).
|
|
Get the direction. The direction is the main direction of the light's cone - Default direction: (0, 0, -1)
|
|
Get the current rotational transformation.
|
|
Set the rotational part of the light transformation.
|
|
Get the current transformation.
|
|
Get the inverse of the current transformation.
|
|
Determine whether the data of this object is shared.
Reimplemented from nvsg::Node. Reimplemented in nvsg::DirectedLight, nvsg::PointLight, and nvsg::SpotLight. |
|
Get the DataID of the data of this object.
Reimplemented from nvsg::Node. Reimplemented in nvsg::DirectedLight, nvsg::PointLight, and nvsg::SpotLight. |
|
Ask if this LightSource is a LightSource.
Reimplemented from nvsg::Node. |
|
Calculate the bounding sphere of this light source. LightSource doesn't have a valid bounding sphere.
Implements nvsg::Node. |