mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
refactor: terrain generation (#9)
* feat: add BlockType * refactor: use fBM for heightmap generation * feat: improve mountain realism * refactor: adjust mountain spawn probability * feat: add biome boundary blending * refactor: remove resolve_biome_adjacency_conflict function * feat: add snowy plain * perf: speed up world generation * refactor: lower overall terrain height
This commit is contained in:
@@ -23,12 +23,12 @@ void ForestBuilder::build_blocks() {
|
||||
for (int z = 0; z < CHUNK_SIZE; z++) {
|
||||
int height = static_cast<int>(m_heightmap[x][z]);
|
||||
for (int y = 5; y < height - 5; y++) {
|
||||
m_blocks[Chunk::get_index(x, y, z)] = 3;
|
||||
m_blocks[Chunk::index(x, y, z)] = 3;
|
||||
}
|
||||
for (int y = height - 5; y < height; y++) {
|
||||
m_blocks[Chunk::get_index(x, y, z)] = 2;
|
||||
m_blocks[Chunk::index(x, y, z)] = 2;
|
||||
}
|
||||
m_blocks[Chunk::get_index(x, height, z)] = 1;
|
||||
m_blocks[Chunk::index(x, height, z)] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user