Animator¶
Inherited: None
Description¶
The animation controller allows to control different animation states from AnimationStateMachine assets. To use any animations in the Thunder Engine the Animator must be attached to a root Actor in the hierarchy. The animation controller processes an AnimationStateMachine resource type. The animation controller can use parametric values to decide when transition between states must happen.
Public Methods¶
void |
crossFade (const TString & state, float duration) |
void |
crossFadeHash (int hash, float duration) |
void |
setBool (const TString & name, bool value) |
void |
setBoolHash (int hash, bool value) |
void |
setFloat (const TString & name, float value) |
void |
setFloatHash (int hash, float value) |
void |
setInteger (const TString & name, int32_t value) |
void |
setIntegerHash (int hash, int32_t value) |
void |
setState (const TString & state) |
void |
setStateHash (int hash) |
void |
setStateMachine (AnimationStateMachine * machine) |
stateMachine () const |
Static Methods¶
None
Methods Description¶
void Animator::crossFade (TString & state, float duration)
Smoothly changes current state using crossfade interpolation from the previous state to the new state with normalized duration time.
void Animator::crossFadeHash (int hash, float duration)
Smoothly changes current state using crossfade interpolation from the previous state to the new state (using the hash of state) with normalized duration time.
void Animator::setBool (TString & name, bool value)
Sets the new boolean value for the parameter with the name.
void Animator::setBoolHash (int hash, bool value)
Sets the new boolean value for the parameter using the hash of state as the name.
void Animator::setFloat (TString & name, float value)
Sets the new floating-point value for the parameter with the name.
void Animator::setFloatHash (int hash, float value)
Sets the new floating-point value for the parameter using the hash of state as the name.
void Animator::setInteger (TString & name, int32_t value)
Sets the new integer value for the parameter with the name.
void Animator::setIntegerHash (int hash, int32_t value)
Sets the new integer value for the parameter using the hash of state as the name.
void Animator::setState (TString & state)
Changes the current state of state machine immediately.
void Animator::setStateHash (int hash)
Changes the current state (using the hash of state) of state machine immediately.
void Animator::setStateMachine (AnimationStateMachine * machine)
Sets animation state machine which will be attached to this Animator.
Note: The state machine will move to the initial state automatically during the call of this function.
See also stateMachine().
AnimationStateMachine * Animator::stateMachine () const
Returns AnimationStateMachine resource attached to this Animator.
See also setStateMachine().