PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
Weather Class Reference

Private Member Functions

private void Weather ()
 
private void ~Weather ()
 
proto native float GetTime ()
 Returns actual time from start of a server (how many seconds elapsed from server start).
 
proto native Overcast GetOvercast ()
 Returns an overcast phenomenon object.
 
proto native Fog GetFog ()
 Returns a fog phenomenon object.
 
proto native Rain GetRain ()
 Returns a rain phenomenon object.
 
proto native Snowfall GetSnowfall ()
 Returns a snowfall phenomenon object.
 
proto native WindDirection GetWindDirection ()
 Returns a wind direction phenomenon object.
 
proto native WindMagnitude GetWindMagnitude ()
 Returns a wind magnitude phenomenon object.
 
proto native void SetStorm (float density, float threshold, float timeOut)
 Sets the thunderstorm properties.
 
proto native void SuppressLightningSimulation (bool state)
 enables/disables thunderbolt simulation on client (together with sounds)
 
proto native vector GetWind ()
 Returns wind vector (direction and speed as length of the vector).
 
proto native void SetWind (vector wind)
 Sets the wind vector (direction and speed as length of the vector).

 
proto native float GetWindSpeed ()
 Returns actual wind speed in metre per second.
 
proto native void SetWindSpeed (float speed)
 Sets the actual wind speed in metre per second.
 
proto native float GetWindMaximumSpeed ()
 Returns maximal wind speed in metre per second.
 
proto native void SetWindMaximumSpeed (float maxSpeed)
 Sets the maximal wind speed in metre per second. Equivalent to setting WindMagnitude phenomenon(s) value upper limit.
 
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 void SetWindFunctionParams (float fnMin, float fnMax, float fnSpeed)
 Sets function parameters that controls the wind behaviour (change in time).
 
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. This value is not synchronized and should be set by deterministic means.
 
proto native float GetSnowflakeScale ()
 Returns the overall scale of snowflakes during snowfall phenomenon.
 
proto native bool IsDynVolFogEnabled ()
 Dynamic volumetric fog only takes effect if enabled in the world config.
 
proto native void SetDynVolFogDistanceDensity (float value, float time=0)
 Sets the dynamic volumetric fog distance density. Only takes effect if dynamic volumetric fog is enabled.
 
proto native float GetDynVolFogDistanceDensity ()
 Returns the current 'dynamic' volumetric fog distance density.
 
proto native void SetDynVolFogHeightDensity (float value, float time=0)
 Sets the dynamic volumetric fog height density. Only takes effect if dynamic volumetric fog is enabled.
 
proto native float GetDynVolFogHeightDensity ()
 Returns the current 'dynamic' volumetric fog height density.
 
proto native void SetDynVolFogHeightBias (float value, float time=0)
 Sets the 'dynamic' volumetric height bias. Takes effect only if enabled via world config.
 
proto native float GetDynVolFogHeightBias ()
 Returns the current 'dynamic' volumetric fog height bias in meters.
 
void MissionWeather (bool use)
 
bool GetMissionWeather ()
 
void SetWeatherUpdateFreeze (bool state)
 
bool GetWeatherUpdateFrozen ()
 
float GetNoiseReductionByWeather ()
 

Static Private Member Functions

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

Private Attributes

protected bool m_missionWeather
 
protected bool m_UpdateFrozen
 

Detailed Description

Weather controller

Constructor & Destructor Documentation

◆ Weather()

private void Weather ( )
inlineprivate

References m_missionWeather.

◆ ~Weather()

private void ~Weather ( )
inlineprivate

Member Function Documentation

◆ AngleToWindDirection()

static 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.

Referenced by InitValues(), and UpdateWeatherValues().

◆ GetDynVolFogHeightBias()

proto native float GetDynVolFogHeightBias ( )
private

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

Referenced by WorldData::CalculateVolFog(), EnochData::CalculateVolFog(), InitValues(), UpdateWeatherValues(), and WorldData::WeatherOnBeforeChange().

◆ GetDynVolFogHeightDensity()

proto native float GetDynVolFogHeightDensity ( )
private

Returns the current 'dynamic' volumetric fog height density.

Referenced by InitValues(), and UpdateWeatherValues().

◆ GetFog()

◆ GetMissionWeather()

bool GetMissionWeather ( )
inlineprivate

◆ GetNoiseReductionByWeather()

◆ GetOvercast()

◆ GetRain()

◆ GetSnowfall()

◆ 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

◆ 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.

Referenced by InitValues(), CGame::OnRPC(), UpdateWeatherValues(), WorldData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange(), and SakhalData::WeatherOnBeforeChange().

◆ 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

◆ 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::CalculateVolFog(), EnochData::CalculateVolFog(), SakhalData::CalculateVolFog(), WorldData::ComputeSnowflakeScale(), IsWindy(), UIPopupScript::OnChange(), 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(), WorldData::Init(), EnochData::Init(), SakhalData::Init(), IsWindy(), UIPopupScript::OnOpen(), UIPopupScript::ResetSliders(), and SakhalData::WeatherOnBeforeChange().

◆ 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

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 WorldData::CalculateVolFog(), EnochData::CalculateVolFog(), SakhalData::CalculateVolFog(), MissionBenchmark::DisableWeatherChange(), and CGame::OnRPC().

◆ 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 WorldData::CalculateVolFog(), EnochData::CalculateVolFog(), MissionBenchmark::DisableWeatherChange(), WorldData::Init(), EnochData::Init(), SakhalData::Init(), CGame::OnRPC(), and WorldData::WeatherOnBeforeChange().

◆ 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 WorldData::CalculateVolFog(), EnochData::CalculateVolFog(), MissionBenchmark::DisableWeatherChange(), SakhalData::Init(), and CGame::OnRPC().

◆ 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.

Referenced by WorldData::WeatherOnBeforeChange(), and EnochData::WeatherOnBeforeChange().

◆ 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.

Referenced by SakhalData::WeatherOnBeforeChange().

◆ 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.

Referenced by DayZIntroScene::DayZIntroScene(), WorldData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange(), and SakhalData::WeatherOnBeforeChange().

◆ SetWeatherUpdateFreeze()

void SetWeatherUpdateFreeze ( bool  state)
inlineprivate

◆ 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.

Referenced by DayZIntroScene::DayZIntroScene().

◆ 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.

Referenced by DayZIntroScene::DayZIntroScene(), WorldData::WeatherOnBeforeChange(), EnochData::WeatherOnBeforeChange(), and SakhalData::WeatherOnBeforeChange().

◆ 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 DayZIntroScene::DayZIntroScene(), UIPopupScript::OnChange(), UIPopupScript::OnClick(), UIPopupScript::ResetSliders(), and SceneData::SetInitWindForce().

◆ SuppressLightningSimulation()

proto native void SuppressLightningSimulation ( bool  state)
private

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

Referenced by OnUndergroundPresenceUpdate(), and ~UndergroundHandlerClient().

◆ WindDirectionToAngle()

static 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

protected bool m_missionWeather
private

◆ m_UpdateFrozen

protected bool m_UpdateFrozen
private

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