#include <PointLight.h>
Inheritance diagram for nvsg::PointLight:
Public Member Functions | |
virtual NVSG_API const PointLight * | clone (void) const |
Get a clone of this PointLight. | |
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 void | getAttenuation (float &c, float &l, float &q) const |
Get the attenuation factors for this light. | |
NVSG_API const nvmath::Vec3f & | getAttenuation (void) const |
Get the attenuation factors for this light as a Vec3f . | |
NVSG_API bool | isAttenuated (void) const |
Ask if this light source is attenuated. | |
NVSG_API void | setAttenuation (float c, float l, float q) |
Set the attenuation factors for this light. | |
Static Public Member Functions | |
static NVSG_API const PointLight * | create (void) |
Create a PointLight. | |
static NVSG_API const PointLight * | createFromBase (const LightSource &rhs) |
Create a PointLight by copying from a LightSource. | |
Protected Member Functions | |
NVSG_API | PointLight (void) |
Default Constructor. | |
NVSG_API | PointLight (const LightSource &rhs) |
Partial Constructor. | |
NVSG_API | PointLight (const PointLight &rhs) |
Copy Constructor. | |
virtual NVSG_API | ~PointLight (void) |
Protected destructor to prevent explicit creation on stack. |
Point lights have color and position within a scene, but no single direction. They give off light equally in all directions. A light bulb is a good example of a point light. Point lights are affected by attenuation and range, and illuminate a mesh on a vertex-by-vertex basis. During lighting, the point light's position in world space and the coordinates of the vertex being lit are used to derive a vector for the direction of the light and the distance that the light has traveled. Both are used, along with the vertex normal, to calculate the contribution of the light to the illumination of the surface.
|
Default Constructor.
|
|
Partial Constructor.
|
|
Copy Constructor.
|
|
Protected destructor to prevent explicit creation on stack.
|
|
Create a PointLight.
|
|
Create a PointLight by copying from a LightSource.
|
|
Get a clone of this PointLight.
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 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 attenuation factors for this light as a
The attenuation factors are used to calculate the attenuation of this light at a lit point by the equation atten = 1 / ( v[0] + v[1] * d + v[2] * d * d ) v is the returned |
|
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.
|
|
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.
|