This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.Plugins.IG.WeatherLayer Class

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Sim SDK edition to use it.

This is a base class for weather layers. Layers comprise a vertical profile of the weather region. Different cloud or precipitation layers may exist at various heights. There are three types of layers available:

WeatherLayer Class

Enums

WEATHER_LAYER_TYPE#

NameDescription
BASE = 0Base Layer - layer with no visual representation, it defines weather parameters such as visibility range, temperature, humidity.
CLOUD = 1Cloud Layer - layer that controls clouds within the region (via the WeatherLayerCloud class).
PRECIPITATION = 2Precipitation Layer - layer that controls precipitation within the region (via the WeatherLayerPrecipitation class).

Properties

float Lightning#

The lightning frequency value for the weather layer. This value defines how often the lightning is observed. By the value of 0 there is no lighting at all, while 1 - corresponds to maximum frequency.

Range of values: [0.0f, 1.0f]. The default value is 0.0f.

float Barometric#

The barometric pressure value for the weather layer.

float Temperature#

The temperature value for the weather layer.

float Humidity#

The humidity value for the weather layer.

float Visibility#

The visibility range within the weather layer. Objects beyond this range are not visible inside the layer.

float Coverage#

The cloud coverage intensity value for the weater layer.

Range of values: [0.0f, 1.0f]. The default value is 0.0f.

vec3 Wind#

The wind speed and direction for the weather layer.

vec2 VerticalTransition#

The vertical sizes of transition areas at the bottom and the top of the weather layer. The effects of the layer fade out gradually within these areas downwards and upwards.

double Thickness#

The thickness of the weather layer.

double Elevation#

The base altitude for the weather layer above the sea level (distance from the sea level to the lower border of the layer).

bool IsGlobal#

The a value indicating whether the weather layer is global (has no distinct horizontal boundaries) or not.

bool IsEnabledSelf#

The a value indicating if the weather layer itself is enabled. Use isEnabled() to check whether the region this layer belongs to is enabled as well.

bool Enabled#

The a value indicating if the weather layer and the region it belongs to are enabled.

WeatherLayer.WEATHER_LAYER_TYPE LayerType#

The type of the weather layer.

long RegionID#

The ID of the weather region to which the layer belongs.

long ID#

The ID of the weather layer.

Members


void SetElevationSmoothBySpeed ( double unit_per_sec ) #

Sets the mode of smooth gradual change of the weather layer elevation by the specified rate (in units per second). The weather layer elevation changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setElevationSmoothByTime().

Arguments

  • double unit_per_sec - Constant rate (in units per second) with which the value gradually changes from the current to target.

void SetElevationSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the weather layer elevation by the specified time interval. The weather layer elevation changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setElevationSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetThicknessSmoothBySpeed ( double unit_per_sec ) #

Sets the mode of smooth gradual change of the weather layer thickness by the specified rate (in units per second). The weather layer thickness changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setThicknessSmoothByTime().

Arguments

  • double unit_per_sec - Constant rate (in units per second) with which the value gradually changes from the current to target.

void SetThicknessSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the weather layer thickness by the specified time interval. The weather layer thickness changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setThicknessSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetVerticalTransitionSmoothBySpeed ( vec2 unit_per_sec ) #

Sets the mode of smooth gradual change of transition areas at the bottom and the top of the weather layer by the specified rate (in units per second). The transition areas at the bottom and the top of the weather layer in all directions changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setVerticalTransitionSmoothByTime().

Arguments

  • vec2 unit_per_sec - Constant rate (in units per second) with which the value gradually changes from the current to target. Vector components specify rates for transition areas at the bottom and the top of the layer (bottom_width, top_width).

void SetVerticalTransitionSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the sizes of transition areas at the bottom and the top of the weather layer by the specified time interval. The sizes of transition areas at the bottom and the top of the weather layer change gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setVerticalTransitionSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetWindSmoothBySpeed ( vec3 unit_per_sec ) #

Sets the mode of smooth gradual change of the wind speed in all directions by the specified rate (in units per second). The wind speed in all directions changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setWindSmoothByTime().

Arguments

  • vec3 unit_per_sec - Constant rate (in units per second) with which the value gradually changes from the current to target (each vector component specifies the rate for the corresponding coordinate).

void SetWindSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the wind speed in all directions by the specified time interval. The wind speed in all directions changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setWindSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetCoverageSmoothBySpeed ( float unit_per_sec ) #

Sets the mode of smooth gradual change of the cloud coverage intensity by the specified rate (in units per second). The cloud coverage intensity changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setCoverageSmoothByTime().

Arguments

  • float unit_per_sec - Constant rate (in units per second) with which the value gradually changes from the current to target.

void SetCoverageSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the cloud coverage intensity by the specified time interval. The cloud coverage intensity changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setCoverageSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetVisibilitySmoothBySpeed ( float unit_per_sec ) #

Sets the mode of smooth gradual change of the visibility by the specified rate (in units per second). The visibility changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setVisibilitySmoothByTime().

Arguments

  • float unit_per_sec - Constant rate (in units per second) with which the value gradually changes from the current to target.

void SetVisibilitySmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the visibility by the specified time interval. The visibility changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setVisibilitySmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetHumiditySmoothBySpeed ( float unit_per_sec ) #

Sets the mode of smooth gradual change of the humidity by the specified rate (in % per second). The humidity changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setHumiditySmoothByTime().

Arguments

  • float unit_per_sec - Constant rate (in % per second) with which the value gradually changes from the current to target.

void SetHumiditySmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the humidity by the specified time interval. The humidity changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setHumiditySmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetTemperatureSmoothBySpeed ( float unit_per_sec ) #

Sets the mode of smooth gradual change of the temperature by the specified rate (in degrees Celcius per second). The temperature changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setTemperatureSmoothByTime().

Arguments

  • float unit_per_sec - Constant rate (in degrees Celcius per second) with which the value gradually changes from the current to target.

void SetTemperatureSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the temperature by the specified time interval. The temperature changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setTemperatureSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

void SetBarometricSmoothBySpeed ( float unit_per_sec ) #

Sets the mode of smooth gradual change of the barometric pressure by the specified rate (in mmHg per second). The barometric pressure changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setBarometricSmoothByTime().

Arguments

  • float unit_per_sec - Constant rate (in mmHg per second) with which the value gradually changes from the current to target.

void SetBarometricSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the barometric pressure by the specified time interval. The barometric pressure changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setBarometricSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.

float GetImpact ( double altitude ) #

Returns a value indicating the degree of impact of the layer at the specified altitude depending on whether it is completely inside, outside, or somewhere within the transition area.

Arguments

  • double altitude - Altitude value to be checked.

Return value

Value indicating the degree of impact of the layer at the specified altitude:
  • 0 - completely outside the layer (and transition area)
  • 1 - inside the layer
  • (0 < x < 1) - within the transition area
Last update: 2022-12-14
Build: ()