Open Source Tomb Raider Engine
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

SkeletalModel.h 1.6KB

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