Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.Animator Class Reference

Animator resources. More...

Inheritance diagram for Dragengine.Scenery.Animator:

Public Member Functions

Constructors
Animator new ()
 Create animator. More...
 
Controllers
int getControllerCount ()
 Nnumber of controllers. More...
 
void setControllerCount (int count)
 Set number of controllers. More...
 
AnimatorController getControllerAt (int index)
 Get wrapper for controller. More...
 
AnimatorController getControllerNamed (String name)
 Get wrapper for controller if present. More...
 
int indexOfControllerNamed (String name)
 Index of named controller or -1 if not found. 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 setLinkCurve (int link, CurveBezier curve)
 Set link curve. More...
 
void setLinkBone (int link, String bone)
 Set bone to use parameter of as input for link or empty string to not use. More...
 
void setLinkBoneParameter (int link, AnimatorLinkBoneParameter parameter)
 Set bone parameter to use as input for link. More...
 
void setLinkBoneValueRange (int link, float minimum, float maximum)
 Set bone value range. More...
 
void setLinkBoneValueRangeRotation (int link, float minimum, float maximum)
 Set bone value range for use with rotation parameter. More...
 
void setLinkVertexPositionSet (int link, String vertexPositionSet)
 Set vertex position set to use as input for link or empty string to not use. More...
 
void setLinkVertexPositionSetValueRange (int link, float minimum, float maximum)
 Set vertex position set value range. More...
 
void setLinkWrapY (int link, bool wrap)
 Set to wrap Y value instead of clamping. 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...
 
VertexPositionSets
void addVertexPositionSet (String vertexPositionSet)
 Add vertex position set. More...
 
void removeAllVertexPositionSets ()
 Remove all vertex position sets. 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...
 
static bool equals (Animator animator1, Animator animator2)
 Two animators are equal. 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.

Member Function Documentation

◆ addBone()

void Dragengine.Scenery.Animator.addBone ( String  bone)

Add bone.

◆ addLink()

int Dragengine.Scenery.Animator.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 Dragengine.Scenery.Animator.addRule ( AnimatorRule  rule)

Add rule.

◆ addVertexPositionSet()

void Dragengine.Scenery.Animator.addVertexPositionSet ( String  vertexPositionSet)

Add vertex position set.

Version
1.17

◆ equals()

static bool Dragengine.Scenery.Animator.equals ( Animator  animator1,
Animator  animator2 
)
static

Two animators are equal.

This is an extended version of equals() accepting also null for animator1 and animator2. equals() would thrown an exception if null is compared to anything. This call though allows to compare null against animators or even null itself. If animator1 or animator2 is null false is returned. If both are null true is returned.

◆ getAnimation()

Animation Dragengine.Scenery.Animator.getAnimation ( )

Animation or null if not set.

◆ getControllerAt()

AnimatorController Dragengine.Scenery.Animator.getControllerAt ( int  index)

Get wrapper for controller.

Warning
The wrapper is only valid as long as the controller structure in the animator is not changed.
Parameters
indexIndex of controller. If index is negative controller count is added to it. This allows to get controllers starting from the last controller.
Exceptions
EOutOfBoundarycontroller is less than -getControllerCount() or larger than or equal to getControllerCount().

◆ getControllerCount()

int Dragengine.Scenery.Animator.getControllerCount ( )

Nnumber of controllers.

◆ getControllerNamed()

AnimatorController Dragengine.Scenery.Animator.getControllerNamed ( String  name)

Get wrapper for controller if present.

Warning
The wrapper is only valid as long as the controller structure in the animator is not changed.
Parameters
nameName of controller. If no controller with this name is present null is returned.

◆ getLinkCount()

int Dragengine.Scenery.Animator.getLinkCount ( )

Number of links.

◆ getRig()

Rig Dragengine.Scenery.Animator.getRig ( )

Rig or null if not set.

◆ getRuleAt()

AnimatorRule Dragengine.Scenery.Animator.getRuleAt ( int  index)

Rule at index.

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

◆ getRuleCount()

int Dragengine.Scenery.Animator.getRuleCount ( )

Number of rules.

◆ indexOfControllerNamed()

int Dragengine.Scenery.Animator.indexOfControllerNamed ( String  name)

Index of named controller or -1 if not found.

◆ new()

Animator Dragengine.Scenery.Animator.new ( )

Create animator.

◆ removeAllBones()

void Dragengine.Scenery.Animator.removeAllBones ( )

Remove all bones.

◆ removeAllLinks()

void Dragengine.Scenery.Animator.removeAllLinks ( )

Remove all links.

◆ removeAllRules()

void Dragengine.Scenery.Animator.removeAllRules ( )

Remove all rules.

◆ removeAllVertexPositionSets()

void Dragengine.Scenery.Animator.removeAllVertexPositionSets ( )

Remove all vertex position sets.

Version
1.17

◆ setAnimation()

void Dragengine.Scenery.Animator.setAnimation ( Animation  animation)

Set animation or null if not set.

◆ setControllerCount()

void Dragengine.Scenery.Animator.setControllerCount ( int  count)

Set number of controllers.

Exceptions
EInvalidParamcount is less than 0.

◆ setLinkBone()

void Dragengine.Scenery.Animator.setLinkBone ( int  link,
String  bone 
)

Set bone to use parameter of as input for link or empty string to not use.

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

◆ setLinkBoneParameter()

void Dragengine.Scenery.Animator.setLinkBoneParameter ( int  link,
AnimatorLinkBoneParameter  parameter 
)

Set bone parameter to use as input for link.

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

◆ setLinkBoneValueRange()

void Dragengine.Scenery.Animator.setLinkBoneValueRange ( int  link,
float  minimum,
float  maximum 
)

Set bone value range.

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

◆ setLinkBoneValueRangeRotation()

void Dragengine.Scenery.Animator.setLinkBoneValueRangeRotation ( int  link,
float  minimum,
float  maximum 
)

Set bone value range for use with rotation parameter.

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

◆ setLinkController()

void Dragengine.Scenery.Animator.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().

◆ setLinkCurve()

void Dragengine.Scenery.Animator.setLinkCurve ( int  link,
CurveBezier  curve 
)

Set link curve.

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

◆ setLinkRepeat()

void Dragengine.Scenery.Animator.setLinkRepeat ( int  link,
int  repeat 
)

Set repeat count along X axis of link.

Exceptions
EInvalidParamrepeat is less than 1.

◆ setLinkVertexPositionSet()

void Dragengine.Scenery.Animator.setLinkVertexPositionSet ( int  link,
String  vertexPositionSet 
)

Set vertex position set to use as input for link or empty string to not use.

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

◆ setLinkVertexPositionSetValueRange()

void Dragengine.Scenery.Animator.setLinkVertexPositionSetValueRange ( int  link,
float  minimum,
float  maximum 
)

Set vertex position set value range.

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

◆ setLinkWrapY()

void Dragengine.Scenery.Animator.setLinkWrapY ( int  link,
bool  wrap 
)

Set to wrap Y value instead of clamping.

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

◆ setRig()

void Dragengine.Scenery.Animator.setRig ( Rig  rig)

Set rig or null if not set.


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