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.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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(TombRaider &tr, unsigned int index, unsigned int j, unsigned int *l, unsigned int frame_offset);
  16. void display();
  17. void getOffset(vec3_t o);
  18. void getRotation(vec3_t r);
  19. char getFlag();
  20. private:
  21. int mesh;
  22. vec3_t off;
  23. vec3_t rot;
  24. char flag;
  25. };
  26. class BoneFrame {
  27. public:
  28. BoneFrame(TombRaider &tr, unsigned int index, unsigned int frame_offset);
  29. ~BoneFrame();
  30. void getPosition(vec3_t p);
  31. unsigned int size();
  32. BoneTag &get(unsigned int i);
  33. private:
  34. vec3_t pos;
  35. std::vector<BoneTag *> tag;
  36. };
  37. class AnimationFrame {
  38. public:
  39. AnimationFrame(TombRaider &tr, unsigned int index, int a);
  40. ~AnimationFrame();
  41. unsigned int size();
  42. BoneFrame &get(unsigned int i);
  43. private:
  44. char rate;
  45. std::vector<BoneFrame *> frame;
  46. };
  47. class SkeletalModel {
  48. public:
  49. SkeletalModel(TombRaider &tr, unsigned int index, int objectId);
  50. ~SkeletalModel();
  51. void display(unsigned int aframe, unsigned int bframe);
  52. int getId();
  53. void setPigTail(bool b);
  54. void setPonyPos(vec_t x, vec_t y, vec_t z, vec_t angle);
  55. unsigned int size();
  56. AnimationFrame &get(unsigned int i);
  57. private:
  58. int id;
  59. bool tr4Overlay;
  60. bool pigtails;
  61. int ponytailId;
  62. vec3_t ponytail;
  63. int ponytailMeshId;
  64. unsigned int ponytailNumMeshes;
  65. vec_t ponytailAngle;
  66. vec_t ponyOff;
  67. vec_t ponyOff2;
  68. std::vector<AnimationFrame *> animation;
  69. };
  70. #endif