1
0
Fork 0

Update the way the snow thickness is calculated, otherwise there will never be snow

This commit is contained in:
Erik Hofman 2021-02-07 16:03:08 +01:00
parent ba8b25db5f
commit 4894497ce2

View file

@ -867,21 +867,21 @@ void FGClimate::set_environment()
} }
else else
{ {
double wetness = std::max(_gl.precipitation - 20.0, 0.0); double wetness = 12.0*_gl.precipitation/990.0;
wetness = powf(sin(atan(12.0*wetness/990.0)), 2.0); wetness = pow(sin(atan(SGD_PI*wetness)), 2.0);
_set(_dust_cover, 0.0); _dust_cover = 0.0;
if (_gl.temperature_mean < -5.0) { if (_gl.temperature_mean < 5.0) {
_set(_snow_thickness, wetness); _snow_thickness = wetness;
} else { } else {
_set(_snow_thickness, 0.0); _snow_thickness = 0.0;
} }
if (_gl.temperature_mean > 0.0) { if (_gl.temperature_mean < 0.0) {
_set(_wetness, pow(wetness, 2.0)); _wetness = 0.0;
} else { } else {
_set(_wetness, 0.0); _wetness = wetness;
} }
double cover = std::min(_gl.precipitation_annual, 990.0)/990.0; double cover = std::min(_gl.precipitation_annual, 990.0)/990.0;