Model.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // $Id: Model.cpp 94 2006-11-12 19:44:43Z crazy_otaku $
  2. #include <OgreTagPoint.h>
  3. #include "Model.h"
  4. using namespace QGears;
  5. uint32 g_ModelNumber = 0;
  6. Model::Model(void):
  7. m_CurrentFrame(0),
  8. m_PlayedAnimation(0),
  9. m_AnimationWait(0),
  10. m_Scale(1.0f)
  11. {
  12. ++g_ModelNumber;
  13. }
  14. Model::~Model(void)
  15. {
  16. }
  17. void
  18. Model::Update(const uint32 delta_time)
  19. {
  20. /*
  21. if (m_AnimationWait >= 4)
  22. {
  23. if (m_Animation.size() > m_PlayedAnimation)
  24. {
  25. if (m_CurrentFrame < m_Animation[m_PlayedAnimation].frame.size() - 1)
  26. {
  27. ++m_CurrentFrame;
  28. }
  29. else
  30. {
  31. m_CurrentFrame = 0;
  32. }
  33. }
  34. m_AnimationWait = 0;
  35. }
  36. ++m_AnimationWait;*/
  37. }
  38. void
  39. Model::DrawHierarchy(const sint8 level) const
  40. {
  41. }
  42. void
  43. Model::AddBone(const sint16 length, const sint8 parent_id)
  44. {
  45. Bone bone;
  46. bone.length = length;
  47. bone.parent_id = parent_id;
  48. m_Skeleton.push_back(bone);
  49. }
  50. /*
  51. void
  52. Model::AddPart(const TotalGeometry& geometry, const int parent_bone)
  53. {
  54. Part part;
  55. part.geometry = geometry;
  56. part.parent_bone = parent_bone;
  57. m_Parts.push_back(part);
  58. }
  59. */
  60. void
  61. Model::AddAnimation(const Animation& animation)
  62. {
  63. //m_Animation.push_back(animation);
  64. }
  65. void
  66. Model::SetAnimation(uint32 animation_id)
  67. {
  68. m_PlayedAnimation = animation_id;
  69. m_CurrentFrame = 0;
  70. }
  71. int
  72. Model::GetNumberOfBones(void) const
  73. {
  74. return m_Skeleton.size();
  75. }