This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
Engine-Related Classes
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility 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.

JointParticles Class

This class is used to pin BodyCloth or BodyRope to rigid bodies, ragdolls or dummy bodies. To attach a cloth or a rope, its particles simulated in mesh vertices are restricted.

JointParticles Class

Members


JointParticles ()

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

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 are pinned.

Arguments

JointParticles (Body body0, Body body1, Vec3 anchor, vec3 size)

Arguments

  • Body body0
  • Body body1
  • Vec3 anchor
  • vec3 size

int getNumParticles ()

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

Return value

The number of pinned particles.

void setSize (vec3 size)

Updates a size of the area for pinning vertices of cloth or rope body to another body.

Arguments

  • vec3 size - Size of the area to be pinned.

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.

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.

float getThreshold ()

Returns 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.

Return value

Threshold of pinning distance.

void setThreshold (float threshold)

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.

Arguments

  • float threshold - Threshold of pinning distance.

vec3 getSize ()

Returns the current size of the area of pinned vertices of cloth or rope body to another body.

Return value

Size of the pinned area.

void clearParticles ()

Unpins the cloth or rope body completely.
Last update: 2017-07-03
Build: ()