Animation.pkg 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. $#include "Animation.h"
  2. struct AnimationKeyFrame
  3. {
  4. float time_ @ time;
  5. Vector3 position_ @ position;
  6. Quaternion rotation_ @ rotation;
  7. Vector3 scale_ @ scale;
  8. };
  9. /*
  10. struct AnimationTrack
  11. {
  12. void GetKeyFrameIndex(float time, unsigned& index) const;
  13. String name_ @ name;
  14. StringHash nameHash_ @ nameHash;
  15. unsigned char channelMask_ @ channelMas;
  16. Vector<AnimationKeyFrame> keyFrames_ @ keyFrames;
  17. };
  18. struct AnimationTriggerPoint
  19. {
  20. AnimationTriggerPoint();
  21. float time_ @ time;
  22. Variant data_ @ data;
  23. };
  24. */
  25. static const unsigned char CHANNEL_POSITION;
  26. static const unsigned char CHANNEL_ROTATION;
  27. static const unsigned char CHANNEL_SCALE;
  28. class Animation : public Resource
  29. {
  30. const String GetAnimationName() const;
  31. StringHash GetAnimationNameHash() const;
  32. float GetLength() const;
  33. unsigned GetNumTracks() const;
  34. const AnimationTrack* GetTrack(const String name) const;
  35. const AnimationTrack* GetTrack(StringHash nameHash) const;
  36. const AnimationTrack* GetTrack(unsigned index) const;
  37. unsigned GetNumTriggers() const;
  38. tolua_readonly tolua_property__get_set String animationName;
  39. tolua_readonly tolua_property__get_set StringHash animationNameHash;
  40. tolua_readonly tolua_property__get_set float length;
  41. tolua_readonly tolua_property__get_set unsigned numTracks;
  42. tolua_readonly tolua_property__get_set unsigned numTriggers;
  43. };