feat(world-gen): add CaveCarver skeleton (no-op Carve)
This commit is contained in:
33
World/WorldGen/CaveCarver.cs
Normal file
33
World/WorldGen/CaveCarver.cs
Normal 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.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user