DayZ 1.27
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 строка 194

195 {
196 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
197 float wind01 = weather.GetWindSpeed() / weather.GetWindMaximumSpeed();
198
199 float overcastScale = Math.Lerp( 0.50, 1.25, overcast01 );
200 float windScale = Math.Lerp( 1.25, 1.00, wind01 );
201
202 return Math.Clamp( overcastScale * windScale, 0.50, 1.25 );
203 }
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().