Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

SkeletalModel.h 1.8KB

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 "TombRaider.h"
  12. class BoneTag {
  13. public:
  14. BoneTag(TombRaider& tr, unsigned int index, unsigned int j, unsigned int* l,
  15. unsigned int frame_offset);
  16. void display();
  17. void getOffset(float o[3]);
  18. void getRotation(float r[3]);
  19. char getFlag();
  20. private:
  21. int mesh;
  22. float off[3];
  23. float rot[3];
  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(float p[3]);
  31. unsigned long size();
  32. BoneTag& get(unsigned long i);
  33. private:
  34. float pos[3];
  35. std::vector<BoneTag*> tag;
  36. };
  37. class AnimationFrame {
  38. public:
  39. AnimationFrame(TombRaider& tr, unsigned int index, int a, unsigned int* frame_offset,
  40. int frame_step);
  41. ~AnimationFrame();
  42. unsigned long size();
  43. BoneFrame& get(unsigned long i);
  44. private:
  45. char rate;
  46. std::vector<BoneFrame*> frame;
  47. };
  48. class SkeletalModel {
  49. public:
  50. SkeletalModel(TombRaider& tr, unsigned int index, int objectId);
  51. ~SkeletalModel();
  52. void display(unsigned long aframe, unsigned long bframe);
  53. int getId();
  54. void setPigTail(bool b);
  55. void setPonyPos(float x, float y, float z, float angle);
  56. unsigned long size();
  57. AnimationFrame& get(unsigned long i);
  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