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

◆ CalculateVolFog()

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

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

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

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