Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members

Light Class Reference
[Scene Graph]

#include <lvt/Light.h>

Inheritance diagram for Light:

Inheritance graph
[legend]
List of all members.

Detailed Description

Encapsulates an OpenGL light.


Public Member Functions

int GetGLLightNum () const
 Returns the OpenGL light number of this object.
 Light ()
 Default constructor.
virtual void Render ()
 Renders the light.
void SetCutoff (float cutoff)
 Sets the light's spotlight cutoff.
void SetSpotExponent (float exp)
 Controls the concentration of the light.
void SetAmbient (float r, float g, float b, float a=1.0f)
 Sets the ambient component of the light.
void SetAmbient (const Vec &v)
 Sets the ambient component of the light.
void SetAttenuation (float c, float l, float q)
 Sets the light's attenuation factors.
void SetAttenuation (const Vec &v)
 Sets the light's attenuation factors.
void SetColor (float r, float g, float b, float a=1.0f)
 Sets the diffuse, ambient, and specular terms.
void SetColor (const Vec &v)
 Sets the diffuse, ambient, and specular terms.
void SetDiffuse (float r, float g, float b, float a=1.0f)
 Sets the diffuse component of the light.
void SetDiffuse (const Vec &v)
 Sets the diffuse component of the light.
void SetDirection (float x, float y, float z)
 Sets the spotlight direction of the light.
void SetDirection (const Vec &v)
 Sets the spotlight direction of the light.
void SetPosition (float x, float y, float z, float w=1)
 Sets the light's position.
void SetPosition (const Vec &pos)
 Sets the light's position.
void SetSpecular (float r, float g, float b, float a=1.0f)
 Sets the specular component of the light.
void SetSpecular (const Vec &v)
 Sets the specular component of the light.


Constructor & Destructor Documentation

Light  ) 
 

Default constructor.

The light's position, color components, and other parameters are initialized to the OpenGL defaults.


Member Function Documentation

int GetGLLightNum  )  const [inline]
 

Returns the OpenGL light number of this object.

virtual void Render  )  [virtual]
 

Renders the light.

Activates lighting, and the corresponding light in OpenGL.

Implements Node.

void SetAmbient float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the ambient component of the light.

void SetAmbient const Vec v  )  [inline]
 

Sets the ambient component of the light.

void SetAttenuation float  c,
float  l,
float  q
[inline]
 

Sets the light's attenuation factors.

void SetAttenuation const Vec v  )  [inline]
 

Sets the light's attenuation factors.

An OpenGL light attenuates with distance according to the following formula 1/(c + l*d + q*d^2). Where c, l, and q are controllable constants, and d is the distance from the light to the point being lit. The default is q = 0, l = 0, c = 1, i.e. no attenuation.

void SetColor float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the diffuse, ambient, and specular terms.

void SetColor const Vec v  )  [inline]
 

Sets the diffuse, ambient, and specular terms.

void SetCutoff float  cutoff  )  [inline]
 

Sets the light's spotlight cutoff.

The light cutoff is the angle, in degrees, from the lights spotlight direction that is illuminated by the light. The default is 180, resulting in an omni-directional light.

void SetDiffuse float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the diffuse component of the light.

void SetDiffuse const Vec v  )  [inline]
 

Sets the diffuse component of the light.

void SetDirection float  x,
float  y,
float  z
[inline]
 

Sets the spotlight direction of the light.

void SetDirection const Vec v  )  [inline]
 

Sets the spotlight direction of the light.

void SetPosition float  x,
float  y,
float  z,
float  w = 1
[inline]
 

Sets the light's position.

void SetPosition const Vec pos  )  [inline]
 

Sets the light's position.

void SetSpecular float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the specular component of the light.

void SetSpecular const Vec v  )  [inline]
 

Sets the specular component of the light.

void SetSpotExponent float  exp  )  [inline]
 

Controls the concentration of the light.

The default value is 0, resulting in uniform brightness throughout the area illuminated by the spotlight. Higher values cause the light to attenuate more quickly towards the edges.


Generated on Thu Feb 17 09:45:47 2005 for liblvt by  doxygen 1.4.1