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.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*!
  2. * \file include/Entity.h
  3. * \brief Things in the World
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _ENTITY_H_
  8. #define _ENTITY_H_
  9. class Entity {
  10. public:
  11. Entity(int i, int r, glm::vec3 po, glm::vec3 ro)
  12. : id(i), room(r), pos(po), rot(ro), cache(-1), cacheType(-1),
  13. sprite(0), animation(0), frame(0) { }
  14. void display(glm::mat4 VP);
  15. void displayUI();
  16. int getID() { return id; }
  17. int getRoom() { return room; }
  18. glm::vec3 getPosition() { return pos; }
  19. glm::vec3 getRotation() { return rot; }
  20. int getSprite() { return sprite; }
  21. void setSprite(int i) { sprite = i; }
  22. int getAnimation() { return animation; }
  23. void setAnimation(int i) { animation = i; frame = 0; }
  24. int getFrame() { return frame; }
  25. void setFrame(int i) { frame = i; }
  26. static void setShowEntitySprites(bool s) { showEntitySprites = s; }
  27. static bool getShowEntitySprites() { return showEntitySprites; }
  28. static void setShowEntityMeshes(bool s) { showEntityMeshes = s; }
  29. static bool getShowEntityMeshes() { return showEntityMeshes; }
  30. static void setShowEntityModels(bool s) { showEntityModels = s; }
  31. static bool getShowEntityModels() { return showEntityModels; }
  32. private:
  33. void find();
  34. int id;
  35. int room;
  36. glm::vec3 pos;
  37. glm::vec3 rot;
  38. int cache, cacheType;
  39. int sprite;
  40. int animation;
  41. int frame;
  42. static bool showEntitySprites;
  43. static bool showEntityMeshes;
  44. static bool showEntityModels;
  45. };
  46. #endif