feat(world-gen): add CaveCarver skeleton (no-op Carve)

This commit is contained in:
2026-06-01 15:23:05 +02:00
parent 013d524544
commit 093b3deabf
2 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using OpenTK.Mathematics;
using VoxelEngine.Core;
using VoxelEngine.World.Blocks;
using VoxelChunk = VoxelEngine.World.Chunk.Chunk;
namespace VoxelEngine.World.WorldGen;
// Carves caves into an already-terrain-filled chunk. Stateless after
// construction; the carve methods are pure functions of (chunk, chunkPos).
// Safe to share across worker threads.
public sealed class CaveCarver
{
private readonly int _seed;
private readonly BlockRegistry _blocks;
private readonly Configuration _cfg;
private readonly FastNoiseLite _caveNoise;
public CaveCarver(int seed, BlockRegistry blocks, Configuration cfg)
{
this._seed = seed;
this._blocks = blocks;
this._cfg = cfg;
this._caveNoise = new FastNoiseLite(seed + 100);
this._caveNoise.SetNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
this._caveNoise.SetFrequency(cfg.CaveNoiseFrequency);
}
public void Carve(VoxelChunk chunk, Vector3i chunkPos)
{
// Implemented in Tasks 5 and 6.
}
}