#include <SpotLight.h>
Inheritance diagram for nvsg::SpotLight:
Public Member Functions | |
virtual NVSG_API const SpotLight * | clone (void) const |
Get a clone of this SpotLight. | |
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. | |
NVSG_API const nvmath::Vec3f & | getAttenuation (void) const |
Get attenuation. | |
NVSG_API bool | isAttenuated (void) const |
Ask if this light source is attenuated. | |
NVSG_API void | getAttenuation (float &c, float &l, float &q) const |
Get the attenuation factors for this light. | |
NVSG_API void | setAttenuation (float c, float l, float q) |
Set the attenuation factors for this light. | |
NVSG_API float | getCutoffAngle (void) const |
Get the cutoff angle. | |
NVSG_API void | setCutoffAngle (float ca) |
Set the cutoff angle. | |
NVSG_API float | getFalloffExponent (void) const |
Get the falloff exponent. | |
NVSG_API void | setFalloffExponent (float fe) |
Set the falloff exponent. | |
Static Public Member Functions | |
static NVSG_API const SpotLight * | create (void) |
Create a SpotLight. | |
static NVSG_API const SpotLight * | createFromBase (const LightSource &rhs) |
Create a SpotLight by copying from a LightSource. | |
Protected Member Functions | |
NVSG_API | SpotLight (void) |
Constructor. | |
NVSG_API | SpotLight (const LightSource &rhs) |
Partial Constructor. | |
NVSG_API | SpotLight (const SpotLight &rhs) |
Copy Constructor. | |
virtual NVSG_API | ~SpotLight (void) |
Protected destructor to prevent explicit creation on stack. |
A SpotLight restricts the shape of the emitted light to a cone. To specify the angle between the axis of the cone and a ray along the edge of the cone, use setCutoffAngle()
with the angle in degrees. The angle of the cone at the apex is then twice this value. No light is emitted beyond the edges of the cone.
setAttenuation()
. You can also set a falloff exponent using setFalloffExponent()
, which by default is zero, to control how concentrated the light is. The light's intensity is highest in the center of the cone. It is attenuated toward the edges of the cone by the cosine of the angle between the direction of the light and the direction from the light to the vertex being lit, raised to the power of the falloff exponent. Thus, higher falloff exponents result in a more focused light source.
|
Constructor.
|
|
Partial Constructor.
|
|
Copy Constructor.
|
|
Protected destructor to prevent explicit creation on stack.
|
|
Create a SpotLight.
|
|
Create a SpotLight by copying from a LightSource.
|
|
Get a clone of this SpotLight.
Implements nvsg::Node. |
|
Determine whether the data of this object is shared.
Reimplemented from nvsg::LightSource. |
|
Get the DataID of the data of this object.
Reimplemented from nvsg::LightSource. |
|
Get attenuation.
|
|
Ask if this light source is attenuated. A light source is attenuated if the constant attenuation factor is different from one, or if the linear or quadratic attenuation factor is different from zero.
|
|
Get the attenuation factors for this light. The attenuation factors are used to calculate the attenuation of this light at a lit point by the equation atten = 1 / ( c + l * d + q * d * d ) where d is the distance between the light and the vertex.
|
|
Set the attenuation factors for this light. The attenuation factors are used to calculate the attenuation of this light at a lit point by the equation atten = 1 / ( c + l * d + q * d * d ) where d is the distance between the light and the vertex.
|
|
Get the cutoff angle. The light's cone is cut off at this angle (in degree). Points beyond this cone are not lit. The default is 45.0.
|
|
Set the cutoff angle. The light's cone is cut off at this angle (in degrees). Points beyond this cone are not lit. The default is 45.0.
|
|
Get the falloff exponent. The falloff exponent controls the sharpness of the spot light. The higher the exponent, the more focused the light source. The default is 0.0
|
|
Set the falloff exponent. The falloff exponent controls the sharpness of the spot light. The higher the exponent, the more focused the light source. The default is 0.0.
|