| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- $#include "AnimationState.h"
- /// %Animation instance.
- class AnimationState
- {
- public:
- /// Construct with animated model and animation pointers.
- AnimationState(AnimatedModel* model, Animation* animation);
- /// Construct with root scene node and animation pointers.
- AnimationState(Node* node, Animation* animation);
- /// Destruct.
- ~AnimationState();
-
- /// Set start bone. Not supported in node animation mode.
- void SetStartBone(Bone* bone);
- /// Set looping enabled/disabled.
- void SetLooped(bool looped);
- /// Set blending weight.
- void SetWeight(float weight);
- /// Set time position. Does not fire animation triggers.
- void SetTime(float time);
- /// Modify blending weight.
- void AddWeight(float delta);
- /// Modify time position. %Animation triggers will be fired.
- void AddTime(float delta);
- /// Set blending layer.
- void SetLayer(unsigned char layer);
-
- /// Return animation.
- Animation* GetAnimation() const { return animation_; }
- /// Return start bone.
- Bone* GetStartBone() const;
- /// Return whether weight is nonzero.
- bool IsEnabled() const { return weight_ > 0.0f; }
- /// Return whether looped.
- bool IsLooped() const { return looped_; }
- /// Return blending weight.
- float GetWeight() const { return weight_; }
- /// Return time position.
- float GetTime() const { return time_; }
- /// Return animation length.
- float GetLength() const;
- /// Return blending layer.
- unsigned char GetLayer() const { return layer_; }
-
- /// Apply the animation at the current time position.
- void Apply();
- };
|