Main   Class List   Namespace List   Wiki

LightBase Class Reference
[Lighting]

This is the base class for light objects. More...

Inheritance diagram for LightBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void playAnimation ()
 Plays the light animation assigned to this light with the existing LightAnimData datablock.
void playAnimation (LightAnimData anim)
 Plays the light animation on this light using a new LightAnimData. If no LightAnimData is passed the existing one is played.
void setLightEnabled (bool state)
 Toggles the light on and off.

Public Attributes

void pauseAnimation
 Stops the light animation.
Light Animation

bool animate
 Toggles animation for the light on and off.
float animationPeriod
 The length of time in seconds for a single playback of the light animation (must be > 0).
float animationPhase
 The phase used to offset the animation start time to vary the animation of nearby lights.
LightAnimData animationType
 Datablock containing light animation information (LightAnimData).
Advanced Lighting

Point3F attenuationRatio
 The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.
filename cookie
 A custom pattern texture which is projected from the light.
float fadeStartDistance
 Start fading shadows out at this distance. 0 = auto calculate this distance.
bool lastSplitTerrainOnly
 This toggles only terrain being rendered to the last split of a PSSM shadow map.
float logWeight
 The logrithmic PSSM split distance factor.
int numSplits
 The logrithmic PSSM split distance factor.
Point4F overDarkFactor
 The ESM shadow darkening factor.
float shadowDistance
 The distance from the camera to extend the PSSM shadow.
float shadowSoftness
ShadowType shadowType
 The type of shadow to use on this light.
int texSize
 The texture size of the shadow map.
Light

float brightness
 Adjusts the lights power, 0 being off completely.
bool castShadows
 Enables/disabled shadow casts by this light.
ColorF color
 Changes the base color hue of the light.
bool isEnabled
 Enables/Disables the object rendering and functionality in the scene.
float priority
 Used for sorting of lights by the light manager. Priority determines if a light has a stronger effect than, those with a lower value.
Misc

float flareScale
 Globally scales all features of the light flare.
LightFlareData flareType
 Datablock containing light flare information (LightFlareData).
Advanced Lighting Lightmap

bool includeLightmappedGeometryInShadow
 This light should render lightmapped geometry during its shadow-map update (ignored if 'representedInLightmap' is false).
bool representedInLightmap
 This light is represented in lightmaps (static light, default: false).
ColorF shadowDarkenColor
 The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if 'representedInLightmap' is false).

Static Public Attributes

static bool isRenderable
 Disables rendering of all instances of this type.
static bool isSelectable
 Disables selection of all instances of this type.

Detailed Description

This is the base class for light objects.

It is *NOT* intended to be used directly in script, but exists to provide the base member variables and generic functionality. You should be using the derived classes PointLight and SpotLight, which can be declared in TorqueScript or added from the World Editor.

For this class, we only add basic lighting options that all lighting systems would use. The specific lighting system options are injected at runtime by the lighting system itself.

See also:
PointLight
SpotLight

Member Function Documentation

void LightBase::playAnimation (  ) 

Plays the light animation assigned to this light with the existing LightAnimData datablock.

Example:
// Play the animation assigned to this light
CrystalLight.playAnimation();
void LightBase::playAnimation ( LightAnimData  anim  ) 

Plays the light animation on this light using a new LightAnimData. If no LightAnimData is passed the existing one is played.

Parameters:
anim Name of the LightAnimData datablock to be played
Example:
// Play the animation using a new LightAnimData datablock
CrystalLight.playAnimation(SubtlePulseLightAnim);
void LightBase::setLightEnabled ( bool  state  ) 

Toggles the light on and off.

Parameters:
state Turns the light on (true) or off (false)
Example:
// Disable the light
CrystalLight.setLightEnabled(false);

// Renable the light
CrystalLight.setLightEnabled(true);

Member Data Documentation

Toggles animation for the light on and off.

The length of time in seconds for a single playback of the light animation (must be > 0).

The phase used to offset the animation start time to vary the animation of nearby lights.

Datablock containing light animation information (LightAnimData).

The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.

Adjusts the lights power, 0 being off completely.

Enables/disabled shadow casts by this light.

Changes the base color hue of the light.

A custom pattern texture which is projected from the light.

Start fading shadows out at this distance. 0 = auto calculate this distance.

Globally scales all features of the light flare.

Datablock containing light flare information (LightFlareData).

This light should render lightmapped geometry during its shadow-map update (ignored if 'representedInLightmap' is false).

Enables/Disables the object rendering and functionality in the scene.

bool LightBase::isRenderable [static]

Disables rendering of all instances of this type.

Reimplemented from SceneObject.

Reimplemented in PointLight, and SpotLight.

bool LightBase::isSelectable [static]

Disables selection of all instances of this type.

Reimplemented from SceneObject.

Reimplemented in PointLight, and SpotLight.

This toggles only terrain being rendered to the last split of a PSSM shadow map.

The logrithmic PSSM split distance factor.

The logrithmic PSSM split distance factor.

The ESM shadow darkening factor.

Stops the light animation.

Used for sorting of lights by the light manager. Priority determines if a light has a stronger effect than, those with a lower value.

This light is represented in lightmaps (static light, default: false).

The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if 'representedInLightmap' is false).

The distance from the camera to extend the PSSM shadow.

The type of shadow to use on this light.

The texture size of the shadow map.



Copyright © GarageGames, LLC. All Rights Reserved.