This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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 Optimization
Materials
Art Samples
Tutorials

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


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.

bool removeRegion ( int64_t id ) #

Removes a weather region with a given identifier.

Arguments

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

Return value

true if a region with a given identifier is removed successfully; otherwise, false.

void clearRegions ( ) #

Removes all weather regions and layers.

vec3 getMeanWindSpeed ( const Vec3& world_pos ) const#

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 Vec3& 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 * addOnMeteoChangedCallback ( 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()->addOnMeteoChangedCallback(this, Unigine::MakeCallback(this, &SomeClass::my_weather_callback );
}

Arguments

Return value

Callback subscriber ID. This ID can be used to remove this callback when necessary.

void removeOnMeteoChangedCallback ( void * subscriber ) #

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

Arguments

  • void * subscriber - Callback subscriber ID specified when adding it.

Region * getGlobalRegion ( ) #

Returns the main global weather region.

Return value

Main global weather region.

MeteoCameraEffects * getCameraEffects ( ) #

Returns the camera effects instance used to create dynamic effects for precipitation rendering when changing camera position and speed.

Return value

Returns the camera effects instance.

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

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

Arguments

  • const Vec3& geo_pos - Geocoordinates of the point for which all affecting layers of all regions 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).
Last update: 2021-09-29
Build: ()