AnimationController.pkg 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. $#include "AnimationController.h"
  2. struct AnimationControl
  3. {
  4. AnimationControl();
  5. ~AnimationControl();
  6. StringHash hash_;
  7. float speed_;
  8. float targetWeight_;
  9. float fadeTime_;
  10. float autoFadeTime_;
  11. float setTimeTtl_;
  12. float setWeightTtl_;
  13. unsigned short setTime_;
  14. unsigned char setWeight_;
  15. unsigned char setTimeRev_;
  16. unsigned char setWeightRev_;
  17. };
  18. class AnimationController : public Component
  19. {
  20. bool Play(const String name, unsigned char layer, bool looped, float fadeInTime = 0.0f);
  21. bool PlayExclusive(const String name, unsigned char layer, bool looped, float fadeTime = 0.0f);
  22. bool Stop(const String name, float fadeOutTime = 0.0f);
  23. void StopLayer(unsigned char layer, float fadeOutTime = 0.0f);
  24. void StopAll(float fadeTime = 0.0f);
  25. bool Fade(const String name, float targetWeight, float fadeTime);
  26. bool FadeOthers(const String name, float targetWeight, float fadeTime);
  27. bool SetLayer(const String name, unsigned char layer);
  28. bool SetStartBone(const String name, const String startBoneName);
  29. bool SetTime(const String name, float time);
  30. bool SetWeight(const String name, float weight);
  31. bool SetLooped(const String name, bool enable);
  32. bool SetSpeed(const String name, float speed);
  33. bool SetAutoFade(const String name, float fadeOutTime);
  34. bool IsPlaying(const String name) const;
  35. bool IsFadingIn(const String name) const;
  36. bool IsFadingOut(const String name) const;
  37. unsigned char GetLayer(const String name) const;
  38. Bone* GetStartBone(const String name) const;
  39. const String GetStartBoneName(const String name) const;
  40. float GetTime(const String name) const;
  41. float GetWeight(const String name) const;
  42. bool IsLooped(const String name) const;
  43. float GetLength(const String name) const;
  44. float GetSpeed(const String name) const;
  45. float GetFadeTarget(const String name) const;
  46. float GetFadeTime(const String name) const;
  47. float GetAutoFade(const String name) const;
  48. AnimationState* GetAnimationState(const String name) const;
  49. AnimationState* GetAnimationState(StringHash nameHash) const;
  50. };