This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
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
Учебные материалы

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

Перечисления (Enums)

ITERATIONS_MODE#

Iterations mode. Determines the way the number of iterations for solving the constraints of the particles body is calculated.
ИмяОписание
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: 19.04.2024
Build: ()