Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECBehaviorLightAnimation Class Reference

Behavior element behavior adding animation support to ECBehaviorLight. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorLightAnimation:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  ECCLightParameter
 Composable Light parameter properties. More...
class  Factory
 Behavior factory. More...
class  Instance
 Behavior instance. More...
enum  LightParameter
 Light parameter. More...

Public Member Functions

void dispose ()
 Dispose of behavior.
ECPAnimation getAnimation ()
 Animation.
ECComposeBTSM getBTSMs ()
 Compose behavior trees and state machines.
ECBehaviorComponent getComponent ()
 Component behavior or null.
ECPBoolean getEnabled ()
 Animation is enabled.
ECBehaviorLight getLight ()
 Light behavior to modify.
ECCLightParameter getLightParameter (LightParameter parameter)
 Light parameter element class properties.
ECPString getMove ()
 Animation move name.
ECPFloat getPlaySpeed ()
 Play speed.
String getPrefix ()
 Prefix.
ECBehaviorTriggered getTrigger ()
 Trigger enable.
TSTriggerTable getTriggerTable ()
 Trigger table or null if not used.
Instance instance (BehaviorElement element)
 Get instance in element from owner element class.
ECBehaviorLightAnimation new (BehaviorElementClass eclass, ECBehaviorLight light, ECBehaviorComponent component)
 Create behavior element class.
ECBehaviorLightAnimation new (BehaviorElementClass eclass, ECBehaviorLight light, ECBehaviorComponent component, String id)
ECBehaviorLightAnimation new (BehaviorElementClass eclass, ECBehaviorLight light, ECBehaviorComponent component, TSTriggerTable triggerTable)
ECBehaviorLightAnimation new (BehaviorElementClass eclass, ECBehaviorLight light, ECBehaviorComponent component, TSTriggerTable triggerTable, String id)
ECBehaviorLightAnimation new (BehaviorElementClass eclass, ECBehaviorLight light, ECBehaviorComponent component, TSTriggerTable triggerTable, String id, String subID)
ECBehaviorLightAnimation new (BehaviorElementClass eclass, ECBehaviorLight light, ECBehaviorComponent component, TSTriggerTable triggerTable, String id, String subID, String prefix)
void setComponent (ECBehaviorComponent component)
 Set component behavior or null.
void setLight (ECBehaviorLight light)
 Set light behavior to modify.
void setTriggerTable (TSTriggerTable triggerTable)
 Set trigger table or null if not used.
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index.
String getBehaviorID ()
 Unique identifier of behavior.
String getID ()
 Identifier.
int getInstanceIndex ()
 Instance index.
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior.
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior.
Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance.

Static Public Member Functions

static ECBehaviorLightAnimation getBehaviorIn (BehaviorElementClass eclass)
 First ECBehaviorLightAnimation or null if absent.

Public Attributes

ECPAnimation pAnimation
ECComposeBTSM pBTSMs
ECBehaviorComponent pComponent
ECPBoolean pEnabled
ECBehaviorLight pLight
Dictionary pLightParameters
ECPString pMove
ECPFloat pPlaySpeed
String pPrefix
ECBehaviorTriggered pTrigger
TSTriggerTable pTriggerTable

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier.
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior.
void setBehaviorID (String identifier)
 Set behavior identifier.
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".

Detailed Description

Behavior element behavior adding animation support to ECBehaviorLight.

Version
1.28

This behavior modifies the light parameters of ECBehaviorLight instances present in the element using move keyframes stored in an Animation or ECBehaviorComponent state. Animation playback starts when the light becomes activated and stops (and resets) if reactivated.

To use this behavior add first an ECBehaviorLight. Adding ECBehaviorLightAnimation will then register itself as listener to the ECBehaviorLight and also set it to use custom light handling.

Multiple ECBehaviorLightAnimation instances can be added to affect individual ECBehaviorLight instances like this example below.

class MyElement extends BehaviorElementClass
func new()
var ECBehaviorLight light1 = ECBehaviorLight.new(this)
var ECBehaviorLight light2 = ECBehaviorLight.new(this, "subLight")
end
end
Behavior element element class.
Definition BehaviorElementClass.ds:54
Behavior element behavior adding animation support to ECBehaviorLight.
Definition ECBehaviorLightAnimation.ds:94
ECBehaviorLightAnimation new(BehaviorElementClass eclass, ECBehaviorLight light, ECBehaviorComponent component)
Create behavior element class.
Behavior element behavior adding light support.
Definition ECBehaviorLight.ds:101

Using Animation keyframes from a move is used to animate the light parameters.

Using ECBehaviorComponent the animated state is used to animate the light parameters. In this case the play time is 0 since the component state is typically driven by an animator or manually.

The input values obtained either from animation keyframes or component state is remapped before applying to the light parameter. This linearly maps the lower remap value (default 0) to 0 output value and the upper remap value (default 1) to 1 output value. Values outside the remap range are extrapolated.

Remapping is applied before scaling.

Element class properties have the prefix "lightAnimation{(id)}.".

Scale factors

This behaviors scales intensity, range and spot angle. During init() call intensity, range and spot angle of light are stored as scale values. These values can be later on changed if required. Using this system the input intensity, range and spot angle values can be kept in the range from 0 to 1 similar to the other parameters. The final values are then obtained by scaling by the scale factor.

Hence intensity, range and spot angle are animated as relative values while all other light parameters are animated absolute.

This behavior supports persistable element class (setPersistable).

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_lightanimation

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorLightAnimation.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

Referenced by getBehaviorIn().

◆ getAnimation()

ECPAnimation Dragengine.Scenery.ECBehaviorLightAnimation.getAnimation ( )

Animation.

Referenced by getBehaviorIn().

◆ getBehaviorIn()

◆ getBTSMs()

ECComposeBTSM Dragengine.Scenery.ECBehaviorLightAnimation.getBTSMs ( )

Compose behavior trees and state machines.

Referenced by getBehaviorIn().

◆ getComponent()

ECBehaviorComponent Dragengine.Scenery.ECBehaviorLightAnimation.getComponent ( )

Component behavior or null.

Referenced by getBehaviorIn().

◆ getEnabled()

ECPBoolean Dragengine.Scenery.ECBehaviorLightAnimation.getEnabled ( )

Animation is enabled.

Referenced by getBehaviorIn().

◆ getLight()

ECBehaviorLight Dragengine.Scenery.ECBehaviorLightAnimation.getLight ( )

Light behavior to modify.

Referenced by getBehaviorIn().

◆ getLightParameter()

ECCLightParameter Dragengine.Scenery.ECBehaviorLightAnimation.getLightParameter ( LightParameter parameter)

Light parameter element class properties.

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorLightAnimation.Instance.getTime().

◆ getMove()

ECPString Dragengine.Scenery.ECBehaviorLightAnimation.getMove ( )

Animation move name.

Referenced by getBehaviorIn().

◆ getPlaySpeed()

ECPFloat Dragengine.Scenery.ECBehaviorLightAnimation.getPlaySpeed ( )

Play speed.

Referenced by getBehaviorIn().

◆ getPrefix()

String Dragengine.Scenery.ECBehaviorLightAnimation.getPrefix ( )

Prefix.

Referenced by getBehaviorIn().

◆ getTrigger()

ECBehaviorTriggered Dragengine.Scenery.ECBehaviorLightAnimation.getTrigger ( )

Trigger enable.

Referenced by getBehaviorIn().

◆ getTriggerTable()

TSTriggerTable Dragengine.Scenery.ECBehaviorLightAnimation.getTriggerTable ( )

Trigger table or null if not used.

Referenced by getBehaviorIn().

◆ instance()

Instance Dragengine.Scenery.ECBehaviorLightAnimation.instance ( BehaviorElement element)

Get instance in element from owner element class.

Referenced by getBehaviorIn(), and Dragengine.Scenery.ECBehaviorLightAnimation.Instance.getScaleIntensity().

◆ new() [1/6]

ECBehaviorLightAnimation Dragengine.Scenery.ECBehaviorLightAnimation.new ( BehaviorElementClass eclass,
ECBehaviorLight light,
ECBehaviorComponent component )

Create behavior element class.

Component and trigger table are optional.

Referenced by getBehaviorIn().

◆ new() [2/6]

ECBehaviorLightAnimation Dragengine.Scenery.ECBehaviorLightAnimation.new ( BehaviorElementClass eclass,
ECBehaviorLight light,
ECBehaviorComponent component,
String id )

◆ new() [3/6]

ECBehaviorLightAnimation Dragengine.Scenery.ECBehaviorLightAnimation.new ( BehaviorElementClass eclass,
ECBehaviorLight light,
ECBehaviorComponent component,
TSTriggerTable triggerTable )

◆ new() [4/6]

ECBehaviorLightAnimation Dragengine.Scenery.ECBehaviorLightAnimation.new ( BehaviorElementClass eclass,
ECBehaviorLight light,
ECBehaviorComponent component,
TSTriggerTable triggerTable,
String id )

◆ new() [5/6]

ECBehaviorLightAnimation Dragengine.Scenery.ECBehaviorLightAnimation.new ( BehaviorElementClass eclass,
ECBehaviorLight light,
ECBehaviorComponent component,
TSTriggerTable triggerTable,
String id,
String subID )

◆ new() [6/6]

ECBehaviorLightAnimation Dragengine.Scenery.ECBehaviorLightAnimation.new ( BehaviorElementClass eclass,
ECBehaviorLight light,
ECBehaviorComponent component,
TSTriggerTable triggerTable,
String id,
String subID,
String prefix )

◆ setComponent()

void Dragengine.Scenery.ECBehaviorLightAnimation.setComponent ( ECBehaviorComponent component)

Set component behavior or null.

Referenced by getBehaviorIn().

◆ setLight()

void Dragengine.Scenery.ECBehaviorLightAnimation.setLight ( ECBehaviorLight light)

Set light behavior to modify.

Referenced by getBehaviorIn().

◆ setTriggerTable()

void Dragengine.Scenery.ECBehaviorLightAnimation.setTriggerTable ( TSTriggerTable triggerTable)

Set trigger table or null if not used.

Referenced by getBehaviorIn().

Member Data Documentation

◆ pAnimation

ECPAnimation Dragengine.Scenery.ECBehaviorLightAnimation.pAnimation

Referenced by getBehaviorIn().

◆ pBTSMs

ECComposeBTSM Dragengine.Scenery.ECBehaviorLightAnimation.pBTSMs

Referenced by getBehaviorIn().

◆ pComponent

ECBehaviorComponent Dragengine.Scenery.ECBehaviorLightAnimation.pComponent

Referenced by getBehaviorIn().

◆ pEnabled

ECPBoolean Dragengine.Scenery.ECBehaviorLightAnimation.pEnabled

Referenced by getBehaviorIn().

◆ pLight

ECBehaviorLight Dragengine.Scenery.ECBehaviorLightAnimation.pLight

Referenced by getBehaviorIn().

◆ pLightParameters

Dictionary Dragengine.Scenery.ECBehaviorLightAnimation.pLightParameters

Referenced by getBehaviorIn().

◆ pMove

ECPString Dragengine.Scenery.ECBehaviorLightAnimation.pMove

Referenced by getBehaviorIn().

◆ pPlaySpeed

ECPFloat Dragengine.Scenery.ECBehaviorLightAnimation.pPlaySpeed

Referenced by getBehaviorIn().

◆ pPrefix

String Dragengine.Scenery.ECBehaviorLightAnimation.pPrefix

Referenced by getBehaviorIn().

◆ pTrigger

ECBehaviorTriggered Dragengine.Scenery.ECBehaviorLightAnimation.pTrigger

Referenced by getBehaviorIn().

◆ pTriggerTable

TSTriggerTable Dragengine.Scenery.ECBehaviorLightAnimation.pTriggerTable

Referenced by getBehaviorIn().


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