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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 <memory>
  11. #include "math/math.h"
  12. #include "Sprite.h"
  13. class StaticModel {
  14. public:
  15. StaticModel(int _index, vec_t _yaw, vec3_t _pos);
  16. private:
  17. int index;
  18. vec_t yaw;
  19. vec3_t pos;
  20. // ?
  21. //vec3_t bbox[2];
  22. };
  23. class Portal {
  24. public:
  25. Portal(vec3_t _vertices[4], vec3_t _normal, int _adjoiningRoom);
  26. private:
  27. vec3_t vertices[4];
  28. vec3_t normal;
  29. int adjoiningRoom;
  30. };
  31. class Box {
  32. public:
  33. Box(vec3_t _a, vec3_t _b, vec3_t _c, vec3_t _d);
  34. private:
  35. vec3_t a;
  36. vec3_t b;
  37. vec3_t c;
  38. vec3_t d;
  39. };
  40. class Sector {
  41. public:
  42. Sector(vec_t _floor, vec_t _ceiling, bool _wall);
  43. private:
  44. vec_t floor;
  45. vec_t ceiling;
  46. bool wall;
  47. };
  48. typedef enum {
  49. RoomFlagUnderWater = (1 << 0)
  50. } RoomFlags;
  51. class Room {
  52. public:
  53. Room(int _id);
  54. ~Room();
  55. private:
  56. int id;
  57. unsigned int flags;
  58. unsigned int numXSectors;
  59. unsigned int numZSectors;
  60. vec3_t pos;
  61. vec3_t bbox[2];
  62. std::vector<int> adjacentRooms;
  63. std::vector<Sprite *> sprites;
  64. std::vector<StaticModel *> models;
  65. std::vector<Portal *> portals;
  66. std::vector<Box *> boxes;
  67. std::vector<Sector *> sectors;
  68. };
  69. #endif