Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SkeletalModel.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*!
  2. * \file include/SkeletalModel.h
  3. * \brief This is the factored out skeletal model class
  4. *
  5. * \author Mongoose
  6. * \author xythobuz
  7. */
  8. #ifndef _SKELETALMODEL_H_
  9. #define _SKELETALMODEL_H_
  10. #include <vector>
  11. #include "math/math.h"
  12. #include "TombRaider.h"
  13. class BoneTag {
  14. public:
  15. BoneTag();
  16. private:
  17. int mesh;
  18. vec3_t off;
  19. vec3_t rot;
  20. char flag;
  21. };
  22. class BoneFrame {
  23. public:
  24. BoneFrame();
  25. ~BoneFrame();
  26. unsigned int size();
  27. BoneTag &get(unsigned int i);
  28. void add(BoneTag &b);
  29. private:
  30. vec3_t pos;
  31. vec_t yaw;
  32. std::vector<BoneTag *> tag;
  33. };
  34. class AnimationFrame {
  35. public:
  36. AnimationFrame();
  37. ~AnimationFrame();
  38. unsigned int size();
  39. BoneFrame &get(unsigned int i);
  40. void add(BoneFrame &b);
  41. private:
  42. char rate;
  43. std::vector<BoneFrame *> frame;
  44. };
  45. class SkeletalModel {
  46. public:
  47. SkeletalModel(TombRaider &tr, unsigned int index);
  48. ~SkeletalModel();
  49. int getId();
  50. unsigned int size();
  51. AnimationFrame &get(unsigned int i);
  52. private:
  53. int id;
  54. bool tr4Overlay;
  55. bool pigtails;
  56. int ponytailId;
  57. vec3_t ponytail;
  58. int ponytailMeshId;
  59. unsigned int ponytailNumMeshes;
  60. vec_t ponytailAngle;
  61. vec_t ponyOff;
  62. vec_t ponyOff2;
  63. std::vector<AnimationFrame *> animation;
  64. };
  65. #endif