Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

RoomData.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 "glm/vec3.hpp"
  10. #include <vector>
  11. #include <memory>
  12. class BoundingBox {
  13. public:
  14. BoundingBox();
  15. void getBoundingBox(float box[2][3]);
  16. void setBoundingBox(float min[3], float max[3]);
  17. void display(bool points, const unsigned char c1[4], const unsigned char c2[4]);
  18. bool inBox(float x, float y, float z);
  19. bool inBoxPlane(float x, float z);
  20. private:
  21. float a[3], b[3];
  22. };
  23. class Light {
  24. public:
  25. /*!
  26. * \brief Type a light can be of
  27. */
  28. typedef enum {
  29. typePoint = 1, //!< Point light
  30. typeSpot = 2, //!< Spot light
  31. typeDirectional = 3 //!< Directional light
  32. } LightType;
  33. void getPos(float p[4]);
  34. void getDir(float d[3]);
  35. float getAtt();
  36. void getColor(float c[4]);
  37. float getCutoff();
  38. LightType getType();
  39. private:
  40. float pos[4]; //! Light position in 3 space
  41. float dir[3]; //! Light direction
  42. float att;
  43. float color[4]; //! Color of light
  44. float cutoff; //! Fade out distance
  45. LightType type; //! Type of light
  46. };
  47. class StaticModel {
  48. public:
  49. void display();
  50. private:
  51. int index;
  52. float yaw;
  53. float pos[3];
  54. // ?
  55. //float bbox[2][3];
  56. };
  57. class Portal {
  58. public:
  59. Portal(glm::vec3 vert[4], float norm[3], int adj);
  60. void getVertices(float vert[4][3]);
  61. int getAdjoiningRoom();
  62. private:
  63. float vertices[4][3];
  64. float normal[3];
  65. int adjoiningRoom;
  66. };
  67. class Sector {
  68. public:
  69. Sector(float f, float c, bool w) : floor(f), ceiling(c), wall(w) { }
  70. float getFloor();
  71. float getCeiling();
  72. bool isWall();
  73. private:
  74. float floor;
  75. float ceiling;
  76. bool wall;
  77. };
  78. #endif