adding noise generator base class

This commit is contained in:
Kbz-8
2025-05-21 13:54:33 +02:00
parent 68619be28d
commit 4329e7624e
5 changed files with 30 additions and 4 deletions

View File

@@ -27,9 +27,8 @@ void Chunk::GenerateChunk()
{
for(std::uint32_t z = 0; z < CHUNK_SIZE.z; z++)
{
// Implement noise here
std::uint32_t height = std::abs(std::sin((float)m_offset.x / 20.0f) * std::cos((float)m_offset.y / 20.0f) * 60.0f) + 1;
for(std::uint32_t y = 0; y < height; y++)
std::uint32_t height = m_world.GetNoiseGenerator().GetHeight(m_position + Scop::Vec2i(x, z));
for(std::uint32_t y = 0; y < std::min(height, CHUNK_SIZE.y); y++)
m_data[x][z][y] = 1;
}
}