Open Source Tomb Raider Engine
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

RoomData.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. private:
  18. void find();
  19. int id;
  20. int cache;
  21. glm::mat4 model;
  22. };
  23. // --------------------------------------
  24. class RoomSprite {
  25. public:
  26. RoomSprite(glm::vec3 p, int s) : pos(p), sprite(s) { }
  27. void display(glm::mat4 VP);
  28. private:
  29. glm::vec3 pos;
  30. int sprite;
  31. };
  32. // --------------------------------------
  33. class Portal {
  34. public:
  35. Portal(int adj, glm::vec3 n,
  36. glm::vec3 v1, glm::vec3 v2, glm::vec3 v3, glm::vec3 v4);
  37. int getAdjoiningRoom() { return adjoiningRoom; }
  38. glm::vec3 getNormal() { return normal; }
  39. BoundingBox getBoundingBox() { return bbox; }
  40. void display(glm::mat4 VP);
  41. void displayUI();
  42. glm::vec3 getVertex(int i) {
  43. orAssertGreaterThanEqual(i, 0);
  44. orAssertLessThan(i, 4);
  45. return vert[i];
  46. }
  47. static void setShowBoundingBox(bool s) { showBoundingBox = s; }
  48. static bool getShowBoundingBox() { return showBoundingBox; }
  49. private:
  50. int adjoiningRoom;
  51. glm::vec3 normal;
  52. glm::vec3 vert[4];
  53. BoundingBox bbox, bboxNormal;
  54. static bool showBoundingBox;
  55. };
  56. // --------------------------------------
  57. class Sector {
  58. public:
  59. Sector(float f, float c, bool w) : floor(f), ceiling(c), wall(w) { }
  60. float getFloor();
  61. float getCeiling();
  62. bool isWall();
  63. private:
  64. float floor;
  65. float ceiling;
  66. bool wall;
  67. };
  68. #endif