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.

RoomData.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*!
  2. * \file include/RoomData.h
  3. * \brief Auxiliary Room classes
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _ROOM_DATA_H_
  8. #define _ROOM_DATA_H_
  9. #include "BoundingBox.h"
  10. class StaticModel {
  11. public:
  12. StaticModel(glm::vec3 pos, float angle, int i);
  13. void display(glm::mat4 VP);
  14. void displayUI();
  15. glm::vec3 getCenter();
  16. float getRadius();
  17. void displayBoundingSphere(glm::mat4 VP, glm::vec3 color);
  18. private:
  19. void find();
  20. int id;
  21. int cache;
  22. glm::mat4 model;
  23. };
  24. // --------------------------------------
  25. class RoomSprite {
  26. public:
  27. RoomSprite(glm::vec3 p, int s) : pos(p), sprite(s) { }
  28. void display(glm::mat4 VP);
  29. void displayUI();
  30. glm::vec3 getCenter();
  31. float getRadius();
  32. void displayBoundingSphere(glm::mat4 VP, glm::vec3 color);
  33. private:
  34. glm::vec3 pos;
  35. int sprite;
  36. };
  37. // --------------------------------------
  38. class Portal {
  39. public:
  40. Portal(int adj, glm::vec3 n,
  41. glm::vec3 v1, glm::vec3 v2, glm::vec3 v3, glm::vec3 v4);
  42. int getAdjoiningRoom() { return adjoiningRoom; }
  43. glm::vec3 getNormal() { return normal; }
  44. BoundingBox getBoundingBox() { return bbox; }
  45. void display(glm::mat4 VP);
  46. void displayUI();
  47. glm::vec3 getVertex(int i) {
  48. orAssertGreaterThanEqual(i, 0);
  49. orAssertLessThan(i, 4);
  50. return vert[i];
  51. }
  52. static void setShowBoundingBox(bool s) { showBoundingBox = s; }
  53. static bool getShowBoundingBox() { return showBoundingBox; }
  54. private:
  55. int adjoiningRoom;
  56. glm::vec3 normal;
  57. glm::vec3 vert[4];
  58. BoundingBox bbox, bboxNormal;
  59. static bool showBoundingBox;
  60. };
  61. // --------------------------------------
  62. class Sector {
  63. public:
  64. Sector(float f, float c, bool w) : floor(f), ceiling(c), wall(w) { }
  65. float getFloor();
  66. float getCeiling();
  67. bool isWall();
  68. private:
  69. float floor;
  70. float ceiling;
  71. bool wall;
  72. };
  73. #endif