Now generating roads on terrain. Still some trouble left.

This commit is contained in:
Segey Lapin
2021-10-13 20:09:02 +03:00
parent 1b244e80ef
commit 2c7a6af437
6 changed files with 52 additions and 12 deletions

View File

@@ -90,7 +90,6 @@ Ref<DensityMap> WorldGenerator::get_density_map() const
VoxelGenerator::Result WorldGenerator::generate_block(VoxelBlockRequest &input) {
ERR_FAIL_COND_V(input.voxel_buffer.is_null(), Result());
ERR_FAIL_COND_V(_noise.is_null(), Result());
#ifdef WORLD_MAP_TESTS
WorldMapData *wmd = WorldMapData::get_singleton();
@@ -101,8 +100,8 @@ VoxelGenerator::Result WorldGenerator::generate_block(VoxelBlockRequest &input)
#endif
Result result;
VoxelBuffer &out_buffer = **input.voxel_buffer;
WorldGenerator::generate(
VoxelBufferInternal &out_buffer = input.voxel_buffer;
result = WorldGenerator::generate(
out_buffer,
[this](int x, int y, int z) { return height_func(x, y, z); },
input.origin_in_voxels, input.lod);