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

◆ CalculateVolFog() [2/2]

override void WorldData::CalculateVolFog ( float lerpValue,
float windMagnitude,
float changeTime )
inlineprotected

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

467 {
468 float distanceDensity, heigthDensity, heightBias;
469 int year, month, day, hour, minute;
470 GetGame().GetWorld().GetDate(year, month, day, hour, minute);
471
472 if ( hour < 9 && hour >= 5 )
473 {
474 distanceDensity = Math.Lerp( 0.015, 0.05, lerpValue ) * Math.Clamp(1 - (windMagnitude / m_Weather.GetWindMaximumSpeed()), 0.1, 1);
475 heigthDensity = Math.Lerp( 0.8, 1, lerpValue);
476
477 heightBias = m_Weather.GetDynVolFogHeightBias();
478
479 if (heightBias == m_WeatherDefaultSettings.m_DefaultHeigthBias) //checks if the randomization has been done
480 {
481 int diceRoll = Math.RandomIntInclusive(1,100);
482
483 if (diceRoll < 50)
484 {
485 heightBias = Math.RandomInt(m_WeatherDefaultSettings.m_DefaultHeigthBias + 1, 80);
486 }
487 else if (diceRoll < 85)
488 {
489 heightBias = Math.RandomInt(80, 120);
490 }
491 else
492 {
493 heightBias = Math.RandomInt(120, 200);
494 }
495 }
496 }
497 else if ( hour < 18 && hour >= 9 )
498 {
499 distanceDensity = Math.Lerp( 0.01, 0.05, lerpValue ) * Math.Clamp(1 - (windMagnitude / m_Weather.GetWindMaximumSpeed()), 0.1, 1);
500 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
501 heightBias = m_WeatherDefaultSettings.m_DefaultHeigthBias;
502 }
503 else
504 {
505 distanceDensity = Math.Lerp( 0.01, 0.03, lerpValue ) * Math.Clamp(1 - (windMagnitude / m_Weather.GetWindMaximumSpeed()), 0.1, 1);
506 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
507 heightBias = m_WeatherDefaultSettings.m_DefaultHeigthBias;
508 }
509
510 m_Weather.SetDynVolFogDistanceDensity(distanceDensity, changeTime);
511 m_Weather.SetDynVolFogHeightDensity(heigthDensity, changeTime);
512 m_Weather.SetDynVolFogHeightBias(heightBias, changeTime);
513 }
proto native World GetWorld()
proto void GetDate(out int year, out int month, out int day, out int hour, out int minute)
Get actual ingame world time.
ref WorldDataWeatherSettings m_WeatherDefaultSettings
Определения WorldData.c:31
Weather m_Weather
Определения WorldData.c:18
proto native CGame GetGame()

Перекрестные ссылки Math::Clamp(), World::GetDate(), GetGame(), CGame::GetWorld(), Math::Lerp(), m_Weather, m_WeatherDefaultSettings, Math::RandomInt() и Math::RandomIntInclusive().