Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

nvsg::PointLight Class Reference

Class representing a point light. More...

#include <PointLight.h>

Inheritance diagram for nvsg::PointLight:

Inheritance graph
[legend]
Collaboration diagram for nvsg::PointLight:

Collaboration graph
[legend]
List of all members.

Public Methods

virtual NVSG_API const PointLight * clone (void) const
 Get a clone of this PointLight. More...

virtual NVSG_API bool isDataShared (void) const
 Determine whether the data of this object is shared. More...

virtual NVSG_API DataID getDataID (void) const
 Get the DataID of the data of this object. More...

NVSG_API void getAttenuation (float &c, float &l, float &q) const
 Get the attenuation factors for this light. More...

NVSG_API const nvmath::Vec3fgetAttenuation (void) const
 Get the attenuation factors for this light as a Vec3f. More...

NVSG_API bool isAttenuated (void) const
 Ask if this light source is attenuated. More...

NVSG_API void setAttenuation (float c, float l, float q)
 Set the attenuation factors for this light. More...


Static Public Methods

NVSG_API const PointLight * create (void)
 Create a PointLight. More...

NVSG_API const PointLight * createFromBase (const LightSource &rhs)
 Create a PointLight by copying from a LightSource. More...


Protected Methods

NVSG_API PointLight (void)
 Default Constructor. More...

NVSG_API PointLight (const LightSource &rhs)
 Partial Constructor. More...

NVSG_API PointLight (const PointLight &rhs)
 Copy Constructor. More...

virtual NVSG_API ~PointLight (void)
 Protected destructor to prevent explicit creation on stack. More...


Detailed Description

Class representing a point light.

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.


Constructor & Destructor Documentation

NVSG_API nvsg::PointLight::PointLight void    [protected]
 

Default Constructor.

NVSG_API nvsg::PointLight::PointLight const LightSource   rhs [protected]
 

Partial Constructor.

NVSG_API nvsg::PointLight::PointLight const PointLight &    rhs [protected]
 

Copy Constructor.

virtual NVSG_API nvsg::PointLight::~PointLight void    [protected, virtual]
 

Protected destructor to prevent explicit creation on stack.


Member Function Documentation

NVSG_API const PointLight* nvsg::PointLight::create void    [static]
 

Create a PointLight.

Returns:
a constant pointer to a PointLight.

NVSG_API const PointLight* nvsg::PointLight::createFromBase const LightSource   rhs [static]
 

Create a PointLight by copying from a LightSource.

Returns:
a constant pointer to a PointLight.
Parameters:
rhs  LightSource to copy from

virtual NVSG_API const PointLight* nvsg::PointLight::clone void    const [virtual]
 

Get a clone of this PointLight.

Returns:
A constant pointer to the new created clone.

Implements nvsg::Node.

virtual NVSG_API bool nvsg::PointLight::isDataShared void    const [virtual]
 

Determine whether the data of this object is shared.

Returns:
true if the object's data is shared, otherwise false.

Reimplemented from nvsg::LightSource.

virtual NVSG_API DataID nvsg::PointLight::getDataID void    const [virtual]
 

Get the DataID of the data of this object.

Returns:
DataID of the object's data.

Reimplemented from nvsg::LightSource.

void nvsg::PointLight::getAttenuation float &    c,
float &    l,
float &    q
const [inline]
 

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.

Parameters:
c  constant attenuation factor
l  linear attenuation factor
q  quadratic attenuation factor

const nvmath::Vec3f & nvsg::PointLight::getAttenuation void    const [inline]
 

Get the attenuation factors for this light as a Vec3f.

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 Vec3f, and d is the distance between the light and the vertex.

bool nvsg::PointLight::isAttenuated void    const [inline]
 

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.

Returns:
true if this light source is attenuated, otherwise false

void nvsg::PointLight::setAttenuation float    c,
float    l,
float    q
[inline]
 

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.

Parameters:
c  constant attenuation factor
l  linear attenuation factor
q  quadratic attenuation factor


The documentation for this class was generated from the following file:
Generated on Tue Mar 1 13:20:31 2005 for NVSGSDK by NVIDIA