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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. int getID() { return id; }
  16. int getRoom() { return room; }
  17. glm::vec3 getPosition() { return pos; }
  18. glm::vec3 getRotation() { return rot; }
  19. int getSprite() { return sprite; }
  20. void setSprite(int i) { sprite = i; }
  21. int getAnimation() { return animation; }
  22. void setAnimation(int i) { animation = i; frame = 0; }
  23. int getFrame() { return frame; }
  24. void setFrame(int i) { frame = i; }
  25. static void setShowEntitySprites(bool s) { showEntitySprites = s; }
  26. static bool getShowEntitySprites() { return showEntitySprites; }
  27. static void setShowEntityMeshes(bool s) { showEntityMeshes = s; }
  28. static bool getShowEntityMeshes() { return showEntityMeshes; }
  29. static void setShowEntityModels(bool s) { showEntityModels = s; }
  30. static bool getShowEntityModels() { return showEntityModels; }
  31. private:
  32. int id;
  33. int room;
  34. glm::vec3 pos;
  35. glm::vec3 rot;
  36. int cache, cacheType;
  37. int sprite;
  38. int animation;
  39. int frame;
  40. static bool showEntitySprites;
  41. static bool showEntityMeshes;
  42. static bool showEntityModels;
  43. };
  44. #endif