Unigine::JointParticles Class
Header: | #include <UniginePhysics.h> |
Inherits: | Joint |
JointParticles Class
Members
static JointParticlesPtr create()
Constructor. Creates a particle joint with an anchor at the origin of the world coordinates.static JointParticlesPtr create(const Ptr<Body> & body0, const Ptr<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
- const Ptr<Body> & body0 - The first body to be connected with the joint. It can be one of the following:
- const Ptr<Body> & body1 - The second body to connect with the joint. It can be one of the following:
static JointParticlesPtr create(const Ptr<Body> & body0, const Ptr<Body> & body1, const Math::Vec3 & anchor, const Math::vec3 & size)
Arguments
- const Ptr<Body> & body0
- const Ptr<Body> & body1
- const Math::Vec3 & anchor
- const Math::vec3 & size
Ptr<JointParticles> cast(const Ptr<Joint> & joint)
Arguments
- const Ptr<Joint> & joint
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.Math::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 setSize(const Math::vec3 & size)
Updates a size of the area for pinning vertices of cloth or rope body to another body.Arguments
- const Math::vec3 & size - Size of the area to be pinned.
Math::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 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.
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 clearParticles()
Unpins the cloth or rope body completely.Last update: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter