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.

Entity.h 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 "math/math.h"
  10. #include "SkeletalModel.h"
  11. #include "TombRaider.h"
  12. class Entity {
  13. public:
  14. typedef enum {
  15. MoveTypeWalkNoSwim = -1,
  16. MoveTypeWalk = 0,
  17. MoveTypeNoClipping = 1,
  18. MoveTypeFly = 2,
  19. MoveTypeSwim = 3
  20. } MoveType;
  21. Entity(TombRaider &tr, unsigned int index, unsigned int i, unsigned int model);
  22. bool operator<(Entity &o);
  23. void display();
  24. void move(char movement);
  25. void print();
  26. SkeletalModel &getModel();
  27. void setSkeletalModel(unsigned int model);
  28. MoveType getMoveType();
  29. void setMoveType(MoveType m);
  30. int getObjectId();
  31. void setAngle(vec_t yaw);
  32. vec_t getPos(unsigned int i);
  33. vec_t getAngle(unsigned int i);
  34. int getRoom();
  35. // Animation State
  36. unsigned int getAnimation();
  37. void setAnimation(unsigned int index);
  38. unsigned int getBoneFrame();
  39. void setBoneFrame(unsigned int index);
  40. unsigned int getIdleAnimation();
  41. void setIdleAnimation(unsigned int index);
  42. private:
  43. vec3_t pos;
  44. vec3_t angles;
  45. int room;
  46. unsigned int skeletalModel;
  47. MoveType moveType;
  48. int state;
  49. int objectId;
  50. // Animation State
  51. unsigned int boneFrame;
  52. unsigned int animationFrame;
  53. unsigned int idleAnimation;
  54. };
  55. #endif