.. _api_Animator: Animator ======== Inherited: :ref:`NativeBehaviour` .. _api_Animator_description: 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. .. _api_Animator_public: Public Methods -------------- +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`crossFade` (const TString & state, float duration) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`crossFadeHash` (int hash, float duration) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setBool` (const TString & name, bool value) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setBoolHash` (int hash, bool value) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setFloat` (const TString & name, float value) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setFloatHash` (int hash, float value) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setInteger` (const TString & name, int32_t value) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setIntegerHash` (int hash, int32_t value) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setState` (const TString & state) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setStateHash` (int hash) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | void | :ref:`setStateMachine` (AnimationStateMachine * machine) | +------------------------------------------------------------+----------------------------------------------------------------------------------+ | :ref:`AnimationStateMachine` * | :ref:`stateMachine` () const | +------------------------------------------------------------+----------------------------------------------------------------------------------+ .. _api_Animator_static: Static Methods -------------- None .. _api_Animator_methods: Methods Description ------------------- .. _api_Animator_6f8e231b: void **Animator::crossFade** (:ref:`TString` & *state*, float *duration*) Smoothly changes current *state* using crossfade interpolation from the previous *state* to the new *state* with normalized *duration* time. ---- .. _api_Animator_48e712cf: 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. ---- .. _api_Animator_2f6734b1: void **Animator::setBool** (:ref:`TString` & *name*, bool *value*) Sets the new boolean *value* for the parameter with the name. ---- .. _api_Animator_915ecab0: void **Animator::setBoolHash** (int *hash*, bool *value*) Sets the new boolean *value* for the parameter using the *hash* of state as the name. ---- .. _api_Animator_c9634e5a: void **Animator::setFloat** (:ref:`TString` & *name*, float *value*) Sets the new floating-point *value* for the parameter with the name. ---- .. _api_Animator_5689afc4: void **Animator::setFloatHash** (int *hash*, float *value*) Sets the new floating-point *value* for the parameter using the *hash* of state as the name. ---- .. _api_Animator_9458fa21: void **Animator::setInteger** (:ref:`TString` & *name*, int32_t *value*) Sets the new integer *value* for the parameter with the name. ---- .. _api_Animator_804e92d1: void **Animator::setIntegerHash** (int *hash*, int32_t *value*) Sets the new integer *value* for the parameter using the *hash* of state as the name. ---- .. _api_Animator_0bd18375: void **Animator::setState** (:ref:`TString` & *state*) Changes the current *state* of *state* machine immediately. ---- .. _api_Animator_b850f16a: void **Animator::setStateHash** (int *hash*) Changes the current state (using the *hash* of state) of state machine immediately. ---- .. _api_Animator_74c10936: void **Animator::setStateMachine** (:ref:`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(). ---- .. _api_Animator_7be10863: :ref:`AnimationStateMachine` * **Animator::stateMachine** () const Returns AnimationStateMachine resource attached to this Animator. **See also** setStateMachine().