mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
add gfx.weather library & add weather.set command
This commit is contained in:
parent
02d8d8d6bf
commit
4d5b450145
8 changed files with 44 additions and 18 deletions
|
|
@ -47,6 +47,14 @@ struct Weather {
|
|||
a.intensity = 1.0f - t;
|
||||
}
|
||||
|
||||
void change(WeatherPreset preset, float time) {
|
||||
std::swap(a, b);
|
||||
b = std::move(preset);
|
||||
t = 0.0f;
|
||||
speed = 1.0f / glm::max(time, 1.e-5f);
|
||||
update(0.0f);
|
||||
}
|
||||
|
||||
float fogOpacity() const {
|
||||
return b.fogOpacity * t + a.fogOpacity * (1.0f - t);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue