AnimationController.pkg 2.0 KB

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