weather change test

This commit is contained in:
MihailRis
2025-02-26 12:19:47 +03:00
parent 589518fb25
commit 02d8d8d6bf
7 changed files with 83 additions and 41 deletions
+10 -2
View File
@@ -173,7 +173,10 @@ void Decorator::update(
}
void Decorator::update(
float delta, const Camera& camera, const WeatherPreset& weather
float delta,
const Camera& camera,
const WeatherPreset& weatherA,
const WeatherPreset& weatherB
) {
glm::ivec3 pos = camera.position;
for (int i = 0; i < ITERATIONS; i++) {
@@ -181,7 +184,12 @@ void Decorator::update(
}
int randIters = std::min(50'000, static_cast<int>(delta * 24'000));
for (int i = 0; i < randIters; i++) {
updateRandom(delta, pos, weather);
if (weatherA.intensity > 1.e-3f) {
updateRandom(delta, pos, weatherA);
}
if (weatherB.intensity > 1.e-3f) {
updateRandom(delta, pos, weatherB);
}
}
const auto& chunks = *player.chunks;
const auto& indices = *level.content.getIndices();