This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Настройка свойств
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World Objects
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
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
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::Plugins::IG::Meteo 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 class is used to manage global meteo conditions for the IG (visibility range, wind speed and direction).

Notice
IG plugin must be loaded.

Meteo Class

Members


void refresh ( ) #

Refreshes global meteo conditions according to current settings. This method should be called after setting global meteo conditions to apply them. Weather change callbacks are called on refresh.

Region * getRegion ( int64_t id, bool auto_create ) #

Returns the interface of a weather region/layer by its identifier. If no weather region/layer with such id exists, it will be created.

Arguments

  • int64_t id - Weather region identifier .
  • bool auto_create - true to automatically create the region with the specified ID if it doesn't exist yet; false - to return nullptr in case the region doesn't exist.

Return value

Weather region interface if it exists; otherwise - nullptr.

Vector < IG::Region * > getRegions ( ) const#

Returns the list of all weather regions/layers.

void removeRegion ( int64_t id ) #

Removes a weather region/layer with a given identifier.

Arguments

  • int64_t id - Identifier of the weather region/layer to be removed .

void clearRegions ( ) #

Removes all weather regions and layers.

vec3 getMeanWindSpeed ( const dvec3 & world_pos ) #

Returns an average wind speed at the specified geographic location. This method combines wind parameter of all weather regions and layers affecting this point.

Arguments

  • const dvec3 & world_pos - Geographic coordinates of a point (lat, lon, alt), for which an average wind speed and direction are to be calculated.

Return value

Vector defining average wind speed (in meters per second) in all directions for the given location.

void setWindSpeed ( const vec3 & wind_speed ) #

Sets the global wind speed and direction.

Arguments

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

void setVisibilityDistance ( float visibility_distance ) #

Sets the global visibility range through the atmosphere.

Arguments

  • float visibility_distance - Global visibility range, in meters.

void setMaxPrecipitationAltitude ( double max_precipitation_altitude ) #

Sets the upper height limit for precipitation. There is no precipitation observed above this level.

Arguments

  • double max_precipitation_altitude - Upper height limit for precipitation, in meters.

double getMaxPrecipitationAltitude ( ) const#

Returns the current upper height limit for precipitation. There is no precipitation observed above this level.

Return value

Current upper height limit for precipitation, in meters.

double getLowerCloudAltitude ( ) const#

Returns the current lower altitude for clouds.

Return value

Lower altitude for clouds, in meters.

void setCloudsOptimization ( bool enable ) #

Enables or disables simplified rendering mode for clouds.
Notice
When clouds are viewed from the ground (at significant distance) and the viewer's velocity is less than 200 units per second, enabling this parameter can provide a significant gain in performance.

Arguments

  • bool enable - true to enable simplified rendering for clouds; false - to disable it.

void setCloudsOptimizationDistance ( double interleave_1, double interleave_2 ) #

Sets the distances for dynamic switching of the clouds Interleaved Rendering mode.

Arguments

void setVisibilityTransitionTime ( float time ) #

Sets the time period for gradual change of visibility range.
Notice
This parameter can also be specified via the configuration file (ig_config.xml).

Arguments

  • float time - Time, in seconds, for gradual change of visibility range.

void setPrecipitationsTransitionTime ( float time ) #

Sets the time period for gradual change of precipitation.
Notice
This parameter can also be specified via the configuration file (ig_config.xml).

Arguments

  • float time - Time, in seconds, for gradual change of precipitation.

void setCloudTransitionTime ( float time ) #

Sets the time period for gradual change of cloudiness.
Notice
This parameter can also be specified via the configuration file (ig_config.xml).

Arguments

  • float time - Time, in seconds, for gradual change of cloudiness.

void addCallbackMeteoChanged ( void * subscriber, CallbackBase * callback ) #

Adds a callback on changing global meteo conditions.
Source code (C++)
/// callback function to be called when weather conditions change
void SomeClass::my_weather_callback()
{
	// setting orientation of the vane downwind
	vec3 wind_direction = ig_manager->getMeteo()->getMeanWindSpeed(vane_node->getWorldPosition());
	vane_node->setWorldDirection(wind_direction, vec3_up);
}

// ...
// somewhere in code
void SomeClass::init()
{
	// adding "my_weather_callback" to be called on changing weather conditions
	ig_manager->getMeteo()->addCallbackMeteoChanged(this, Unigine::MakeCallback(this, &SomeClass::my_weather_callback );
}

Arguments

  • void * subscriber - Callback subscriber ID. This ID can be used to remove this callback when necessary.
  • CallbackBase * callback - Callback pointer.

void removeCallbackMeteoChanged ( void * subscriber ) #

Removes a callback on changing global meteo conditions for the specified subscriber.

Arguments

  • void * subscriber - Callback subscriber ID specified when adding it.
Last update: 29.04.2021
Build: ()