This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
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
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.JointParticles Class

Inherits: Joint

This class is used to pin cloth body or rope body to rigid bodies, ragdolls or dummy bodies.

Example#

The following code illustrates connection of a rope body (rope) and a dummy body (dummy) using a particles joint. The anchor is placed at the position of a dummy body.

Source code (C#)
//the anchor point is placed at the position of a dummy body, pinning area size is (0.5f, 0.5f, 1.5f)
new JointParticles(dummy, rope, dummy.getObject().getPosition(), new vec3(0.5f, 0.5f, 1.5f));

// setting pinning threshold
joint.setThreshold(0.001f);

// setting number of iterations
joint.setNumIterations(4);

See Also#

JointParticles Class

Properties

int NumParticles#

The total number of pinned particles of the cloth or rope body.

float Threshold#

The current threshold that determines the distance for pinning vertices of cloth or rope body to another body. if vertices are closer than the threshold, they are pinned together; otherwise, particles stay loose.
set
Updates a threshold that determines the distance for pinning vertices of cloth or rope body to another body. If vertices are closer than the threshold, they are pinned together; otherwise, particles stay loose.
set value - Threshold of pinning distance.

vec3 Size#

The current size of the area of pinned vertices of cloth or rope body to another body.
set
Updates a size of the area for pinning vertices of cloth or rope body to another body.
set value - Size of the area to be pinned.

Members


static JointParticles ( ) #

Constructor. Creates a particle joint with an anchor at the origin of the world coordinates.

static JointParticles ( Body body0, Body body1 ) #

Constructor. Creates a particle joint connecting two given bodies. An anchor is placed in the center of the body to which the cloth or rope is pinned.

Arguments

static JointParticles ( Body body0, Body body1, vec3 anchor, vec3 size ) #

Constructor. Creates a particles joint connecting two given bodies with specified pinning area size and an anchor placed at specified coordinates.

Arguments

  • Body body0 - First body to be connected with the joint. It can be one of the following:
  • Body body1 - Second body to be connected with the joint. It can be one of the following:
  • vec3 anchor - Anchor coordinates.
  • vec3 size - Area for pinning vertices of cloth or rope body to another body.

float GetParticleMass ( int num ) #

Returns the mass of the pinned particle of the cloth or rope body.

Arguments

  • int num - Particle number.

Return value

Particle mass.

vec3 GetParticlePosition ( int num ) #

Returns the position of the pinned particle of the cloth or rope body.

Arguments

  • int num - Particle number.

Return value

Particle position.

void ClearParticles ( ) #

Unpins the cloth or rope body completely.
Last update: 2020-04-10
Build: ()