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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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, int j, unsigned int *l);
  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 i, unsigned int frame_offset);
  29. ~BoneFrame();
  30. unsigned int size();
  31. BoneTag &get(unsigned int i);
  32. void add(BoneTag &b);
  33. private:
  34. vec3_t pos;
  35. vec_t yaw;
  36. std::vector<BoneTag *> tag;
  37. };
  38. class AnimationFrame {
  39. public:
  40. AnimationFrame(TombRaider &tr, unsigned int index, unsigned int i, int a);
  41. ~AnimationFrame();
  42. unsigned int size();
  43. BoneFrame &get(unsigned int i);
  44. void add(BoneFrame &b);
  45. private:
  46. char rate;
  47. std::vector<BoneFrame *> frame;
  48. };
  49. class SkeletalModel {
  50. public:
  51. SkeletalModel(TombRaider &tr, unsigned int index, unsigned int i, int objectId);
  52. ~SkeletalModel();
  53. void display(unsigned int aframe, unsigned int bframe);
  54. int getId();
  55. void setPigTail(bool b);
  56. void setPonyPos(vec_t x, vec_t y, vec_t z, vec_t angle);
  57. unsigned int size();
  58. AnimationFrame &get(unsigned int i);
  59. private:
  60. int id;
  61. bool tr4Overlay;
  62. bool pigtails;
  63. int ponytailId;
  64. vec3_t ponytail;
  65. int ponytailMeshId;
  66. unsigned int ponytailNumMeshes;
  67. vec_t ponytailAngle;
  68. vec_t ponyOff;
  69. vec_t ponyOff2;
  70. std::vector<AnimationFrame *> animation;
  71. };
  72. #endif