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.Region 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 class is used to manage weather regions for the IG. Each region contains one or multiple layers each comprising a vertical profile. The main layer always exists in the region and cannot be deleted. It is a base layer used to define weather parameters for the region, such as visibility range, temperature, humidity, etc.

Notice
IG plugin must be loaded.

There are three types of weather regions available:

  • Global - representing atmospheric layers, which have no distinct horizontal boundaries. Atmospheric effects are observed anywhere within the vertical range.
  • Local Rectangle - they have the same set of parameters (visibility, coverage, wind) as Global ones but atmospheric effects for them are restricted to a certain area defined by a rectangle.
  • Local Polygon - they have the same set of parameters (visibility, coverage, wind) as Global ones but atmospheric effects for them are restricted to a certain area defined by a polygon.

Global meteo conditions are managed via the Meteo class.

Region Class

Enums

REGION_TYPE#

NameDescription
GLOBAL = 0Global region type (atmospheric layers, which have no distinct horizontal boundaries).
RECTANGLE = 1Local rectangle region type: regional weather with atmospheric effects restricted to a certain area defined by a rectangle.
POLYGON = 2Local polygon region type: regional weather with atmospheric effects restricted to a certain area defined by a polygon.

Properties

float Rotation#

The angle of rotation of the weather region around the Z axis.

dvec2 WorldPosition#

The world coordinates of the weather region's position.

double TransitionSize#

The width of the transition area around the borders of the weather region. The effects of the region fade out gradually within this area.

double ShapeRectangleRadius#

The corner radius of the rectangle. This parameter defines the shape of a rounded rectangle.

dvec2 ShapeSize#

The size of the rectangle that defines or encloses the shape of the weather region as a two-component vector.

int NumLayers#

The total number of layers of the region.

WeatherLayer MainLayer#

The main weather layer of the region. It is a base layer, that is used to define weather parameters, such as visibility range, temperature, humidity, etc. The main layer always exists in the region and cannot be deleted.

bool Enabled#

The value indicating if the weather region is currently enabled.

long ID#

The ID of the region.

Members


WeatherLayer * CreateLayer ( long layer_id, WeatherLayerType type ) #

Creates a new weather layer for the region. In case a layer with the specified ID exists and has a different type, it will be replaced with the new one.

Arguments

  • long layer_id - ID of the layer to be created.
  • WeatherLayerType type - Type of the layer to be created, 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.

Return value

New weather layer if it is created successfully; otherwise, nullptr.

WeatherLayer GetLayer ( long layer_id ) #

Returns a weather layer by its ID.

Arguments

  • long layer_id - Weather layer ID.

Return value

Weather layer with the specified ID if it exists, otherwise nullptr.

bool RemoveLayer ( long layer_id ) #

Removes a weather layer with the specified ID.

Arguments

  • long layer_id - Weather layer ID.

Return value

true if the weather layer is created successfully; otherwise, false.

void findWeatherLayers ( vec3 geo_pos, Vector<MeteoPositionParam>& vector ) #

Returns the list of all layers (base, clouds, precipitation) of the weather region containing the specified position (and thus affecting it) along with their corresponding impact factors (as MeteoPositionParam structure).

Arguments

  • vec3 geo_pos - Geocoordinates of the point for which all affecting layers are to be found.
  • Vector<MeteoPositionParam>& vector - The list of all layers in the weather region containing the specified position (and thus affecting it) along with their corresponding impact factors (as MeteoPositionParam structure).

bool SetShapeAsRectangle ( dvec2 size, double corner_radius = 0 ) #

Sets the shape of a rectangle weather region using the specified width, height, and corner radius.

Arguments

  • dvec2 size - Vector combining width and height of the rectangle, in units (W, H).
  • double corner_radius - Corner radius of the rectangle, in units. This parameter enables you to create a rounded rectangle.
    Notice
    This value cannot be greater than half size.

Return value

true if the shape of the region is set successfully; otherwise, false.

bool SetShapeAsPolygon ( vec2[] points, ushort[] indices ) #

Sets the shape of a polygon weather region using the specified sets of vertex coordinates and their indices.

Arguments

  • vec2[] points - Array of polygon vertex coordinates.
  • ushort[] indices - Array of vertex indices defining a polygon.

Return value

true if the shape of the region is set successfully; otherwise, false.

bool SetShapeAsPolygon ( dvec2[] geo_points ) #

Sets the shape of a polygon weather region as a set of geocoordinates of points.

Arguments

  • dvec2[] geo_points - Array of geocoordinates of points forming a polygon.

Return value

true if the shape of the region is set successfully; otherwise, false.

void SetGeoPosition ( dvec2 geo_pos ) #

Sets new geocoordinates for the weather region's position.

Arguments

  • dvec2 geo_pos - Geocoordinates of the weather region's position (Lat, Lon).

float GetImpact ( dvec2 world_pos ) #

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

Arguments

  • dvec2 world_pos - World coordinates (Cartesian) of the point to be ckecked.

Return value

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