Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
Weather Class Reference

Weather controller. More...

Protected Attributes

bool m_missionWeather
bool m_UpdateFrozen

Private Member Functions

void Weather ()
void ~Weather ()
proto native float GetDynVolFogDistanceDensity ()
 Returns the current 'dynamic' volumetric fog distance density.
proto native float GetDynVolFogHeightBias ()
 Returns the current 'dynamic' volumetric fog height bias in meters.
proto native float GetDynVolFogHeightDensity ()
 Returns the current 'dynamic' volumetric fog height density.
proto native Fog GetFog ()
 Returns a fog phenomenon object.
bool GetMissionWeather ()
float GetNoiseReductionByWeather ()
proto native Overcast GetOvercast ()
 Returns an overcast phenomenon object.
proto native Rain GetRain ()
 Returns a rain phenomenon object.
proto native Snowfall GetSnowfall ()
 Returns a snowfall phenomenon object.
proto native float GetSnowflakeScale ()
 Returns the overall scale of snowflakes during snowfall phenomenon.
proto native float GetTime ()
 Returns actual time from start of a server (how many seconds elapsed from server start).
bool GetWeatherUpdateFrozen ()
proto native vector GetWind ()
 Returns wind vector (direction and speed as length of the vector).
proto native WindDirection GetWindDirection ()
 Returns a wind direction phenomenon object.
proto void GetWindFunctionParams (out float fnMin, out float fnMax, out float fnSpeed)
 Reads function parameters that controls the wind behaviour (change in time).
proto native WindMagnitude GetWindMagnitude ()
 Returns a wind magnitude phenomenon object.
proto native float GetWindMaximumSpeed ()
 Returns maximal wind speed in metre per second.
proto native float GetWindSpeed ()
 Returns actual wind speed in metre per second.
proto native bool IsDynVolFogEnabled ()
 Dynamic volumetric fog only takes effect if enabled in the world config.
void MissionWeather (bool use)
proto native void SetDynVolFogDistanceDensity (float value, float time=0)
 Sets the dynamic volumetric fog distance density.
proto native void SetDynVolFogHeightBias (float value, float time=0)
 Sets the 'dynamic' volumetric height bias.
proto native void SetDynVolFogHeightDensity (float value, float time=0)
 Sets the dynamic volumetric fog height density.
proto native void SetRainThresholds (float tMin, float tMax, float tTime)
 Sets overcast threshold values for rain phenomena.
proto native void SetSnowfallThresholds (float tMin, float tMax, float tTime)
 Sets overcast threshold values for snowfall phenomena.
proto native void SetSnowflakeScale (float scale)
 Sets the overall scale of snowflakes during snowfall phenomenon.
proto native void SetStorm (float density, float threshold, float timeOut)
 Sets the thunderstorm properties.
void SetWeatherUpdateFreeze (bool state)
proto native void SetWind (vector wind)
 Sets the wind vector (direction and speed as length of the vector).
proto native void SetWindFunctionParams (float fnMin, float fnMax, float fnSpeed)
 Sets function parameters that controls the wind behaviour (change in time).
proto native void SetWindMaximumSpeed (float maxSpeed)
 Sets the maximal wind speed in metre per second.
proto native void SetWindSpeed (float speed)
 Sets the actual wind speed in metre per second.
proto native void SuppressLightningSimulation (bool state)
 enables/disables thunderbolt simulation on client (together with sounds)

Static Private Member Functions

static proto vector AngleToWindDirection (float angle)
 Returns wind direction from the provided wind angle.
static proto float WindDirectionToAngle (vector dir)
 Returns the xz angle of the provided wind vector.

Detailed Description

Weather controller.

Definition at line 167 of file weather.c.

Constructor & Destructor Documentation

◆ Weather()

void Weather ( )
inlineprivate

Definition at line 172 of file weather.c.

References m_missionWeather.

◆ ~Weather()

void ~Weather ( )
inlineprivate

Definition at line 177 of file weather.c.

Member Function Documentation

◆ AngleToWindDirection()

proto vector AngleToWindDirection ( float angle)
staticprivate

Returns wind direction from the provided wind angle.

Parameters
angleWind angle in the -PI, +PI interval.
Returns
Wind direction vector.

◆ GetDynVolFogDistanceDensity()

proto native float GetDynVolFogDistanceDensity ( )
private

Returns the current 'dynamic' volumetric fog distance density.

◆ GetDynVolFogHeightBias()

proto native float GetDynVolFogHeightBias ( )
private

Returns the current 'dynamic' volumetric fog height bias in meters.

◆ GetDynVolFogHeightDensity()

proto native float GetDynVolFogHeightDensity ( )
private

Returns the current 'dynamic' volumetric fog height density.

◆ GetFog()

proto native Fog GetFog ( )
private

◆ GetMissionWeather()

bool GetMissionWeather ( )
inlineprivate

Definition at line 388 of file weather.c.

References m_missionWeather.

Referenced by WeatherPhenomenon::OnBeforeChange().

◆ GetNoiseReductionByWeather()

◆ GetOvercast()

◆ GetRain()

◆ GetSnowfall()

proto native Snowfall GetSnowfall ( )
private

Returns a snowfall phenomenon object.

Referenced by CollectAndSetEnvironmentData(), and GetNoiseReductionByWeather().

◆ GetSnowflakeScale()

proto native float GetSnowflakeScale ( )
private

Returns the overall scale of snowflakes during snowfall phenomenon.

◆ GetTime()

proto native float GetTime ( )
private

Returns actual time from start of a server (how many seconds elapsed from server start).

◆ GetWeatherUpdateFrozen()

bool GetWeatherUpdateFrozen ( )
inlineprivate

Definition at line 398 of file weather.c.

References m_UpdateFrozen.

Referenced by WeatherPhenomenon::OnBeforeChange().

◆ GetWind()

proto native vector GetWind ( )
private

Returns wind vector (direction and speed as length of the vector).

◆ GetWindDirection()

proto native WindDirection GetWindDirection ( )
private

Returns a wind direction phenomenon object.

Note
Wind direction is angle in radians, typically in the <-PI, +PI> interval.
See also
See Weather.WindDirectionToAngle and Weather.AngleToWindDirection for conversions.

◆ GetWindFunctionParams()

proto void GetWindFunctionParams ( out float fnMin,
out float fnMax,
out float fnSpeed )
private

Reads function parameters that controls the wind behaviour (change in time).

Parameters
fnMinFunction relative minimum (in range <0, 1>).
fnMaxFunction relative maximum (in range <0, 1>).
fnSpeedControls speed of change of function value.

◆ GetWindMagnitude()

proto native WindMagnitude GetWindMagnitude ( )
private

Returns a wind magnitude phenomenon object.

Note
Wind magnitude is the absolute speed in m/s.

Referenced by CollectAndSetEnvironmentData().

◆ GetWindMaximumSpeed()

proto native float GetWindMaximumSpeed ( )
private

Returns maximal wind speed in metre per second.

Note
By default this value is 10 m/s but it can be overridden in script on mission initialization. Equivalent to getting WindMagnitude phenomenon upper limit.

Referenced by WorldData::ComputeSnowflakeScale(), and UIPopupScript::ResetSliders().

◆ GetWindSpeed()

proto native float GetWindSpeed ( )
private

Returns actual wind speed in metre per second.

Note
Wind is changing continuously in time, so the returned value may not stand for too long. Equivalent to WindMagnitude phenomenon actual value.

Referenced by WorldData::ComputeSnowflakeScale(), UIPopupScript::OnOpen(), and UIPopupScript::ResetSliders().

◆ IsDynVolFogEnabled()

proto native bool IsDynVolFogEnabled ( )
private

Dynamic volumetric fog only takes effect if enabled in the world config.

Returns
Whether the dynamic volumetric fog is enabled.

◆ MissionWeather()

void MissionWeather ( bool use)
inlineprivate

Definition at line 383 of file weather.c.

References m_missionWeather.

◆ SetDynVolFogDistanceDensity()

proto native void SetDynVolFogDistanceDensity ( float value,
float time = 0 )
private

Sets the dynamic volumetric fog distance density.

Only takes effect if dynamic volumetric fog is enabled.

Parameters
valueDensity percentage in <0,1> range.
timeTransition time in seconds. (0 for immediate effect)

Referenced by MissionBenchmark::DisableWeatherChange().

◆ SetDynVolFogHeightBias()

proto native void SetDynVolFogHeightBias ( float value,
float time = 0 )
private

Sets the 'dynamic' volumetric height bias.

Takes effect only if enabled via world config.

Parameters
valueHeight offset in meters relative to 0.
timeTransition time in seconds.

Referenced by MissionBenchmark::DisableWeatherChange().

◆ SetDynVolFogHeightDensity()

proto native void SetDynVolFogHeightDensity ( float value,
float time = 0 )
private

Sets the dynamic volumetric fog height density.

Only takes effect if dynamic volumetric fog is enabled.

Parameters
valueDensity percentage in <0,1> range.
timeTransition time in seconds. (0 for immediate effect)

Referenced by MissionBenchmark::DisableWeatherChange().

◆ SetRainThresholds()

proto native void SetRainThresholds ( float tMin,
float tMax,
float tTime )
private

Sets overcast threshold values for rain phenomena.

Rain can start only if actual overcast value is in given range of <tMin, tMax>. If it's already raining and actual overcast value gets out of given range then rain will stop in given tTime seconds.

Default values are: tMin = 0.6 tMax = 1 tTime = 30

Parameters
tMinMinimal overcast value (in range <0, 1>).
tMaxMaximal overcast value (in range <0, 1>).
tTimeTime in seconds when it stops raining.

◆ SetSnowfallThresholds()

proto native void SetSnowfallThresholds ( float tMin,
float tMax,
float tTime )
private

Sets overcast threshold values for snowfall phenomena.

Snowfall can start only if actual overcast value is in given range of <tMin, tMax>. If it's already snowing and actual overcast value gets out of given range then snowfall will stop in given tTime seconds.

Default values are: tMin = 0.6 tMax = 1 tTime = 30

Parameters
tMinMinimal overcast value (in range <0, 1>).
tMaxMaximal overcast value (in range <0, 1>).
tTimeTime in seconds when it stops snowing.

◆ SetSnowflakeScale()

proto native void SetSnowflakeScale ( float scale)
private

Sets the overall scale of snowflakes during snowfall phenomenon.

This value is not synchronized and should be set by deterministic means.

Parameters
scaleScale, 1.0 = default

Referenced by WorldData::UpdateWeatherEffects().

◆ SetStorm()

proto native void SetStorm ( float density,
float threshold,
float timeOut )
private

Sets the thunderstorm properties.

Parameters
densityA value in <0, 1> range where 0 means no thunderstorms at all and 1 means thunderstorm every time it gets cloudy.
thresholdThe overcast value that must be exceeded so that lightning can appear.
timeOutA minimal time in seconds between lightning during thunderstorm.

◆ SetWeatherUpdateFreeze()

void SetWeatherUpdateFreeze ( bool state)
inlineprivate

Definition at line 393 of file weather.c.

References m_UpdateFrozen.

Referenced by MissionBenchmark::DisableWeatherChange().

◆ SetWind()

proto native void SetWind ( vector wind)
private

Sets the wind vector (direction and speed as length of the vector).


Note
Equivalent to setting WindMagnitude and WindDirection phenomenon(s) with zero time and duration.
See also
See Weather.WindDirectionToAngle and Weather.AngleToWindDirection for conversions.
float len = wind.Normalize();
if ( len > 0 )
{
float angle = WindDirectionToAngle( wind );
GetWindMagnitude().Set( len, 0, 0 );
GetWindDirection().Set( angle, 0, 0 );
}
static proto float WindDirectionToAngle(vector dir)
Returns the xz angle of the provided wind vector.
proto native WindMagnitude GetWindMagnitude()
Returns a wind magnitude phenomenon object.
proto native WindDirection GetWindDirection()
Returns a wind direction phenomenon object.
proto native void Set(float forecast, float time=0, float minDuration=0)
Sets the forecast.

◆ SetWindFunctionParams()

proto native void SetWindFunctionParams ( float fnMin,
float fnMax,
float fnSpeed )
private

Sets function parameters that controls the wind behaviour (change in time).

Parameters
fnMinFunction relative minimum (in range <0, 1>).
fnMaxFunction relative maximum (in range <0, 1>).
fnSpeedControls speed of change of function value.

◆ SetWindMaximumSpeed()

proto native void SetWindMaximumSpeed ( float maxSpeed)
private

Sets the maximal wind speed in metre per second.

Equivalent to setting WindMagnitude phenomenon(s) value upper limit.

◆ SetWindSpeed()

proto native void SetWindSpeed ( float speed)
private

Sets the actual wind speed in metre per second.

Note
Wind is changing continuously in time, so the returned value may not stand for too long. Minimum speed for wind is 0.1 m/s. Equivalent to setting WindMagnitude phenomenon(s) with zero time and duration.

Referenced by UIPopupScript::OnClick(), and UIPopupScript::ResetSliders().

◆ SuppressLightningSimulation()

proto native void SuppressLightningSimulation ( bool state)
private

enables/disables thunderbolt simulation on client (together with sounds)

◆ WindDirectionToAngle()

proto float WindDirectionToAngle ( vector dir)
staticprivate

Returns the xz angle of the provided wind vector.

Parameters
dirNon-zero wind vector
Returns
Wind angle in the -PI, +PI interval.

Field Documentation

◆ m_missionWeather

bool m_missionWeather
protected

Definition at line 169 of file weather.c.

Referenced by Weather(), GetMissionWeather(), and MissionWeather().

◆ m_UpdateFrozen

bool m_UpdateFrozen
protected

Definition at line 170 of file weather.c.

Referenced by GetWeatherUpdateFrozen(), and SetWeatherUpdateFreeze().


The documentation for this class was generated from the following file: