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

◆ CalculateVolFog()

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

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

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

Перекрестные ссылки Math::Clamp(), g_Game, Math::Lerp(), WorldData::m_Weather, WorldData::m_WeatherDefaultSettings, Math::RandomInt() и Math::RandomIntInclusive().

Используется в Init() и WeatherOnBeforeChange().