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
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
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


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: 2021-02-17
Build: ()