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

◆ CalculateVolFog()

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

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

554 {
555 float distanceDensity, heigthDensity, heightBias;
556 int year, month, day, hour, minute;
557 g_Game.GetWorld().GetDate(year, month, day, hour, minute);
558
559 if ( hour < 6 && hour >= 3 )
560 {
561 heightBias = m_Weather.GetDynVolFogHeightBias();
562
563 if ( heightBias == m_WeatherDefaultSettings.m_DefaultHeigthBias ) //verify if the foggy morning check has been done
564 {
565 bool foggyMorning = Math.RandomIntInclusive(0,1);
566
567 if (foggyMorning)
568 {
569 heightBias = Math.RandomInt(m_WeatherDefaultSettings.m_FoggyMorningHeigthBiasLowLimit, m_WeatherDefaultSettings.m_DefaultHeigthBias);
570 }
571 else
572 {
573 heightBias = m_WeatherDefaultSettings.m_FoggyMorningHeigthBiasLowLimit - 1;
574 }
575 }
576
577 if (heightBias == m_WeatherDefaultSettings.m_FoggyMorningHeigthBiasLowLimit - 1) //not foggy morning
578 {
579 distanceDensity = Math.Lerp( 0.01, 0.03, lerpValue ) * Math.Clamp(1 - (windMagnitude / m_Weather.GetWindMaximumSpeed()), 0.1, 1);
580 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
581 }
582 else //foggy morning
583 {
584 distanceDensity = Math.Lerp( 0.5, 0.1, lerpValue ) * Math.Clamp(1 - (windMagnitude / m_Weather.GetWindMaximumSpeed()), 0.1, 1);
585 heigthDensity = Math.Lerp( 0.2, 1, lerpValue);
586 }
587 }
588 else if ( hour < 18 && hour >= 6 )
589 {
590 distanceDensity = Math.Lerp( 0.01, 0.05, lerpValue ) * Math.Clamp(1 - (windMagnitude / m_Weather.GetWindMaximumSpeed()), 0.1, 1);
591 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
592 heightBias = m_WeatherDefaultSettings.m_DefaultHeigthBias;
593 }
594 else
595 {
596 distanceDensity = Math.Lerp( 0.01, 0.03, lerpValue ) * Math.Clamp(1 - (windMagnitude / m_Weather.GetWindMaximumSpeed()), 0.1, 1);
597 heigthDensity = Math.Lerp( 0.9, 1, lerpValue);
598 heightBias = m_WeatherDefaultSettings.m_DefaultHeigthBias;
599 }
600
601 m_Weather.SetDynVolFogDistanceDensity(distanceDensity, changeTime);
602 m_Weather.SetDynVolFogHeightDensity(heigthDensity, changeTime);
603 m_Weather.SetDynVolFogHeightBias(heightBias, changeTime);
604 }
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().