Model.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef MODEL_H
  2. #define MODEL_H
  3. #include <Ogre.h>
  4. #include "common/TypeDefine.h"
  5. struct BonePosition
  6. {
  7. float rotation_x;
  8. float rotation_y;
  9. float rotation_z;
  10. float translation_x;
  11. float translation_y;
  12. float translation_z;
  13. };
  14. struct Frame
  15. {
  16. std::vector<BonePosition> bone;
  17. };
  18. struct Animation
  19. {
  20. std::vector<Frame> frame;
  21. };
  22. struct Model
  23. {
  24. Model(void);
  25. ~Model(void);
  26. void Update(const QGears::uint32 delta_time);
  27. void DrawHierarchy(const QGears::sint8 level) const;
  28. void AddBone(const QGears::sint16 length, const QGears::sint8 parent_id);
  29. //void AddPart(const TotalGeometry& geometry, const int parent_bone);
  30. void AddAnimation(const Animation& animation);
  31. void SetAnimation(QGears::uint32 animation_id);
  32. int GetNumberOfBones(void) const;
  33. QGears::uint32 m_CurrentFrame;
  34. QGears::uint32 m_PlayedAnimation;
  35. QGears::uint32 m_AnimationWait;
  36. float m_Scale;
  37. struct Bone
  38. {
  39. QGears::sint16 length;
  40. QGears::sint8 parent_id;
  41. };
  42. std::vector<Bone> m_Skeleton;
  43. };
  44. #endif // MODEL_H