Skip to content

Commit 009c5cd

Browse files
committed
SurfaceNetsChunk: Optimize generation and implement block corners
1 parent 47be0bc commit 009c5cd

File tree

2 files changed

+248
-416
lines changed

2 files changed

+248
-416
lines changed

include/CommonLib/SurfaceNetsChunk.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <CommonLib/Chunk.hpp>
1111
#include <Nazara/Math/Box.hpp>
1212
#include <NazaraUtils/FunctionRef.hpp>
13+
#include <unordered_map>
1314

1415
namespace tsom
1516
{
@@ -33,7 +34,10 @@ namespace tsom
3334
SurfaceNetsChunk& operator=(SurfaceNetsChunk&&) = delete;
3435

3536
private:
37+
Nz::EnumArray<Nz::BoxCorner, Nz::Vector3f> BuildCorners(const Nz::Vector3ui& indices, const std::unordered_map<ChunkIndices, const Chunk*>& neighborChunks) const;
3638
void BuildMesh(std::size_t layerIndex, std::vector<Nz::UInt32>& indices, const Nz::FunctionRef<VertexAttributes(const Nz::Vector3ui& blockIndices, Direction direction)>& addFace, bool generateVisualMesh) const;
39+
40+
BlockIndex GetNeighborBlock(const std::unordered_map<ChunkIndices, const Chunk*>& neighborChunks, Nz::Vector3ui indices, const Nz::Vector3i& offset) const;
3741
};
3842
}
3943

0 commit comments

Comments
 (0)