DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ ComputeSnowflakeScale()

float WorldData::ComputeSnowflakeScale ( Weather weather)
inlineprotected

Returns the desired snowflake scale based on weather simulation state.

Аргументы
weatherWeather instance

См. определение в файле WorldData.c строка 195

196 {
197 float overcast01 = Math.Clamp( Math.InverseLerp( 0.4, 1.0, weather.GetOvercast().GetActual() ), 0.0, 1.0 ); // remap range to <0.4, 1.0> snowfall overcast threshold
198 float wind01 = weather.GetWindSpeed() / weather.GetWindMaximumSpeed();
199
200 float overcastScale = Math.Lerp( 0.50, 1.25, overcast01 );
201 float windScale = Math.Lerp( 1.25, 1.00, wind01 );
202
203 return Math.Clamp( overcastScale * windScale, 0.50, 1.25 );
204 }
proto native float GetWindSpeed()
Returns actual wind speed in metre per second.
proto native float GetWindMaximumSpeed()
Returns maximal wind speed in metre per second.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto native float GetActual()

Перекрестные ссылки Math::Clamp(), WeatherPhenomenon::GetActual(), Weather::GetOvercast(), Weather::GetWindMaximumSpeed(), Weather::GetWindSpeed(), Math::InverseLerp() и Math::Lerp().

Используется в UpdateWeatherEffects().