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.

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