Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

GAUGE3D::GLight Class Reference

Represents a light source in a 3D scene. More...

#include <gauge3d/renderer/light.h>

Inherits GAUGE3D::GObject.

List of all members.

Public Methods

virtual ~GLight ()
virtual void Show ()=0
 Turn on the light. More...

virtual void Hide ()=0
 Turn off the light.

virtual void Remove ()=0
 Permenantly remove the light from the scene.

virtual void Position (const GVector &position)=0
 Set the position of the light, and make the light local.

virtual void Direction (const GVector &direction)=0
 Set the direction of the light, and make the light infinite.

virtual void Color (float red,float green,float blue)=0
 Set the color of the light.

virtual void Color (const float color[])=0
 Set the color of the light. (3-element array: RGB).

virtual void LightProps (float ambient,float diffuse,float specular=0.0)=0
 Set the properties of the light. More...

virtual void LightProps2v (const float lightProps[])=0
 Set the properties of the light. (ambient and diffuse).

virtual void LightProps3v (const float lightProps[])=0
 Set the properties of the light. (ambient, diffuse, and specular).

virtual void Attenuation (float linear,float quadratic=0.0)=0
 Sets linear and quadratic attenuation factors. (makes light dimmer with distance).

virtual void Spotlight (const GVector &direction,float exponent,float width)=0
 Make the light act like a spotlight. More...


Detailed Description

Represents a light source in a 3D scene.


Member Function Documentation

void GAUGE3D::GLight::Show ( ) [pure virtual]
 

Turn on the light.

All lights start out hidden. After you have cached the light, call Show() to enable it. Show and Hide are a good way to turn lights on and off.

void GAUGE3D::GLight::LightProps ( float ambient,
float diffuse,
float specular = 0.0 ) [pure virtual]
 

Set the properties of the light.

Parameters:
ambient   The ambient light level. This represets the light that is not coming directly from the source, but has bounced off a few walls first. It is simulated through simple distance attenuation.
diffuse   The diffuse light level. This represets the light that is coming directly from the source. The orientation of the surface relative to the light source affects the level of the light, but the viewpoint does not matter.
specular   The specular light level. This represents light that has been reflected off the surface of the object. Both the orientation of the object's surface as well as the viewpoint are taken into account.

void GAUGE3D::GLight::Spotlight ( const GVector & direction,
float exponent,
float width ) [pure virtual]
 

Make the light act like a spotlight.

Parameters:
direction   The direction of the spot light.
exponent   How focused the light is. Setting this higher will make the center of the spot brighter and the edges dimmer.
width   The width of the spotlight in degrees. Set to -1.0 to disable the spotlight effect.


The documentation for this class was generated from the following file:
Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000