選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

chunkmesh.h 938B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include <memory>
  3. #include <glm/glm.hpp>
  4. #include <vector>
  5. namespace vtk {
  6. class World;
  7. class ChunkMesh {
  8. public:
  9. ChunkMesh(World& world, glm::ivec3 linkedChunkPos);
  10. void rebuildChunkGeometry();
  11. void rebuildChunkLighting();
  12. void draw();
  13. bool updateGeometry(); //puts the geometry into the VBOs because OGL can't into threading
  14. protected:
  15. //position of chunk since chunk does NOT have to exist to rebuild
  16. //if chunk is not loaded, rebuild will fail silently
  17. //this is useful for allowing you to unload distant chunks but still draw them
  18. //it's also faster to look up adjacent chunk positions when you have the position
  19. glm::ivec3 mLinkedChunkPos;
  20. World& mLinkedWorld;
  21. std::vector<float> geometry;
  22. bool mLocked;
  23. bool mUpdated;
  24. unsigned mVAO;
  25. unsigned mGeometryTexVBO;
  26. unsigned mLightVBO;
  27. int mFaceCount;
  28. int mGeometryFaceCount;
  29. };
  30. }