2020-07-18 15:42:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../data/geometry/Faces.hpp"
|
2020-07-31 17:09:44 +00:00
|
|
|
#include "../world/forward.h"
|
2020-07-18 15:42:45 +00:00
|
|
|
|
2020-07-25 16:45:03 +00:00
|
|
|
namespace world {
|
|
|
|
class Chunk;
|
|
|
|
}
|
2020-07-18 15:42:45 +00:00
|
|
|
namespace contouring::surrounding {
|
|
|
|
const auto CENTER = 6;
|
2020-07-25 16:45:03 +00:00
|
|
|
typedef std::array<std::shared_ptr<const world::Chunk>, CENTER+1> faces;
|
2020-07-18 15:42:45 +00:00
|
|
|
|
2020-07-31 17:09:44 +00:00
|
|
|
bool load(faces &out, const chunk_pos &chunkPos, const world::chunk_map &chunks);
|
2020-07-18 15:42:45 +00:00
|
|
|
|
2020-07-25 16:45:03 +00:00
|
|
|
std::pair<ushort, ushort> getNeighborIdx(ushort idx, geometry::Face face);
|
2020-07-24 19:42:47 +00:00
|
|
|
|
2020-07-25 16:45:03 +00:00
|
|
|
typedef std::array<std::shared_ptr<const world::Chunk>, 8> corners;
|
2020-07-24 19:42:47 +00:00
|
|
|
const glm::ivec3 g_corner_offsets[8] = {
|
|
|
|
glm::ivec3(0, 0, 0),
|
|
|
|
glm::ivec3(0, 0, 1),
|
|
|
|
glm::ivec3(0, 1, 0),
|
|
|
|
glm::ivec3(0, 1, 1),
|
|
|
|
glm::ivec3(1, 0, 0),
|
|
|
|
glm::ivec3(1, 0, 1),
|
|
|
|
glm::ivec3(1, 1, 0),
|
|
|
|
glm::ivec3(1, 1, 1),
|
|
|
|
};
|
|
|
|
|
2020-07-31 17:09:44 +00:00
|
|
|
bool load(corners &out, const chunk_pos &chunkPos, const world::chunk_map &chunks);
|
2020-07-18 15:42:45 +00:00
|
|
|
}
|