SkelAnimCtrl.h 743 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _SKEL_ANIM_CTRL_H_
  2. #define _SKEL_ANIM_CTRL_H_
  3. #include "Common.h"
  4. #include "Controller.h"
  5. #include "Math.h"
  6. class Skeleton;
  7. class SkelAnim;
  8. class SkelNode;
  9. /// Skeleton animation controller
  10. class SkelAnimCtrl: public Controller
  11. {
  12. private:
  13. // The 3 steps of skeletal animation
  14. void interpolate(SkelAnim* animation, float frame);
  15. void updateBoneTransforms();
  16. void deform(); ///< Now with HW skinning it deforms only the debug skeleton
  17. public:
  18. SkelAnim* skelAnim; ///< Skeleton animation resource
  19. SkelNode* skelNode;
  20. Vec<Vec3> heads;
  21. Vec<Vec3> tails;
  22. Vec<Mat3> boneRotations;
  23. Vec<Vec3> boneTranslations;
  24. float step;
  25. float frame;
  26. SkelAnimCtrl(SkelNode* skelNode_);
  27. void update(float time);
  28. };
  29. #endif