DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Weather.c
См. документацию.
1
4
5
6//-----------------------------------------------------------------------------
22
23
24//-----------------------------------------------------------------------------
29{
30 private void WeatherPhenomenon() {}
31 private void ~WeatherPhenomenon() {}
32
35
38 proto native float GetActual();
39
41 proto native float GetForecast();
42
49 proto native void Set( float forecast, float time = 0, float minDuration = 0 );
50
52 proto native float GetNextChange();
54 proto native void SetNextChange( float time );
55
61 proto void GetLimits( out float fnMin, out float fnMax );
74 proto native void SetLimits( float fnMin, float fnMax );
75
81 proto void GetForecastChangeLimits( out float fcMin, out float fcMax );
95 proto native void SetForecastChangeLimits( float fcMin, float fcMax );
96
102 proto void GetForecastTimeLimits( out float ftMin, out float ftMax );
113 proto native void SetForecastTimeLimits( float ftMin, float ftMax );
114
124
125 bool OnBeforeChange( float change, float time )
126 {
127 // check if mission forces use of custom weather
128 Weather weather = g_Game.GetWeather();
129
130 if ( weather.GetMissionWeather() )
131 return false;
132
133 // check for active worlddata with custom onbeforechange behaviour
134 Mission currentMission = g_Game.GetMission();
135
136 if ( currentMission )
137 {
138 WorldData worldData = currentMission.GetWorldData();
139 if ( worldData )
140 {
141 return worldData.WeatherOnBeforeChange( GetType(), GetActual(), change, time );
142 }
143 }
144
145 return false;
146 }
147};
148
149
156
157
158
159
160//-----------------------------------------------------------------------------
165{
166 protected bool m_missionWeather;
167
168 private void Weather()
169 {
170 m_missionWeather = false;
171 }
172
173 private void ~Weather() {}
174
176 proto native float GetTime();
177
179 proto native Overcast GetOvercast();
180
182 proto native Fog GetFog();
183
185 proto native Rain GetRain();
186
188 proto native Snowfall GetSnowfall();
189
196
202
210 proto native void SetStorm( float density, float threshold, float timeOut );
211
213 proto native void SuppressLightningSimulation(bool state);
214
216 proto native vector GetWind();
217
232 proto native void SetWind( vector wind );
233
239 proto native float GetWindSpeed();
240
247 proto native void SetWindSpeed( float speed );
248
254 proto native float GetWindMaximumSpeed();
255
260 proto native void SetWindMaximumSpeed( float maxSpeed );
261
268 proto void GetWindFunctionParams( out float fnMin, out float fnMax, out float fnSpeed );
269
276 proto native void SetWindFunctionParams( float fnMin, float fnMax, float fnSpeed );
277
294 proto native void SetRainThresholds( float tMin, float tMax, float tTime );
295
312 proto native void SetSnowfallThresholds( float tMin, float tMax, float tTime );
313
319 proto native void SetSnowflakeScale(float scale);
320
324 proto native float GetSnowflakeScale();
325
331 static proto float WindDirectionToAngle( vector dir );
332
338 static proto vector AngleToWindDirection( float angle );
339
340
345 proto native bool IsDynVolFogEnabled();
351 proto native void SetDynVolFogDistanceDensity(float value, float time = 0);
355 proto native float GetDynVolFogDistanceDensity();
361 proto native void SetDynVolFogHeightDensity(float value, float time = 0);
365 proto native float GetDynVolFogHeightDensity();
372 proto native void SetDynVolFogHeightBias(float value, float time = 0);
376 proto native float GetDynVolFogHeightBias();
377
378
379 void MissionWeather( bool use )
380 {
381 m_missionWeather = use;
382 }
383
385 {
386 return m_missionWeather;
387 }
388
389 // Noise reduction due to environmental conditions, used for AI noise evaluation
391 {
394
395 if (rainReduction == 0 && snowfallReduction == 0)
396 return 1;
397
398 if (rainReduction > snowfallReduction) // combined phenomenons dont need to have multiplicative effects
399 return 1 - rainReduction;
400 else
401 return 1 - snowfallReduction;
402 }
403};
DayZGame g_Game
Определения DayZGame.c:3868
@ OVERCAST
@ FOG
WeatherPhenomenon Fog
Определения Weather.c:151
WeatherPhenomenon Rain
Определения Weather.c:152
EWeatherPhenomenon
Определения Weather.c:11
@ VOLFOG_HEIGHT_DENSITY
Определения Weather.c:18
@ SNOWFALL
Определения Weather.c:15
@ WIND_MAGNITUDE
Определения Weather.c:17
@ RAIN
Определения Weather.c:14
@ VOLFOG_DISTANCE_DENSITY
Определения Weather.c:19
@ WIND_DIRECTION
Определения Weather.c:16
@ VOLFOG_HEIGHT_BIAS
Определения Weather.c:20
WeatherPhenomenon WindDirection
Определения Weather.c:154
WeatherPhenomenon Overcast
Определения Weather.c:150
WeatherPhenomenon Snowfall
Определения Weather.c:153
WeatherPhenomenon WindMagnitude
Определения Weather.c:155
Определения constants.c:659
WorldData GetWorldData()
Определения gameplay.c:743
Mission class.
Определения gameplay.c:687
proto native Fog GetFog()
Returns a fog phenomenon object.
void Weather()
Определения Weather.c:168
proto native float GetDynVolFogHeightBias()
Returns the current 'dynamic' volumetric fog height bias in meters.
proto native void SetDynVolFogHeightBias(float value, float time=0)
Sets the 'dynamic' volumetric height bias. Takes effect only if enabled via world config.
float GetNoiseReductionByWeather()
Определения Weather.c:390
bool m_missionWeather
Определения Weather.c:166
proto native void SetWind(vector wind)
Sets the wind vector (direction and speed as length of the vector).
proto native void SetSnowflakeScale(float scale)
Sets the overall scale of snowflakes during snowfall phenomenon. This value is not synchronized and s...
proto native void SetStorm(float density, float threshold, float timeOut)
Sets the thunderstorm properties.
proto native void SetWindSpeed(float speed)
Sets the actual wind speed in metre per second.
proto native WindMagnitude GetWindMagnitude()
Returns a wind magnitude phenomenon object.
bool GetMissionWeather()
Определения Weather.c:384
proto native void SetDynVolFogDistanceDensity(float value, float time=0)
Sets the dynamic volumetric fog distance density. Only takes effect if dynamic volumetric fog is enab...
proto native bool IsDynVolFogEnabled()
Dynamic volumetric fog only takes effect if enabled in the world config.
proto native Snowfall GetSnowfall()
Returns a snowfall phenomenon object.
proto native float GetSnowflakeScale()
Returns the overall scale of snowflakes during snowfall phenomenon.
proto native void SetRainThresholds(float tMin, float tMax, float tTime)
Sets overcast threshold values for rain phenomena.
proto native void SetWindFunctionParams(float fnMin, float fnMax, float fnSpeed)
Sets function parameters that controls the wind behaviour (change in time).
proto void GetWindFunctionParams(out float fnMin, out float fnMax, out float fnSpeed)
Reads function parameters that controls the wind behaviour (change in time).
static proto float WindDirectionToAngle(vector dir)
Returns the xz angle of the provided wind vector.
proto native vector GetWind()
Returns wind vector (direction and speed as length of the vector).
proto native float GetTime()
Returns actual time from start of a server (how many seconds elapsed from server start).
proto native float GetWindSpeed()
Returns actual wind speed in metre per second.
proto native WindDirection GetWindDirection()
Returns a wind direction phenomenon object.
proto native void SetDynVolFogHeightDensity(float value, float time=0)
Sets the dynamic volumetric fog height density. Only takes effect if dynamic volumetric fog is enable...
proto native float GetWindMaximumSpeed()
Returns maximal wind speed in metre per second.
void MissionWeather(bool use)
Определения Weather.c:379
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native void SetSnowfallThresholds(float tMin, float tMax, float tTime)
Sets overcast threshold values for snowfall phenomena.
proto native void SuppressLightningSimulation(bool state)
enables/disables thunderbolt simulation on client (together with sounds)
static proto vector AngleToWindDirection(float angle)
Returns wind direction from the provided wind angle.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto native float GetDynVolFogHeightDensity()
Returns the current 'dynamic' volumetric fog height density.
void ~Weather()
Определения Weather.c:173
proto native float GetDynVolFogDistanceDensity()
Returns the current 'dynamic' volumetric fog distance density.
proto native void SetWindMaximumSpeed(float maxSpeed)
Sets the maximal wind speed in metre per second. Equivalent to setting WindMagnitude phenomenon(s) va...
Определения Weather.c:165
proto void GetLimits(out float fnMin, out float fnMax)
Reads limits of this phenomenon.
proto native void Set(float forecast, float time=0, float minDuration=0)
Sets the forecast.
proto native float GetActual()
proto native void SetNextChange(float time)
Sets the time in seconds when the next forecast will be computed.
proto native void SetLimits(float fnMin, float fnMax)
Sets limits of this phenomenon.
proto native void SetForecastChangeLimits(float fcMin, float fcMax)
Sets limits of change when forecast is computed.
bool OnBeforeChange(float change, float time)
Is called every time the Phenomenon computes new forecast.
Определения Weather.c:125
proto void GetForecastTimeLimits(out float ftMin, out float ftMax)
Reads time range in which next forecast can be computed.
proto native EWeatherPhenomenon GetType()
Returns type of this phenomenon.
void ~WeatherPhenomenon()
Определения Weather.c:31
proto native float GetNextChange()
Reads the time in seconds when the next forecast will be computed.
void WeatherPhenomenon()
Определения Weather.c:30
proto void GetForecastChangeLimits(out float fcMin, out float fcMax)
Reads limits of change when forecast is computed.
proto native float GetForecast()
Returns a forecast value the phenomenon is heading towards.
proto native void SetForecastTimeLimits(float ftMin, float ftMax)
Sets time range in which next forecast can be computed.
Определения Weather.c:29
bool WeatherOnBeforeChange(EWeatherPhenomenon type, float actual, float change, float time)
Определения WorldData.c:240
Keeps information about currently loaded world, like temperature.
Определения WorldData.c:3
Определения EnConvert.c:106
static float RAIN_NOISE_REDUCTION_WEIGHT
Определения constants.c:1077
static float SNOWFALL_NOISE_REDUCTION_WEIGHT
Определения constants.c:1078