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

Entity.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*!
  2. * \file include/Entity.h
  3. * \brief World Entities
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _ENTITY_H_
  8. #define _ENTITY_H_
  9. #include "SkeletalModel.h"
  10. #include "TombRaider.h"
  11. class Entity {
  12. public:
  13. typedef enum {
  14. MoveTypeWalkNoSwim = -1,
  15. MoveTypeWalk = 0,
  16. MoveTypeNoClipping = 1,
  17. MoveTypeFly = 2,
  18. MoveTypeSwim = 3
  19. } MoveType;
  20. Entity(float p[3], float a[3], int id, long r, unsigned int model);
  21. Entity(TombRaider& tr, unsigned int index, unsigned int i, unsigned int model);
  22. bool operator<(Entity& o);
  23. static bool compare(Entity* a, Entity* b);
  24. void display();
  25. void move(char movement);
  26. void print();
  27. SkeletalModel& getModel();
  28. void setSkeletalModel(unsigned int model);
  29. MoveType getMoveType();
  30. void setMoveType(MoveType m);
  31. int getObjectId();
  32. void setAngles(float a[3]);
  33. float getPos(unsigned int i);
  34. float getAngle(unsigned int i);
  35. long getRoom();
  36. // Animation State
  37. unsigned long getAnimation();
  38. void setAnimation(unsigned long index);
  39. unsigned long getBoneFrame();
  40. void setBoneFrame(unsigned long index);
  41. unsigned long getIdleAnimation();
  42. void setIdleAnimation(unsigned long index);
  43. private:
  44. float pos[3];
  45. float angles[3];
  46. long room;
  47. unsigned int skeletalModel;
  48. MoveType moveType;
  49. int state;
  50. int objectId;
  51. // Animation State
  52. unsigned long boneFrame;
  53. unsigned long animationFrame;
  54. unsigned long idleAnimation;
  55. };
  56. #endif