A SERVICE OF

logo

Using Lights in Scenes
91
csSpotLight
csSpotLight is a directional light source. Because csSpotLight is subclassed from
csPointLight, csSpotLight can be positioned.
The light emanates as a cone; the axis of the cone species the direction of the spot light
and is dened in the following methods:
void setDirection (const csVec3f& direction)
void setDirection (csFloat v0, csFloat v1, csFloat v2)
The intensity distribution and the cut off angle of the light are set with the following
methods:
void setExponent(csFloat component);
void setCutOffAngle(csFloat cutOffAngle);
csPointLight
csPointLight is a point light source that radiates equally in all directions. The range of a
csPointLights effect is localized to a csEnvironment object when the csPointLight is
included in its light array.
All descendants of a csEnvironment object that lie within the csPointLights shining
radius are affected by the csPointLight. csTransform objects affect the location and
shining radius of each csPointLight.
Use the following methods to dene a csPointLight.
void setLocation(const csVec3f& location);
void setLocation(csFloat v0, csFloat v1, csFloat v2);
void setRadius(csFloat radius);
void setAttenuation(const csVec3f& attenuation);
void setAttenuation(csFloat v0, csFloat v1, csFloat v2);
There is a corresponding set of get...() methods that return the current point light settings.
setLocation() denes the location of the csPointLight.
setRadius() denes the maximum range of the light.
setAttenuation() denes how quickly the intensity of the light declines over distance.