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-08-02 20:15:53 +00:00
|
|
|
bool load(faces &out, const chunk_pos &chunkPos, const world::ChunkContainer &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-08-01 21:31:01 +00:00
|
|
|
const chunk_pos g_corner_offsets[8] = {
|
|
|
|
chunk_pos(0, 0, 0),
|
|
|
|
chunk_pos(0, 0, 1),
|
|
|
|
chunk_pos(0, 1, 0),
|
|
|
|
chunk_pos(0, 1, 1),
|
|
|
|
chunk_pos(1, 0, 0),
|
|
|
|
chunk_pos(1, 0, 1),
|
|
|
|
chunk_pos(1, 1, 0),
|
|
|
|
chunk_pos(1, 1, 1),
|
2020-07-24 19:42:47 +00:00
|
|
|
};
|
|
|
|
|
2020-08-02 20:15:53 +00:00
|
|
|
bool load(corners &out, const chunk_pos &chunkPos, const world::ChunkContainer &chunks);
|
2020-07-18 15:42:45 +00:00
|
|
|
}
|