AnimationState.pkg 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. $#include "Graphics/AnimationState.h"
  2. enum AnimationBlendMode
  3. {
  4. ABM_LERP = 0,
  5. ABM_ADDITIVE
  6. };
  7. class AnimationState
  8. {
  9. AnimationState(AnimatedModel* model, Animation* animation);
  10. AnimationState(Node* node, Animation* animation);
  11. ~AnimationState();
  12. void SetStartBone(Bone* bone);
  13. void SetLooped(bool looped);
  14. void SetWeight(float weight);
  15. void SetTime(float time);
  16. void SetBoneWeight(const String name, float weight, bool recursive = false);
  17. void SetBoneWeight(StringHash nameHash, float weight, bool recursive = false);
  18. void SetBoneWeight(unsigned index, float weight, bool recursive = false);
  19. void AddWeight(float delta);
  20. void AddTime(float delta);
  21. void SetLayer(unsigned char layer);
  22. void SetBlendMode(AnimationBlendMode mode);
  23. void Apply();
  24. Animation* GetAnimation() const;
  25. Bone* GetStartBone() const;
  26. float GetBoneWeight(const String name) const;
  27. float GetBoneWeight(StringHash nameHash) const;
  28. float GetBoneWeight(unsigned index) const;
  29. unsigned GetTrackIndex(const String name) const;
  30. unsigned GetTrackIndex(StringHash nameHash) const;
  31. bool IsEnabled() const;
  32. bool IsLooped() const;
  33. float GetWeight() const;
  34. float GetTime() const;
  35. float GetLength() const;
  36. unsigned char GetLayer() const;
  37. AnimationBlendMode GetBlendMode() const;
  38. tolua_readonly tolua_property__get_set Animation* animation;
  39. tolua_property__get_set Bone* startBone;
  40. tolua_readonly tolua_property__is_set bool enabled;
  41. tolua_property__is_set bool looped;
  42. tolua_property__get_set float weight;
  43. tolua_property__get_set float time;
  44. tolua_readonly tolua_property__get_set float length;
  45. tolua_property__get_set unsigned char layer;
  46. tolua_property__get_set AnimationBlendMode blendMode;
  47. };