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
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.BodyParticles Class

Inherits from: Body

BodyParticles is a base class for BodyCloth and BodyRope classes. It uses a mass-spring simulation model, i.e. particles that are connected by inner joints. The particles are of sphere shape and characterized by a position, mass and velocity. The total mass of the whole cloth is distributed among them. Particles can be acted upon by a force or an impulse. The inner joints can be stretched (linear and angular separately), or linear joints can also be scaled, which provides the same stretching effect. When stretched to the specified distance, joins are torn (the distance is set separately for linear and angular joints).

See Also#

BodyParticles Class

枚举

ITERATIONS_MODE#

Iterations mode. Determines the way the number of iterations for solving the constraints of the particles body is calculated.
Name说明/描 述
OVERRIDE = 0In this mode the resulting number of iterations is equal to the Iterations value set for the body.
MULTIPLICATION = 1In this mode the resulting number of iterations is equal to the value set for the body multiplied by the global physics iterations number.

Properties

int NumParticles#

The total number of particles that constitute the body.

float Rigidity#

The current rigidity of the body's inner joints movement, i.e. how much interpolated linear and angular velocities of all joints affect velocities of each separate joint.

float Restitution#

The current restitution of the body by bouncing.

float Radius#

The current radius of the particles forming the body and represented as sphere shapes.

int NumIterations#

The current number of iterations used to solve inner joints between particles.

float Mass#

The current mass of the body.

float LinearThreshold#

The current linear stretching of the body's inner joints. when passing this threshold, the joints tear up.

float LinearStretch#

The current scale for the length of linear joints (relative the source mesh topology).

float LinearRestitution#

The current restitution of the body's inner joints by linear stretching.

float LinearDamping#

The A value indicating how much the linear velocity of the particles decreases over time.

float Friction#

The current friction of the body by its contact with other surfaces.

float Distance#

The current distance of body simulation.

int Collision#

The A value indicating if collision with a body is enabled or not.

int CollisionMask#

The A collision bit mask for the body. two objects collide, if they both have matching masks.

float AngularThreshold#

The current threshold for angular folding of particles triangles connected by inner joints. when passing this threshold, the joints tear up.

float AngularRestitution#

The current restitution of the body's inner joints, when triangles formed by particles are folded angularly relative to each other.

BodyParticles.ITERATIONS_MODE IterationsMode#

The Current iteration mode of the particles body:

Members


void SetParticleMass ( int num, float mass ) #

Sets the mass for the specified particle.

Arguments

  • int num - Particle number.
  • float mass - Particle mass.

float GetParticleMass ( int num ) #

Returns the current mass of the specified particle.

Arguments

  • int num - Particle number.

Return value

Particle mass.

void SetParticlePosition ( int num, vec3 position ) #

Sets the position of the specified body's particle.

Arguments

  • int num - Particle number.
  • vec3 position - Particle position in world coordinates.

vec3 GetParticlePosition ( int num ) #

Returns the current position of the specified particle.

Arguments

  • int num - Particle number.

Return value

Particle position in world coordinates.

void SetParticleVelocity ( int num, vec3 velocity ) #

Sets the velocity of the specified particle.

Arguments

  • int num - Particle number.
  • vec3 velocity - Particle velocity.

vec3 GetParticleVelocity ( int num ) #

Returns the current velocity of the specified particle.

Arguments

  • int num - Particle number.

Return value

Particle velocity.

void AddParticleForce ( int num, vec3 force ) #

Applies a force to the given particle. Integrated forces are applied after calling the update.

Arguments

  • int num - Particle number.
  • vec3 force - Amount of force to apply.

void AddParticleImpulse ( int num, vec3 impulse ) #

Applies an impulse to the given particle. Impulses immediately affect particles velocities.

Arguments

  • int num - Particle number.
  • vec3 impulse - Amount of impulse to apply.

void SetIterationsMode ( BodyParticles.ITERATIONS_MODE mode ) #

Sets iteration mode to be used for the particles body. The mode determines how the number of iterations for solving the constraints of the particles body is calculated. This method adds flexibility in fine-tuning of performance and simulation quality for each particles body.

Arguments

BodyParticles.ITERATIONS_MODE GetIterationsMode ( ) #

Returns the current iteration mode to be used for the particles body. The mode determines how the number of iterations for solving the constraints of the particles body is calculated. This method adds flexibility in fine-tuning of performance and simulation quality for each particles body.

Return value

Current iteration mode of the particles body:
Last update: 2024-04-19
Build: ()