This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

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

This class inherits from Joint

Members


JointParticles ()

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

JointParticles (Body body_0, Body body_1)

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

  • Body body_0 - The first body to be connected with the joint. It can be one of the following:
  • Body body_1 - The second body to connect with the joint. It can be one of the following:

JointParticles (Body body_0, Body body_1, vec3 anchor, vec3 size)

Constructor. Creates a particle joint connecting two given bodies in a specified area using a given anchor.

Arguments

  • Body body_0 - The first body to be connected with the joint. It can be one of the following:
  • Body body_1 - The second body to connect with the joint. It can be one of the following:
  • vec3 anchor - Anchor of the joint.
  • vec3 size - Size of the pinning area.

void clearParticles ()

Unpins the cloth or rope body completely.

int getNumParticles ()

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

Return value

The number of pinned particles.

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.

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.

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

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.
Last update: 2017-07-03
Build: ()