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

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