Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.ECBehaviorActorAnimated Class Reference

Behavior adding animation support to actors. More...

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

Classes

class  BlockListenerFactory
 Factory creating listeners using block. More...
 
class  DefaultListener
 Default implementation of behavior instance listener. More...
 
class  Instance
 Behavior instance. More...
 
interface  Listener
 Listener for behavior instance events. More...
 
interface  ListenerFactory
 Factory creating listeners. More...
 

Public Member Functions

void addListenerFactory (Block blockFactory)
 Add listener factory using block. More...
 
void addListenerFactory (ListenerFactory factory)
 Add listener factory. More...
 
void createListeners (Instance instance)
 Create listeners from factories adding them to behavior instance. More...
 
void dispose ()
 Dispose of behavior. More...
 
void forEachListenerFactory (Block ablock)
 Visit listener factories with block with argument ListenerFactory. More...
 
ECPAnimatorMap getAnimators ()
 Animators. More...
 
ECBehaviorComponent getComponent ()
 Component behavior to animate. More...
 
Dictionary getControllerMapping ()
 Controller mapping as Dictionary mapping String name to Locomotion.ATTR_* . More...
 
ECBehaviorLocomotion getLocomotion ()
 Locomotion behavior or null. More...
 
ECBehaviorActorAnimated new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion)
 Create behavior element class. More...
 
ECBehaviorActorAnimated new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders)
 
ECBehaviorActorAnimated new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders, String id)
 
ECBehaviorActorAnimated new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders, String id, String subID)
 
ECBehaviorActorAnimated new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, Loaders loaders, String id, String subID, String prefix)
 
ECBehaviorActorAnimated new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, String id)
 
ECBehaviorActorAnimated new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorLocomotion locomotion, String id, String subID)
 
void setDefaultControllerMappings ()
 Set default controller mappings. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 

Static Public Member Functions

static ECBehaviorActorAnimated getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Public Attributes

ECPAnimatorMap pAnimators
 
ECBehaviorComponent pComponent
 
Dictionary pControllerMappings
 
Array pListenerFactories
 
ECBehaviorLocomotion pLocomotion
 

Additional Inherited Members

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

Detailed Description

Behavior adding animation support to actors.

Adds AnimatorInstance and a map of animators to switch using string identifiers.

To simplify using actor animation a map of controller bindings can be defined to be applied to ECBehaviorLocomotion each time the animator changes. This requires controller names to be consistent and unique across animators but makes life a lot easier. If no map is defined the behavior does not change the locomotion controller mapping. While changing animator controllers with matching names are not reset.

To use this class add these behaviors to the actor:

Multiple behaviors can be added to animated different parts of the actor independent.

Element class property prefix is "actorAnimated{(id)}".

Member Function Documentation

◆ addListenerFactory() [1/2]

void Dragengine.Scenery.ECBehaviorActorAnimated.addListenerFactory ( Block  blockFactory)

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

void Dragengine.Scenery.ECBehaviorActorAnimated.addListenerFactory ( ListenerFactory  factory)

Add listener factory.

◆ createListeners()

void Dragengine.Scenery.ECBehaviorActorAnimated.createListeners ( Instance  instance)

Create listeners from factories adding them to behavior instance.

◆ dispose()

void Dragengine.Scenery.ECBehaviorActorAnimated.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ forEachListenerFactory()

void Dragengine.Scenery.ECBehaviorActorAnimated.forEachListenerFactory ( Block  ablock)

Visit listener factories with block with argument ListenerFactory.

◆ getAnimators()

ECPAnimatorMap Dragengine.Scenery.ECBehaviorActorAnimated.getAnimators ( )

◆ getBehaviorIn()

static ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorComponent.

◆ getComponent()

ECBehaviorComponent Dragengine.Scenery.ECBehaviorActorAnimated.getComponent ( )

Component behavior to animate.

◆ getControllerMapping()

Dictionary Dragengine.Scenery.ECBehaviorActorAnimated.getControllerMapping ( )

Controller mapping as Dictionary mapping String name to Locomotion.ATTR_* .

◆ getLocomotion()

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorActorAnimated.getLocomotion ( )

Locomotion behavior or null.

◆ new() [1/7]

ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorLocomotion  locomotion 
)

Create behavior element class.

These values are optional and can be null: locomotion.

◆ new() [2/7]

ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorLocomotion  locomotion,
Loaders  loaders 
)

◆ new() [3/7]

ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorLocomotion  locomotion,
Loaders  loaders,
String  id 
)

◆ new() [4/7]

ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorLocomotion  locomotion,
Loaders  loaders,
String  id,
String  subID 
)

◆ new() [5/7]

ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorLocomotion  locomotion,
Loaders  loaders,
String  id,
String  subID,
String  prefix 
)

◆ new() [6/7]

ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorLocomotion  locomotion,
String  id 
)

◆ new() [7/7]

ECBehaviorActorAnimated Dragengine.Scenery.ECBehaviorActorAnimated.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorLocomotion  locomotion,
String  id,
String  subID 
)

◆ setDefaultControllerMappings()

void Dragengine.Scenery.ECBehaviorActorAnimated.setDefaultControllerMappings ( )

Set default controller mappings.

Sets dictionary to these values: "idle": Locomotion.ATTR_ELAPSED_TIME "look.vertical": Locomotion.ATTR_LOOK_VERTICAL "look.horizontal": Locomotion.ATTR_LOOK_HORIZONTAL "turn.inPlace": Locomotion.ATTR_TIME_TURNIP "stance": Locomotion.ATTR_STANCE "move.walk": Locomotion.ATTR_DISPLACEMENT "move.run": Locomotion.ATTR_DISPLACEMENT "move.velocity": Locomotion.ATTR_RELATIVE_MOVING_SPEED "tilt.vertical": Locomotion.ATTR_TILT_VERTICAL "tilt.horizontal": Locomotion.ATTR_TILT_HORIZONTAL "tilt.offset": Locomotion.ATTR_TILT_OFFSET "interaction": Locomotion.ATTR_ELAPSED_TIME

Member Data Documentation

◆ pAnimators

ECPAnimatorMap Dragengine.Scenery.ECBehaviorActorAnimated.pAnimators

◆ pComponent

ECBehaviorComponent Dragengine.Scenery.ECBehaviorActorAnimated.pComponent

◆ pControllerMappings

Dictionary Dragengine.Scenery.ECBehaviorActorAnimated.pControllerMappings

◆ pListenerFactories

Array Dragengine.Scenery.ECBehaviorActorAnimated.pListenerFactories

◆ pLocomotion

ECBehaviorLocomotion Dragengine.Scenery.ECBehaviorActorAnimated.pLocomotion

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