mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add gfx.weather.get_current, get_current_data, get_fall_intencity
This commit is contained in:
parent
4d5b450145
commit
a152237f26
3 changed files with 40 additions and 3 deletions
|
|
@ -37,6 +37,8 @@ struct EngineSettings;
|
|||
struct Weather {
|
||||
WeatherPreset a {};
|
||||
WeatherPreset b {};
|
||||
std::string nameA;
|
||||
std::string nameB;
|
||||
float t = 1.0f;
|
||||
float speed = 0.0f;
|
||||
|
||||
|
|
@ -47,11 +49,13 @@ struct Weather {
|
|||
a.intensity = 1.0f - t;
|
||||
}
|
||||
|
||||
void change(WeatherPreset preset, float time) {
|
||||
void change(WeatherPreset preset, float time, std::string name="") {
|
||||
std::swap(a, b);
|
||||
std::swap(nameA, nameB);
|
||||
b = std::move(preset);
|
||||
t = 0.0f;
|
||||
speed = 1.0f / glm::max(time, 1.e-5f);
|
||||
nameB = std::move(name);
|
||||
update(0.0f);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue