This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
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
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
Art Samples
Tutorials

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.
Header: #include <plugins/UnigineIG.h>

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

Members


int64_t getID ( ) const#

Returns the ID of the weather layer.

Return value

ID of the weather layer.

int64_t getRegionID ( ) const#

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

Return value

ID of the weather region to which the layer belongs.

WeatherLayerType getType ( ) const#

Returns the type of the weather layer.

Return value

Weather layer type, one of the following values:
  • Plugins::IG::WeatherLayerType::LAYER_BASE - base layer.
  • Plugins::IG::WeatherLayerType::LAYER_CLOUD - cloud layer.
  • Plugins::IG::WeatherLayerType::LAYER_PRECIPITATION - precipitation layer.

void setEnabled ( bool v ) #

Sets a value indicating if the weather layer is enabled. The layer change callback is called.

Arguments

  • bool v - true to enable the weather layer, false - to disable it.

bool isEnabled ( ) const#

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

Return value

true if the layer and the region it belongs to are both enabled; otherwise, false.

bool isEnabledSelf ( ) const#

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

Return value

true if the layer itself is enabled; otherwise, false.

bool isGlobal ( ) const#

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

Return value

true if the weather layer is global (has no distinct horizontal boundaries); false - atmospheric effects of the layer are restricted to a certain area.

void setElevation ( double value ) #

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

Arguments

  • double value - New base altitude for the weather layer, in meters.

double getElevation ( ) const#

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

Return value

Current base altitude for the weather layer, in meters.

void setThickness ( double value ) #

Sets the thickness of the weather layer.

Arguments

  • double value - New thickness of the weather layer, in meters.

double getThickness ( ) const#

Returns the current thickness of the weather layer.

Return value

Current thickness of the weather layer, in meters.

void setVerticalTransition ( const vec2& value ) #

Sets new 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.

Arguments

  • const vec2& value - Vector containing new vertical sizes (widths in meters) of transition areas at the bottom and the top of the layer (bottom_width, top_width).

const vec2 & getVerticalTransition ( ) const#

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

Return value

Vector containing the current vertical sizes (widths in meters) of transition areas at the bottom and the top of the layer (bottom_width, top_width).

void setWind ( const vec3& value ) #

Sets the wind speed and direction for the weather layer.

Arguments

  • const vec3& value - Vector defining wind speed in all directions, in meters per second.

const vec3 & getWind ( ) const#

Returns the current wind speed and direction for the weather layer.

Return value

Vector defining new wind speed in all directions, in meters per second.

void setCoverage ( float value ) #

Sets the cloud coverage intensity value for the weater layer.

Arguments

  • float value - Current cloud coverage intensity value for the weater layer, in the [0; 1] range (from zero to maximum cloudiness).

float getCoverage ( ) const#

Returns the current cloud coverage intensity value for the weater layer.

Return value

Current cloud coverage intensity value for the weater layer, in the [0; 1] range (from zero to maximum cloudiness).

void setVisibility ( float value ) #

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

Arguments

  • float value - New visibility range within the weather layer, in meters.

float getVisibility ( ) const#

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

Return value

Visibility range within the weather layer, in meters.

void setHumidity ( float value ) #

Sets the humidity value for the weather layer.

Arguments

  • float value - New humidity value for the weather layer, in %.

float getHumidity ( ) const#

Returns the current humidity value for the weather layer.

Return value

Current humidity value for the weather layer, in %.

void setTemperature ( float value ) #

Sets the temperature value for the weather layer.

Arguments

  • float value - New temperature value to be set, in degrees Celcius.

float getTemperature ( ) const#

Returns the current temperature value for the weather layer.

Return value

Current temperature value, in degrees Celcius.

void setBarometric ( float value ) #

Sets the barometric pressure value for the weather layer.

Arguments

  • float value - New barometric pressure value to be set, in mmHg.

float getBarometric ( ) const#

Returns the current barometric pressure value for the weather layer.

Return value

Current barometric pressure value, in mmHg.

void setLightning ( float freq ) #

Sets a new lightning frequency value for the weather layer. This value defines how often the lightning is observed.

Arguments

  • float freq - Lightning frequency within the [0; 1] range. By the value of 0 there'll be no lighting at all, while 1 - corresponds to maximum frequency.

float getLigtning ( ) const#

Returns the current lightning frequency value for the weather layer. This value defines how often the lightning is observed.

Return value

Lightning frequency within the [0; 1] range. By the value of 0 there is no lighting at all, while 1 - corresponds to maximum frequency.

float getImpact ( double altitude ) const#

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

float getDensity ( const Vec3& world_pos ) const#

Returns the current density of clouds/precipitation intensity at the specified point. This method can be used to implement a meteoradar.

Arguments

  • const Vec3& world_pos - Coordinates of the point at which the density of clouds or precipitation intensity is to be obtained.

Return value

Density of clouds for a cloud layer or precipitation intensity for a precipitation layer.
Last update: 2021-09-29
Build: ()