This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
Tutorials

Unigine::Plugins::IG::WeatherLayerPrecipitation 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/Unigine/IG/UnigineIG.h>
Inherits from: WeatherLayer

This class is used to represent a precipitation layer within a weather region. It enables you to define the type of precipitation (rain, snow, etc.), a node (ObjectParticles) to be used to visualize the precipitation effect, and manage the size of particles representing snowflakes or droplets.

WeatherLayerPrecipitation Class

Members


Ptr<Node> getEffectNode ( ) const#

Returns the node used to visualize the precipitation effect.

Return value

Node representing the precipitation effect in the world.

void setPrecipitationType ( int type ) #

Sets a value defining the type of the weather precipitation layer.

Arguments

  • int type - Integer value that defines the type of precipitation enabled for the weather layer:
    • 0 - disable precipitation
    • 1 - rain
    • 2 - snow
    Notice
    The set of precipitation types can be extended.

int getPrecipitationType ( ) const#

Returns a value defining the type of the weather precipitation layer.

Return value

Integer value that defines the type of precipitation enabled for the weather layer:
  • 0 - disable precipitation
  • 1 - rain
  • 2 - snow
Notice
The set of precipitation types can be extended.

void setParticlesSize ( float size ) #

Sets the size of particles used to visualize the precipitation effect (snowflakes, droplets, etc.).

Arguments

  • float size - New particle size, in units.

float getParticlesSize ( ) const#

Returns the current size of particles used to visualize the precipitation effect (snowflakes, droplets, etc.).

Return value

Particle size, in units.

void setParticlesSizeSmoothBySpeed ( float unit_per_sec ) #

Sets the mode of smooth gradual change of the particles size by the specified rate (in units per second). The particles size changes gradually from the current to target value by the specified value during each second, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). This method fits best when the difference between the target and current value is either too big (e.g. visibility distance change from 10m to 1km) or too small (e.g. from 1m to 1.05m), avoiding too fast or too slow changes. For other cases you can also choose another mode "by time" to change the value from the current to target during the specified time interval via the setParticlesSizeSmoothByTime().

Arguments

  • float unit_per_sec - Constant rate (in units per second) with which the value gradually changes from the current to target.

void setParticlesSizeSmoothByTime ( float sec ) #

Sets the mode of smooth gradual change of the particles size by the specified time interval. The particles size changes gradually from the current to target value during this interval, such smoothing is performed to make changes more realistic. Moreover, each value can be changed with its own rate (the rain starting fast with a slowly changing cloud coverage). When the value of 0 is set, the value changes instantly. If the difference between the target and current value is too big (e.g. visibility distance change from 10m to 1km), the changes in this mode may be too fast and too noticeable, or on the contrary they might be too slow if the difference is too small (e.g. from 1m to 1.05m). In this case you can choose another mode to change the value with a specified rate via the setParticlesSizeSmoothBySpeed().

Arguments

  • float sec - Time interval (in seconds) during which the value changes from the current to target.
Last update: 2023-03-15
Build: ()