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

Animator resources. More...

Inheritance diagram for Animator:

Public Member Functions

Constructors
Animator new ()
 Create animator. More...
 
Management
Rig getRig ()
 Rig or null if not set. More...
 
void setRig (Rig rig)
 Set rig or null if not set. More...
 
Animation getAnimation ()
 Animation or null if not set. More...
 
void setAnimation (Animation animation)
 Set animation or null if not set. More...
 
Controllers
int getControllerCount ()
 Nnumber of controllers. More...
 
void setControllerCount (int count)
 Set number of controllers. More...
 
float getControllerValue (int controller)
 Value of a controller. More...
 
float getControllerMinimum (int controller)
 Minimum limit of a controller. More...
 
float getControllerMaximum (int controller)
 Maximum limit of a controller. More...
 
Vector getControllerVector (int controller)
 Vector of a controller. More...
 
void setControllerRangeAt (int controller, float minValue, float maxValue)
 Set controller value range. More...
 
void setControllerValueAt (int controller, float value)
 Set controller value. More...
 
void setControllerVectorAt (int controller, Vector vector)
 Set controller vector. More...
 
void setControllerFrozenAt (int controller, bool frozen)
 Set if the controller is frozen. More...
 
void setControllerClampAt (int controller, bool clamp)
 Set if controller value is clamped or wrapped around if outside range. More...
 
void setControllerFromMoveAt (int controller, String move)
 Set controller range from the given move. More...
 
Links
int getLinkCount ()
 Number of links. More...
 
int addLink (int controller)
 Add link with controller and no mapping points. More...
 
void removeAllLinks ()
 Remove all links. More...
 
void setLinkController (int link, int controller)
 Set controller of link. More...
 
void setLinkRepeat (int link, int repeat)
 Set repeat count along X axis of link. More...
 
void linkAddPoint (int link, float x, float y)
 Add mapping point to link. More...
 
void linkAddPoint (int link, Vector2 point)
 Add mapping point to link. More...
 
void linkRemoveAllPoints (int link)
 Remove all mapping points from link. More...
 
Rules
int getRuleCount ()
 Number of rules. More...
 
void addRule (AnimatorRule rule)
 Add rule. More...
 
AnimatorRule getRuleAt (int index)
 Rule at index. More...
 
void removeAllRules ()
 Remove all rules. More...
 
Bones
void addBone (String bone)
 Add bone. More...
 
void removeAllBones ()
 Remove all bones. More...
 

Detailed Description

Animator resources.

Animators provide support to generate animation states from different sources using rules. Rules can use static precanned animation data from Animation resources, calculate state using algorithms or capture and store previous animation states.

Animators only define how animation states are calculated. Use AnimatorInstance to do actual calculation of animation states for a specific world element. Thus a single animator can be shared by multiple animator instances each having an own state.

While it is allowed to change an animator while it is in use by animator instances it is not an adviceable practise. Changing the animator structure invalidates the state of animator instances resulting in unpredictable states.

Animators are valid if they have a Rig assigned. It is not required to assign an Animation. Without an Animation only procedural rules can be used. Animation rules only work if an Animation is assigned. If you want to use different animations you have to use different animators using the sub animator rule.

Animators can be created in the DEIGDE Animator Editor. Animator XML files can be loaded using LoadSave.LoadAnimator.

This is a native class. It can not be subclassed.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ addBone()

void addBone ( String  bone)

Add bone.

§ addLink()

int addLink ( int  controller)

Add link with controller and no mapping points.

If the controller does not exist the link uses 0 as input value during calculations.

Returns
Index of added link.

§ addRule()

void addRule ( AnimatorRule  rule)

Add rule.

§ getAnimation()

Animation getAnimation ( )

Animation or null if not set.

§ getControllerCount()

int getControllerCount ( )

Nnumber of controllers.

§ getControllerMaximum()

float getControllerMaximum ( int  controller)

Maximum limit of a controller.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ getControllerMinimum()

float getControllerMinimum ( int  controller)

Minimum limit of a controller.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ getControllerValue()

float getControllerValue ( int  controller)

Value of a controller.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ getControllerVector()

Vector getControllerVector ( int  controller)

Vector of a controller.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ getLinkCount()

int getLinkCount ( )

Number of links.

§ getRig()

Rig getRig ( )

Rig or null if not set.

§ getRuleAt()

AnimatorRule getRuleAt ( int  index)

Rule at index.

Exceptions
EOutOfBoundaryindex is less than 0 or large than or equal to getRuleCount().

§ getRuleCount()

int getRuleCount ( )

Number of rules.

§ linkAddPoint() [1/2]

void linkAddPoint ( int  link,
float  x,
float  y 
)

Add mapping point to link.

Exceptions
EOutOfBoundarylink is less than 0 or large than or equal to getLinkCount().

§ linkAddPoint() [2/2]

void linkAddPoint ( int  link,
Vector2  point 
)

Add mapping point to link.

Exceptions
EOutOfBoundarylink is less than 0 or large than or equal to getLinkCount().

§ linkRemoveAllPoints()

void linkRemoveAllPoints ( int  link)

Remove all mapping points from link.

Exceptions
EOutOfBoundarylink is less than 0 or large than or equal to getLinkCount().

§ new()

Animator new ( )

Create animator.

§ removeAllBones()

void removeAllBones ( )

Remove all bones.

§ removeAllLinks()

void removeAllLinks ( )

Remove all links.

§ removeAllRules()

void removeAllRules ( )

Remove all rules.

§ setAnimation()

void setAnimation ( Animation  animation)

Set animation or null if not set.

§ setControllerClampAt()

void setControllerClampAt ( int  controller,
bool  clamp 
)

Set if controller value is clamped or wrapped around if outside range.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ setControllerCount()

void setControllerCount ( int  count)

Set number of controllers.

Exceptions
EInvalidParamcount is less than 0.

§ setControllerFromMoveAt()

void setControllerFromMoveAt ( int  controller,
String  move 
)

Set controller range from the given move.

Requires a set animation. If no animation is set or the move is not found the minimum and maximum are set to 0.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ setControllerFrozenAt()

void setControllerFrozenAt ( int  controller,
bool  frozen 
)

Set if the controller is frozen.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ setControllerRangeAt()

void setControllerRangeAt ( int  controller,
float  minValue,
float  maxValue 
)

Set controller value range.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ setControllerValueAt()

void setControllerValueAt ( int  controller,
float  value 
)

Set controller value.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ setControllerVectorAt()

void setControllerVectorAt ( int  controller,
Vector  vector 
)

Set controller vector.

Exceptions
EOutOfBoundarycontroller is less than 0 or large than or equal to getControllerCount().

§ setLinkController()

void setLinkController ( int  link,
int  controller 
)

Set controller of link.

If the controller does not exist the link uses 0 as input value during calculations.

Exceptions
EOutOfBoundarylink is less than 0 or large than or equal to getLinkCount().

§ setLinkRepeat()

void setLinkRepeat ( int  link,
int  repeat 
)

Set repeat count along X axis of link.

Exceptions
EInvalidParamrepeat is less than 1.

§ setRig()

void setRig ( Rig  rig)

Set rig or null if not set.


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