Drag[en]gine Script Module DragonScript Script API  1.0
BaseLight Class Reference

Basic light class. More...

Inheritance diagram for BaseLight:
Element

Classes

class  ActivateLightListener
 Trigger listener to activate light. More...
 

Public Member Functions

void addToGameWorld ()
 Add to game world. More...
 
void dispose ()
 Disposes of element. More...
 
bool getActivated ()
 Light is activated. More...
 
Light getLight ()
 Light. More...
 
TSTriggerExpression getTriggerExpressionActivate ()
 Activate light trigger expression or null if not used. More...
 
TSTriggerTable getTriggerTable ()
 Trigger table to link trigger expression to or null if not set. More...
 
void init (StubElement stub)
 Initialize element from stub. More...
 
BaseLight new (BaseLightClass eclass)
 Create element. More...
 
void onSetGeometry ()
 Position and orientation changed. More...
 
void onSetOrientation ()
 Orientation changed. More...
 
void onSetPosition ()
 Position changed. More...
 
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read element from file. More...
 
void removeFromGameWorld ()
 Remove from game world. More...
 
void setActivated (bool activated)
 Set if light is activated. More...
 
void toggle ()
 Toggle light activated state. More...
 
void visit (ElementVisitor visitor)
 Visit element. More...
 
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 
- Public Member Functions inherited from Element
void addToGameWorld ()
 
void dispose ()
 
void enterFrame ()
 Frame update started. More...
 
ElementClass getClass ()
 
DMatrix getElementMatrix ()
 Matrix to transform from element space into world space. More...
 
GameWorld getGameWorld ()
 
UniqueID getID ()
 
DMatrix getInverseElementMatrix ()
 Matrix to transform from world space into element space. More...
 
Quaternion getOrientation ()
 
Element getParent ()
 
DVector getPosition ()
 
StubElement getStub ()
 Element stub used to create the element. More...
 
bool getTouchable ()
 
bool getVisible ()
 
void init (StubElement stub)
 Initialize element from stub. More...
 
bool isChildOf (Element parent)
 
bool isMyselfOrChildOf (Element parent)
 
Element new (ElementClass elementClass)
 
void onSetGameWorld ()
 
void onSetGeometry ()
 
void onSetOrientation ()
 
void onSetParent ()
 
void onSetPosition ()
 
void onSetTouchable ()
 
void onSetVisible ()
 
void postThink (float elapsed)
 
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read element from file reader. More...
 
void removeFromGameWorld ()
 
void removeFromGameWorldIfPresent ()
 Remove element from game world if present. More...
 
void setGameWorld (GameWorld gameWorld)
 
void setGeometry (DVector position, Quaternion orientation)
 
void setID (UniqueID id)
 
void setOrientation (Quaternion orientation)
 
void setParent (Element parent)
 
void setPosition (DVector position)
 
void setStub (StubElement stub)
 Set element stub used to create the element. More...
 
void setTouchable (bool touchable)
 
void setVisible (bool visible)
 
void think (float elapsed)
 
String toString ()
 
void visit (ElementVisitor visitor)
 
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write element to file writer. More...
 
void writeToFileWithStub (PersistencyEnvironment env, FileWriter writer)
 Write element to file writer with stub. More...
 

Protected Member Functions

void setTriggerExpressionActivate (TSTriggerExpression expression)
 Set activate light trigger expression or null if not used. More...
 
void setTriggerTable (TSTriggerTable triggerTable)
 Trigger table to link trigger expression to or null if not set. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Element
static Element readElementFromFileWithStub (PersistencyEnvironment env, FileReader reader, ElementClassList ElementClassList)
 Load element from file reader with stub supporting null element. More...
 
static void writeElementToFileWithStub (PersistencyEnvironment env, FileWriter writer, Element element)
 Write element to file writer with stub supporting null element. More...
 

Detailed Description

Basic light class.

To use the activate trigger expression the subclass or instance creator has to set the trigger table to use to link the expression with.

Basic light class supports manually changing the activated state if no activate trigger expression is used. This allows foreign elements to change the activated state and this state is persisted to file writers.

Trigger element supports these stub properties:

Property Value
color Light color in the form "red green blue" where each component is a floating point value in the range from 0 to 1
intensity Light intensity in engine intensities
range Light range
halfIntensityDistance Half intensity distance
ambientRatio Percentage of light intensity in shadow areas
spotAngle Outer spot Angle in degrees
spotRatio Spot ratio as height divided by width
spotSmoothness Spot smoothness as decimal percentage measured from outer spot angle towards the center
spotExponent Spot exponent indicating fall-off curve for spot type.
shape Light shape for doing area lights
lightSkin Light skin to modify light color
hintMovement Hint for movement behavior of light: static, jittering or dynamic
hintParameter Hint for parameter change behavior: static, activation, flicker or dynamic
hintShadowImportance Hint for importance of light casting shadows. Value between 0 (unimportant) and 100 (very important)
activated Light is initially activated. Has no effect if a trigger expression is used
castShadows Light is casting shadows
triggerActivate Trigger expression used to activate light

Parameters persisted to file writers

  • Activated

If subclass needs changing other parameters it has to extend readFromFile() and writeToFile().

Member Function Documentation

◆ addToGameWorld()

void addToGameWorld ( )

Add to game world.

◆ dispose()

void dispose ( )

Disposes of element.

◆ getActivated()

bool getActivated ( )

Light is activated.

◆ getLight()

Light getLight ( )

◆ getTriggerExpressionActivate()

TSTriggerExpression getTriggerExpressionActivate ( )

Activate light trigger expression or null if not used.

◆ getTriggerTable()

TSTriggerTable getTriggerTable ( )

Trigger table to link trigger expression to or null if not set.

◆ init()

void init ( StubElement  stub)

Initialize element from stub.

◆ new()

BaseLight new ( BaseLightClass  eclass)

Create element.

◆ onSetGeometry()

void onSetGeometry ( )

Position and orientation changed.

◆ onSetOrientation()

void onSetOrientation ( )

Orientation changed.

◆ onSetPosition()

void onSetPosition ( )

Position changed.

◆ readFromFile()

void readFromFile ( PersistencyEnvironment  env,
FileReader  reader 
)

Read element from file.

◆ removeFromGameWorld()

void removeFromGameWorld ( )

Remove from game world.

◆ setActivated()

void setActivated ( bool  activated)

Set if light is activated.

◆ setTriggerExpressionActivate()

void setTriggerExpressionActivate ( TSTriggerExpression  expression)
protected

Set activate light trigger expression or null if not used.

◆ setTriggerTable()

void setTriggerTable ( TSTriggerTable  triggerTable)
protected

Trigger table to link trigger expression to or null if not set.

◆ toggle()

void toggle ( )

Toggle light activated state.

◆ visit()

void visit ( ElementVisitor  visitor)

Visit element.

◆ writeToFile()

void writeToFile ( PersistencyEnvironment  env,
FileWriter  writer 
)

Writes the element to a file.


The documentation for this class was generated from the following file: