| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- $#include "AnimationController.h"
- /// %Component that drives an AnimatedModel's animations.
- class AnimationController : public Component
- {
- public:
- /// Play an animation and set full target weight. Name must be the full resource name. Return true on success.
- bool Play(const char* name, unsigned char layer, bool looped);
- bool Play(const char* name, unsigned char layer, bool looped, float fadeInTime = 0.0f);
- /// Play an animation, set full target weight and fade out all other animations on the same layer. Name must be the full resource name. Return true on success.
- bool PlayExclusive(const char* name, unsigned char layer, bool looped);
- bool PlayExclusive(const char* name, unsigned char layer, bool looped, float fadeTime = 0.0f);
- /// Stop an animation. Zero fadetime is instant. Return true on success.
- bool Stop(const char* name);
- bool Stop(const char* name, float fadeOutTime = 0.0f);
- /// Stop all animations on a specific layer. Zero fadetime is instant.
- void StopLayer(unsigned char layer);
- void StopLayer(unsigned char layer, float fadeOutTime = 0.0f);
- /// Stop all animations. Zero fadetime is instant.
- void StopAll();
- void StopAll(float fadeTime = 0.0f);
- /// Fade animation to target weight. Return true on success.
- bool Fade(const char* name, float targetWeight, float fadeTime);
- /// Fade other animations on the same layer to target weight. Return true on success.
- bool FadeOthers(const char* name, float targetWeight, float fadeTime);
-
- /// Set animation blending layer priority. Return true on success.
- bool SetLayer(const char* name, unsigned char layer);
- /// Set animation start bone. Return true on success.
- bool SetStartBone(const char* name, const char* startBoneName);
- /// Set animation time position. Return true on success.
- bool SetTime(const char* name, float time);
- /// Set animation weight. Return true on success.
- bool SetWeight(const char* name, float weight);
- /// Set animation looping. Return true on success.
- bool SetLooped(const char* name, bool enable);
- /// Set animation speed. Return true on success.
- bool SetSpeed(const char* name, float speed);
- /// Set animation autofade on stop (non-looped animations only.) Zero time disables. Return true on success.
- bool SetAutoFade(const char* name, float fadeOutTime);
-
- /// Return whether an animation is active.
- bool IsPlaying(const char* name) const;
- /// Return whether an animation is fading in.
- bool IsFadingIn(const char* name) const;
- /// Return whether an animation is fading out.
- bool IsFadingOut(const char* name) const;
- /// Return animation blending layer.
- unsigned char GetLayer(const char* name) const;
- /// Return animation start bone, or null if no such animation.
- Bone* GetStartBone(const char* name) const;
- /// Return animation start bone name, or empty string if no such animation.
- const String& GetStartBoneName(const char* name) const;
- /// Return animation time position.
- float GetTime(const char* name) const;
- /// Return animation weight.
- float GetWeight(const char* name) const;
- /// Return animation looping.
- bool IsLooped(const char* name) const;
- /// Return animation length.
- float GetLength(const char* name) const;
- /// Return animation speed.
- float GetSpeed(const char* name) const;
- /// Return animation fade target weight.
- float GetFadeTarget(const char* name) const;
- /// Return animation fade time.
- float GetFadeTime(const char* name) const;
- /// Return animation autofade time.
- float GetAutoFade(const char* name) const;
- };
|