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
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::ParticleModifier Class

Header: #include <UnigineObjects.h>

This is a base class for particle system modifiers. These modifiers are used to control how various parameters of particle systems (such as direction, radius, positions, etc.) change over the particle's lifetime.

There are two types of modifiers available:

  • Scalar - used for scalar parameters (radius, velocity, etc.). The majority of particle system modifiers belong to this type.
  • Vector - used for vector parameters (direction, position, etc.)

ParticleModifier Class

枚举

TYPE#

Type of the modifier. Defines the type of value controlled by the modifier.
Name说明/描 述
PARTICLE_MODIFIER_SCALAR = 0In this mode the modifier controls a single scalar value via a single curve.
PARTICLE_MODIFIER_VECTOR = 1In this mode the modifier controls a vector of up to 4 values via a set of curves.

MODE#

Mode of the modifier. Defines how the controlled value is set.
Name说明/描 述
MODE_CONSTANT = 0In this mode the specified value is fixed throughout the lifetime.
MODE_RANDOM_BETWEEN_TWO_CONSTANTS = 1In this mode two constants define the upper and lower limits for the value. The actual value changes randomly over time between these limits.
MODE_CURVE = 2In this mode the modifier controls each value via a single curve.
MODE_RANDOM_BETWEEN_TWO_CURVES = 3In this mode two curves define the upper and lower limits for the value at each point of the lifetime. The actual value changes randomly over time between these limits.
NUM_MODES = 4Number of particle modifier's modes.

Members


bool isSignedValues ( ) const#

Returns a value indicating whether the value(s) controlled by the modifier are signed or unsigned.

Return value

true is the value(s) controlled by the modifier are signed; otherwise, false.

bool saveState ( const Ptr<Stream> & stream ) const#

Saves the current modifier state to the specified stream.

Saving into the stream requires creating a blob to save into. To restore the saved state the restoreState() method is used:

Source code (C++)
// initialize a node and set its state
//...//

// save state
BlobPtr blob_state = Blob::create();
particlemodifier->saveState(blob_state);

// change state
//...//

// restore state
blob_state->seekSet(0);				// returning the carriage to the start of the blob
particlemodifier->restoreState(blob_state);

Arguments

Return value

true if the state is saved successfully; otherwise, false.

bool restoreState ( const Ptr<Stream> & stream ) #

Restores a previously saved state from the specified stream.

Restoring from the stream requires creating a blob to save into and saving the state using the saveState() method:

Source code (C++)
// initialize a node and set its state
//...//

// save state
BlobPtr blob_state = Blob::create();
particlemodifier->saveState(blob_state);

// change state
//...//

// restore state
blob_state->seekSet(0);				// returning the carriage to the start of the blob
particlemodifier->restoreState(blob_state);

Arguments

Return value

true if the state is restored successfully; otherwise, false.

bool save ( const Ptr<Xml> & xml ) const#

Saves the modifier's state to the specified Xml node.

Arguments

Return value

true if the state is saved successfully; otherwise, false.

bool load ( const Ptr<Xml> & xml ) #

Loads a previously saved modifier's state from the specified Xml node.

Arguments

  • const Ptr<Xml> & xml - Xml node from which the modifier's state is to be loaded.

Return value

true if the state is loaded successfully; otherwise, false.

long long getSystemMemoryUsage ( ) const#

Returns the total amount of memory used by the modifier.

Return value

Total amount of memory used by the modifier with all its keys, in bytes.

ParticleModifier::TYPE getType ( ) const#

Returns the type of the particle modifier.

Return value

Particle modifier type. One of the TYPE enum values.

void setMode ( ParticleModifier::MODE mode ) #

Sets the mode of the particle modifier. The mode defines how the controlled value is set. You can switch modes at any time.

Arguments

ParticleModifier::MODE getMode ( ) const#

Returns the current mode of the particle modifier. The mode defines how the controlled value is set. You can switch modes at any time.

Return value

Current particle modifier mode. One of the MODE enum values.
Last update: 2021-02-03
Build: ()