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.

Room.h 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*!
  2. * \file include/Room.h
  3. * \brief World Room Mesh
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _ROOM_H_
  8. #define _ROOM_H_
  9. #include <vector>
  10. #include "math/math.h"
  11. #include "Mesh.h"
  12. #include "Sprite.h"
  13. #include "TombRaider.h"
  14. #include "RoomData.h"
  15. typedef enum {
  16. RoomFlagUnderWater = (1 << 0)
  17. } RoomFlags;
  18. class Room {
  19. public:
  20. Room(TombRaider &tr, unsigned int index);
  21. ~Room();
  22. void setFlags(unsigned int f);
  23. unsigned int getFlags();
  24. unsigned int getNumXSectors();
  25. unsigned int getNumZSectors();
  26. void getPos(vec3_t p);
  27. void getBoundingBox(vec3_t box[2]);
  28. bool inBox(vec_t x, vec_t y, vec_t z);
  29. bool inBoxPlane(vec_t x, vec_t z);
  30. unsigned int sizeAdjacentRooms();
  31. int getAdjacentRoom(unsigned int index);
  32. unsigned int sizePortals();
  33. Portal &getPortal(unsigned int index);
  34. unsigned int sizeSectors();
  35. Sector &getSector(unsigned int index);
  36. unsigned int sizeBox();
  37. Box &getBox(unsigned int index);
  38. unsigned int sizeModels();
  39. StaticModel &getModel(unsigned int index);
  40. void sortModels();
  41. unsigned int sizeLights();
  42. Light &getLight(unsigned int index);
  43. unsigned int sizeSprites();
  44. Sprite &getSprite(unsigned int index);
  45. Mesh &getMesh();
  46. private:
  47. unsigned int flags;
  48. unsigned int numXSectors;
  49. unsigned int numZSectors;
  50. vec3_t pos;
  51. vec3_t bbox[2];
  52. Mesh mesh;
  53. std::vector<int> adjacentRooms;
  54. std::vector<Sprite *> sprites;
  55. std::vector<StaticModel *> models;
  56. std::vector<Portal *> portals;
  57. std::vector<Box *> boxes;
  58. std::vector<Sector *> sectors;
  59. std::vector<Light *> lights;
  60. // Was used for "depth sorting" render list, but never assigned...?!
  61. //vec_t dist; // Distance to near plane, move to room?
  62. };
  63. #endif