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.

RoomMesh.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*!
  2. * \file include/RoomMesh.h
  3. * \brief Room Mesh Geometry
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _ROOM_MESH_H_
  8. #define _ROOM_MESH_H_
  9. #include <vector>
  10. #include "Mesh.h"
  11. struct RoomVertexTR2 {
  12. int x, y, z; // Vertex coordinates, relative to x/zOffset
  13. int light1, light2; // Almost always equal
  14. // Set of flags for special rendering effects
  15. // 0x8000 - Something to do with water surface?
  16. // 0x4000 - Underwater lighting modulation/movement if seen from above
  17. // 0x2000 - Water/Quicksand surface movement
  18. // 0x0010 - Normal?
  19. unsigned int attributes;
  20. };
  21. class RoomMesh {
  22. public:
  23. RoomMesh(const std::vector<RoomVertexTR2>& vertices,
  24. const std::vector<IndexedRectangle>& rectangles,
  25. const std::vector<IndexedRectangle>& triangles);
  26. void prepare();
  27. void display(glm::mat4 MVP);
  28. private:
  29. std::vector<unsigned short> indicesBuff;
  30. std::vector<glm::vec3> verticesBuff;
  31. std::vector<glm::vec2> uvsBuff;
  32. std::vector<unsigned int> texturesBuff;
  33. };
  34. #endif