Open Source Tomb Raider Engine
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

RoomData.h 1.6KB

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