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

Animator resources. More...

Inheritance diagram for Dragengine.Scenery.Animator:

Public Member Functions

Constructors
Animator new ()
 Create animator.
Controllers
int getControllerCount ()
 Nnumber of controllers.
void setControllerCount (int count)
 Set number of controllers.
AnimatorController getControllerAt (int index)
 Get wrapper for controller.
AnimatorController getControllerNamed (String name)
 Get wrapper for controller if present.
int indexOfControllerNamed (String name)
 Index of named controller or -1 if not found.
Links
int getLinkCount ()
 Number of links.
int addLink (int controller)
 Add link with controller and no mapping points.
void removeAllLinks ()
 Remove all links.
void setLinkController (int link, int controller)
 Set controller of link.
void setLinkRepeat (int link, int repeat)
 Set repeat count along X axis of link.
void setLinkCurve (int link, CurveBezier curve)
 Set link curve.
void setLinkBone (int link, String bone)
 Set bone to use parameter of as input for link or empty string to not use.
void setLinkBoneParameter (int link, AnimatorLinkBoneParameter parameter)
 Set bone parameter to use as input for link.
void setLinkBoneValueRange (int link, float minimum, float maximum)
 Set bone value range.
void setLinkBoneValueRangeRotation (int link, float minimum, float maximum)
 Set bone value range for use with rotation parameter.
void setLinkVertexPositionSet (int link, String vertexPositionSet)
 Set vertex position set to use as input for link or empty string to not use.
void setLinkVertexPositionSetValueRange (int link, float minimum, float maximum)
 Set vertex position set value range.
void setLinkWrapY (int link, bool wrap)
 Set to wrap Y value instead of clamping.
Rules
int getRuleCount ()
 Number of rules.
void addRule (AnimatorRule rule)
 Add rule.
AnimatorRule getRuleAt (int index)
 Rule at index.
void removeAllRules ()
 Remove all rules.
Bones
void addBone (String bone)
 Add bone.
void removeAllBones ()
 Remove all bones.
VertexPositionSets
void addVertexPositionSet (String vertexPositionSet)
 Add vertex position set.
void removeAllVertexPositionSets ()
 Remove all vertex position sets.

Management

Rig getRig ()
 Rig or null if not set.
void setRig (Rig rig)
 Set rig or null if not set.
Animation getAnimation ()
 Animation or null if not set.
void setAnimation (Animation animation)
 Set animation or null if not set.
static bool equals (Animator animator1, Animator animator2)
 Two animators are equal.

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.

Referenced by removeAllVertexPositionSets().

◆ 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.

References indexOfControllerNamed().

Referenced by setLinkRepeat().

◆ addRule()

void Dragengine.Scenery.Animator.addRule ( AnimatorRule rule)

Add rule.

References setLinkVertexPositionSet().

Referenced by addVertexPositionSet().

◆ addVertexPositionSet()

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

Add vertex position set.

Version
1.17

References addRule().

Referenced by removeAllVertexPositionSets().

◆ equals()

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.

References equals().

Referenced by equals().

◆ getAnimation()

Animation Dragengine.Scenery.Animator.getAnimation ( )

Animation or null if not set.

References setRig().

Referenced by setAnimation().

◆ 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().

Referenced by getControllerNamed().

◆ getControllerCount()

int Dragengine.Scenery.Animator.getControllerCount ( )

Nnumber of controllers.

Referenced by setControllerCount().

◆ 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.

References getControllerAt().

Referenced by getLinkCount().

◆ getLinkCount()

int Dragengine.Scenery.Animator.getLinkCount ( )

Number of links.

References getControllerNamed().

Referenced by setLinkController().

◆ getRig()

Rig Dragengine.Scenery.Animator.getRig ( )

Rig or null if not set.

References getRig().

Referenced by getRig().

◆ getRuleAt()

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

Rule at index.

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

Referenced by removeAllVertexPositionSets().

◆ getRuleCount()

int Dragengine.Scenery.Animator.getRuleCount ( )

Number of rules.

References setLinkBoneValueRangeRotation().

Referenced by removeAllBones().

◆ indexOfControllerNamed()

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

Index of named controller or -1 if not found.

Referenced by addLink().

◆ new()

Animator Dragengine.Scenery.Animator.new ( )

Create animator.

References new().

Referenced by new().

◆ removeAllBones()

void Dragengine.Scenery.Animator.removeAllBones ( )

Remove all bones.

References getRuleCount(), and setLinkWrapY().

Referenced by removeAllVertexPositionSets().

◆ removeAllLinks()

void Dragengine.Scenery.Animator.removeAllLinks ( )

Remove all links.

Referenced by setLinkCurve().

◆ removeAllRules()

void Dragengine.Scenery.Animator.removeAllRules ( )

Remove all rules.

References setLinkVertexPositionSetValueRange().

Referenced by removeAllVertexPositionSets().

◆ removeAllVertexPositionSets()

void Dragengine.Scenery.Animator.removeAllVertexPositionSets ( )

Remove all vertex position sets.

Version
1.17

References addBone(), addVertexPositionSet(), getRuleAt(), removeAllBones(), removeAllRules(), and removeAllVertexPositionSets().

Referenced by removeAllVertexPositionSets().

◆ setAnimation()

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

Set animation or null if not set.

References getAnimation(), and setAnimation().

Referenced by setAnimation().

◆ setControllerCount()

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

Set number of controllers.

Exceptions
EInvalidParamcount is less than 0.

References getControllerCount(), and setControllerCount().

Referenced by setControllerCount().

◆ 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().

References setLinkController().

Referenced by setLinkBoneValueRangeRotation().

◆ 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().

References setLinkRepeat().

Referenced by setLinkVertexPositionSet().

◆ 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().

References setLinkCurve().

Referenced by setLinkWrapY().

◆ 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().

References setLinkBone().

Referenced by getRuleCount().

◆ 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().

References getLinkCount().

Referenced by setLinkBone().

◆ 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().

References removeAllLinks().

Referenced by setLinkBoneValueRange().

◆ setLinkRepeat()

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

Set repeat count along X axis of link.

Exceptions
EInvalidParamrepeat is less than 1.

References addLink().

Referenced by setLinkBoneParameter().

◆ 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().

References setLinkBoneParameter().

Referenced by addRule().

◆ 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().

Referenced by removeAllRules().

◆ 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().

References setLinkBoneValueRange().

Referenced by removeAllBones().

◆ setRig()

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

Set rig or null if not set.

Referenced by getAnimation().


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