This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and 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
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
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.

IG::IRegion Class

Header: #include <plugins/IGInterface.h>

This class is used to manage weather regions for the IG.

Notice
IG plugin must be loaded.

There are two types of weather regions available:

  • Global - weather layers, they represent atmospheric layers, which have no distinct horizontal boundaries. Atmospheric effects are observed anywhere within the vertical range of a layer.
  • Local - weather regions, they have the same set of parameters (visibility, coverage, wind) as weather layers but atmospheric effects for them are restricted to a certain area.

Global meteo conditions are managed via the IMeteo class.

IRegion Class

Members


void refresh( )

Refreshes the weather region according to its current settings. This method should be called after setting weather region's parameters to apply them. Weather change callbacks are called on refresh.

void setWindSpeed( const vec3 & wind_speed )

Sets wind speed vector for the weather region.

Arguments

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

void setWindSpeedEnable( int enable )

Enables or disables taking into account wind speed of this weather region when calculating average values. Weather conditions for overlapping weather regions/layers are combined and average values are calculated for them.

Arguments

  • int enable - 1 to take into account wind speed of this weather region when calculating average values; 0 - to ignore it.

void setVisibilityDistance( float visibility_distance )

Sets visibility distance for the weather region. All atmospheric effects of this region are observed starting from this distance.

Arguments

  • float visibility_distance - Visibility distance for the weather region, in meters.

void setVisibilityDistanceEnable( int enable )

Enables or disables distance-dependent optimization of the weather region. When enabled, atmospheric effects of the region are whithin the distance range determined by the visibility distance.

Arguments

  • int enable - 1 to enable distance-dependent optimization for the weather region; 0 - to disable it.

void setThickness( float thickness )

Sets vertical layer thickness for the weather region. The altitude of the top of the layer is equal to this value plus altitude.

Arguments

  • float thickness - Vertical layer thickness for the weather region, in meters.

float getThickness( )

Returns the current vertical layer thickness for the weather region.

Return value

Current vertical layer thickness for the weather region, in meters.

void setAltitude( double altitude )

Sets altitude of the base (bottom) of the layer of the weather region.

Arguments

  • double altitude - Layer base altitude for the weather region, in meters.

void setSize( const vec2 & size )

Sets the length of the rounded bounding rectangle of the weather region along its X and Y axes (represented by X' and Y' ), respectively.

Notice
This method is not available for weather layers (region type = 0).

Arguments

  • const vec2 & size - Vector with two components representing length (in meters) of the rounded bounding rectangle of the weather region along its X and Y axes respectively.

void setSize( const vec3 & size )

Sets the length of the rounded bounding rectangle of the weather region along its X, Y, and Z axes respectively.
Notice
This method is not available for weather layers (region type = 0).

Arguments

  • const vec3 & size - Vector with three components representing length (in meters) of the rounded bounding rectangle of the weather region along its X, Y, and Z axes respectively.

void setPosition( const Vec2 & pos )

Sets geographic location of the rounded bounding rectangle of the weather region.
Notice
This method is not available for weather layers (region type = 0).

Arguments

  • const Vec2 & pos - Vector with two components representing latitude and longitude of the center of the rounded bounding rectangle of the weather region respectively. The origin of the region’s local coordinate system is at this point.

void setPosition( const Vec3 & pos )

Sets geographic location of the rounded bounding rectangle of the weather region.
Notice
This method is not available for weather layers (region type = 0).

Arguments

  • const Vec3 & pos - Vector with three components representing latitude, longitude, and altitude of the center of the rounded bounding rectangle of the weather region respectively. The origin of the region’s local coordinate system is at this point.

void setType( int type )

Sets the type of the weather region.

Arguments

  • int type - Weather region type, one of the following:
    • 0 - global (atmospheric layers, which have no distinct horizontal boundaries)
    • 1 - local (regional weather with atmospheric effects restricted to a certain area)

void setAltitude( double min_altitude, double max_altitude )

Sets the maximum and the minumum layer altitude for the weather region. This method is an alternative to setting layer's altitude and thickness.

Arguments

  • double min_altitude - Layer base altitude for the weather region, in meters.
  • double max_altitude - Layer top altitude for the weather region, in meters.

void resizeToCloudThickness( )

Sets vertical layer thickness for the weather region in accordance with the cloud layer thickness. Thickness of the cloud layer is defined by the layer height parameter of its cloud material (inherited from the clouds_base).

void setPrecipitationIntensity( float precipitation_intensity )

Sets precipitation intensity for rain and snow. This parameter is determined by aerosol concentraion (concentration of particles suspended in the air).

Arguments

  • float precipitation_intensity - Aerosol concentration, in g/m3.

void setPrecipitationIntensityEnable( int enable )

Enables or disables taking into account precipitation intensity of this weather region when calculating average values. Weather conditions for overlapping weather regions/layers are combined and average values are calculated for them.

Arguments

  • int enable - 1 to take into account precipitation intensity of this weather region when calculating average values; 0 - to ignore it.

void setPrecipitationSize( float precipitation_size )

Sets the size of particles used for precipitation simulation. Precipitation is rendered using a particle system, this method defines the radius of particles.

Arguments

  • float precipitation_size - 1 to take into account precipitation size of this weather region when calculating average values; 0 - to ignore it.

void setPrecipitationSizeEnable( int enable )

Enables or disables taking into account precipitation size of this weather region when calculating average values. Weather conditions for overlapping weather regions/layers are combined and average values are calculated for them.

Arguments

  • int enable - 1 to take into account precipitation size of this weather region when calculating average values; 0 - to ignore it.

void setPrecipitationType( uint64_t precipitation_type )

Sets a bitmask defining types of precipitation for the weather region/layer.

Arguments

  • uint64_t precipitation_type - Integer value used as a bit mask, each bit of which defines whether the corresponding type of precipitation is enabled for the weather region/layer:
    • bit 1 - rain
    • bit 2 - snow
    Specify 0 to disable precipitation, to enable rain and snow specify 0x00000003.
    Notice
    The set of precipitation types can be extended.

void setCloudTypeByEnum( uint64_t enum_type )

Sets cloud type for the weather region.

Arguments

  • uint64_t enum_type - Cloud type, one of the following:
    • 0 - None
    • 1 - Altocumulus
    • 2 - Altostratus
    • 3 - Cirrocumulus
    • 4 - Cirrostratus
    • 5 - Cirrus
    • 6 - Cumulonimbus
    • 7 - Cumulus
    • 8 - Nimbostratus
    • 9 - Stratocumulus
    • 10 - Stratus
    • 11 – 15 - Other

void setCloudDensity( float cloud_density )

Sets cloud density for the weather region/layer. This parameter determines cloud coverage.

Arguments

  • float cloud_density - Cloud density in the [0.0f, 1.0f] range (from minimum to maximum coverage).

float getCloudThickness( )

Returns the current thickness of the cloud layer for the weather region.

Return value

Thickness of the cloud layer for the weather region, in meters.

void setLightning( int lightning )

Enables or disables lightning for the weather region.

Arguments

  • int lightning - 1 to enable lightning for the weather region; 0 - to disable it.

void setEnabled( bool enabled )

Enables or disables the weather region.

Arguments

  • bool enabled - true to enable the weather region; false - to disable it.

bool isEnabled( )

Returns a value indicating if the weather region is currently enabled.

Return value

true if the weather region is currently enabled; otherwise, false.
Last update: 2020-01-14
Build: ()