33 m_MaxTemps = {3,5,7,14,19,24,26,25,21,16,10,5};
34 m_MinTemps = {-3,-2,0,4,9,14,18,17,12,7,4,0};
39 if ( monthday <= 8.0 )
46 if ( monthday <= 8.0 )
55 float dayLight = approxSunset - approxSunrise;
56 float nightTime = 24.0 - dayLight;
57 int tempArrayIndex =
Math.
Floor(monthday) - 1;
58 int tempArrayIndexToLerp = tempArrayIndex + 1;
59 if ( tempArrayIndexToLerp >= 12 )
60 tempArrayIndexToLerp = 0;
61 float tempArrayLerp = monthday -
Math.
Floor(monthday);
63 float minTempB =
m_MinTemps[tempArrayIndexToLerp];
65 float maxTempB =
m_MaxTemps[tempArrayIndexToLerp];
66 float eveningMinA = minTempA + ( 0.5 *
Math.
AbsFloat( minTempA - maxTempA ) );
67 float eveningMinB = minTempB + ( 0.5 *
Math.
AbsFloat( minTempB - maxTempB ) );
69 if ( ( daytime >= approxSunrise ) && ( daytime <= approxSunset ) ) {
70 if ( daytime <= ( approxSunrise + ( dayLight * 0.75 ) ) )
72 Math.
Lerp( minTempA, minTempB, tempArrayLerp ),
73 Math.
Lerp( maxTempA, maxTempB, tempArrayLerp ),
74 ( ( daytime - approxSunrise ) / ( dayLight * 0.75 ) ) );
77 Math.
Lerp( maxTempA, maxTempB, tempArrayLerp ),
78 Math.
Lerp( eveningMinA, eveningMinB, tempArrayLerp ),
79 ( ( ( daytime - approxSunrise ) - ( dayLight * 0.75 ) ) / ( dayLight - ( dayLight * 0.75 ) ) ) );
81 if ( ( daytime > approxSunset ) && ( daytime < 24 ) )
83 Math.
Lerp( eveningMinA, eveningMinB, tempArrayLerp ),
84 Math.
Lerp( minTempA, minTempB, tempArrayLerp ),
85 ( ( daytime - approxSunset ) / ( 24 - approxSunset ) ) / 2.0 );
88 Math.
Lerp( eveningMinA, eveningMinB, tempArrayLerp ),
89 Math.
Lerp( minTempA, minTempB, tempArrayLerp ),
90 ( ( ( daytime + ( 24 - approxSunset ) ) / nightTime ) / 2.0 ) + 0.5 );
98 int year, month, day, hour, minute;
141 Print(
"--------------------");
142 for (
int i = 0; i < 24; i++ )
144 for (
int j = 0; j < 6; j++ )
146 int minute = ( j * 10 );
proto native World GetWorld()
Keeps information about currently loaded world, like temperature.
protected ref array< vector > m_FiringPos
float GetNightTemperature()
float GetBaseEnvTemperatureExact(int month, int day, int hour, int minute)
protected float m_MaxTemps[12]
float GetApproxSunsetTime(float monthday)
protected float m_Sunrise_Jan
float GetApproxSunriseTime(float monthday)
protected float m_Sunset_Jan
bool WeatherOnBeforeChange(EWeatherPhenomenon type, float actual, float change, float time)
protected Weather m_Weather
protected float m_Sunrise_Jul
float GetDayTemperature()
void BaseTempDebug(int month, int day)
void UpdateBaseEnvTemperature(float timeslice)
float GetBaseEnvTemperature()
protected float CalcBaseEnvironmentTemperature(float monthday, float daytime)
protected float m_EnvironmentTemperature
protected float m_MinTemps[12]
protected float m_NightTemperature
protected float m_Sunset_Jul
array< vector > GetArtyFiringPos()
protected float m_DayTemperature
proto void GetDate(out int year, out int month, out int day, out int hour, out int minute)
Get actual ingame world time.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float AbsFloat(float f)
Returns absolute value.
static proto float Floor(float f)
Returns floor of value.