DayZ 1.30
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 строка 205

206 {
207 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
208 float wind01 = weather.GetWindSpeed() / weather.GetWindMaximumSpeed();
209
210 float overcastScale = Math.Lerp( 0.50, 1.25, overcast01 );
211 float windScale = Math.Lerp( 1.25, 1.00, wind01 );
212
213 return Math.Clamp( overcastScale * windScale, 0.50, 1.25 );
214 }
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().