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 "math/math.h"
  12. #include "TombRaider.h"
  13. class BoneTag {
  14. public:
  15. BoneTag(TombRaider &tr, unsigned int index, int j, unsigned int *l, unsigned short **frame, 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 i, unsigned short **frame, 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. 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. private:
  45. char rate;
  46. std::vector<BoneFrame *> frame;
  47. };
  48. class SkeletalModel {
  49. public:
  50. SkeletalModel(TombRaider &tr, unsigned int index, unsigned int i, int objectId);
  51. ~SkeletalModel();
  52. void display(unsigned int aframe, unsigned int bframe);
  53. int getId();
  54. void setPigTail(bool b);
  55. void setPonyPos(vec_t x, vec_t y, vec_t z, vec_t angle);
  56. unsigned int size();
  57. AnimationFrame &get(unsigned int i);
  58. private:
  59. int id;
  60. bool tr4Overlay;
  61. bool pigtails;
  62. int ponytailId;
  63. vec3_t ponytail;
  64. int ponytailMeshId;
  65. unsigned int ponytailNumMeshes;
  66. vec_t ponytailAngle;
  67. vec_t ponyOff;
  68. vec_t ponyOff2;
  69. std::vector<AnimationFrame *> animation;
  70. };
  71. #endif