Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class 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 Member Functions

virtual NVSG_API const PointLightclone (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::Vec3fgetAttenuation (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 PointLightcreate (void)
 Create a PointLight.
static NVSG_API const PointLightcreateFromBase (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.

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

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

Create a PointLight.

Returns:
a constant pointer to a PointLight.

static 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:53 2005 for NVSGSDK by NVIDIA