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.

RoomData.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*!
  2. * \file include/RoomData.h
  3. * \brief World Room Mesh
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _ROOM_DATA_H_
  8. #define _ROOM_DATA_H_
  9. #include <vector>
  10. #include <memory>
  11. #include "math/math.h"
  12. #include "math/Matrix.h"
  13. #include "Mesh.h"
  14. #include "Sprite.h"
  15. #include "TombRaider.h"
  16. class Light {
  17. public:
  18. /*!
  19. * \brief Type a light can be of
  20. */
  21. typedef enum {
  22. typePoint = 1, //!< Point light
  23. typeSpot = 2, //!< Spot light
  24. typeDirectional = 3 //!< Directional light
  25. } LightType;
  26. Light(TombRaider &tr, unsigned int room, unsigned int index);
  27. void getPos(vec4_t p);
  28. void getDir(vec3_t d);
  29. vec_t getAtt();
  30. void getColor(vec4_t c);
  31. vec_t getCutoff();
  32. LightType getType();
  33. private:
  34. vec4_t pos; //! Light position in 3 space
  35. vec3_t dir; //! Light direction
  36. vec_t att;
  37. vec4_t color; //! Color of light
  38. vec_t cutoff; //! Fade out distance
  39. LightType type; //! Type of light
  40. };
  41. class StaticModel {
  42. public:
  43. StaticModel(TombRaider &tr, unsigned int room, unsigned int i);
  44. void display();
  45. // Compares distance to ViewVolume for depth sorting
  46. bool operator<(const StaticModel &other);
  47. private:
  48. int index;
  49. vec_t yaw;
  50. vec3_t pos;
  51. // ?
  52. //vec3_t bbox[2];
  53. };
  54. class Portal {
  55. public:
  56. Portal(TombRaider &tr, unsigned int room, unsigned int index, Matrix &transform);
  57. void getVertices(vec3_t vert[4]);
  58. int getAdjoiningRoom();
  59. private:
  60. vec3_t vertices[4];
  61. vec3_t normal;
  62. int adjoiningRoom;
  63. };
  64. class Box {
  65. public:
  66. Box(TombRaider &tr, unsigned int room, unsigned int index);
  67. private:
  68. vec3_t a;
  69. vec3_t b;
  70. vec3_t c;
  71. vec3_t d;
  72. };
  73. class Sector {
  74. public:
  75. Sector(TombRaider &tr, unsigned int room, unsigned int index);
  76. vec_t getFloor();
  77. vec_t getCeiling();
  78. bool isWall();
  79. private:
  80. vec_t floor;
  81. vec_t ceiling;
  82. bool wall;
  83. };
  84. #endif