This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
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
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

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#

ИмяОписание
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.

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: 19.04.2024
Build: ()