chunk.h 477 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. // STD
  3. #include <unordered_map>
  4. // Libs
  5. #define GLM_ENABLE_EXPERIMENTAL
  6. #include <gtx/hash.hpp>
  7. // Coral
  8. #include "coral_mesh.h"
  9. #include "voxel_data.h"
  10. struct Chunk
  11. {
  12. glm::ivec2 coord{};
  13. glm::ivec2 world_position{};
  14. bool is_active{ false };
  15. bool is_initialized{ false };
  16. std::shared_ptr<coral_3d::coral_mesh> mesh{};
  17. std::vector<coral_3d::Vertex> vertices{};
  18. std::vector<uint32_t> indices{};
  19. std::unordered_map<glm::vec3, BlockType> block_map{};
  20. };