Open Source Tomb Raider Engine
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Room.h 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. BoundingBox &getBoundingBox();
  23. Mesh &getMesh();
  24. void display(bool alpha);
  25. unsigned int getNumXSectors();
  26. unsigned int getNumZSectors();
  27. void getPos(vec3_t p);
  28. void setFlags(unsigned int f);
  29. unsigned int getFlags();
  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. unsigned int sizeLights();
  41. Light &getLight(unsigned int index);
  42. unsigned int sizeSprites();
  43. Sprite &getSprite(unsigned int index);
  44. private:
  45. void sortModels();
  46. unsigned int flags;
  47. unsigned int numXSectors;
  48. unsigned int numZSectors;
  49. vec3_t pos;
  50. BoundingBox bbox;
  51. Mesh mesh;
  52. std::vector<int> adjacentRooms;
  53. std::vector<Sprite *> sprites;
  54. std::vector<StaticModel *> models;
  55. std::vector<Portal *> portals;
  56. std::vector<Box *> boxes;
  57. std::vector<Sector *> sectors;
  58. std::vector<Light *> lights;
  59. // Was used for "depth sorting" render list, but never assigned...?!
  60. //vec_t dist; // Distance to near plane, move to room?
  61. };
  62. #endif