Set of connected particles tailored towards simulating character cloth. More...
#include <PxCloth.h>
Public Member Functions | |
virtual void | release ()=0 |
Deletes the cloth. Do not keep a reference to the deleted instance. More... | |
virtual PxClothFabric * | getFabric () const =0 |
Returns a pointer to the corresponding cloth fabric. More... | |
virtual PxBounds3 | getWorldBounds (float inflation=1.01f) const =0 |
Returns world space bounding box. More... | |
virtual PxU32 | getNbParticles () const =0 |
Returns the number of particles. More... | |
virtual PxClothParticleData * | lockParticleData (PxDataAccessFlags flags)=0 |
Acquires access to the cloth particle data. More... | |
virtual PxClothParticleData * | lockParticleData () const =0 |
Acquires read access to the cloth particle data. More... | |
virtual void | setParticles (const PxClothParticle *currentParticles, const PxClothParticle *previousParticles)=0 |
Updates cloth particle location or inverse weight for current and previous particle state. More... | |
virtual void | setClothFlag (PxClothFlag::Enum flag, bool value)=0 |
Sets cloth flags (e.g. use GPU for simulation, enable CCD, collide against scene). More... | |
virtual void | setClothFlags (PxClothFlags inFlags)=0 |
Set all cloth flags. More... | |
virtual PxClothFlags | getClothFlags () const =0 |
Returns cloth flags. More... | |
virtual const char * | getConcreteTypeName () const |
Returns string name of dynamic type. More... | |
Integration | |
Functions related to particle integration. | |
virtual void | setTargetPose (const PxTransform &pose)=0 |
Sets pose that the cloth should move to by the end of the next simulate() call. More... | |
virtual void | setGlobalPose (const PxTransform &pose)=0 |
Sets current pose of the cloth without affecting inertia. More... | |
virtual PxTransform | getGlobalPose () const =0 |
Returns global pose. More... | |
virtual void | setSolverFrequency (PxReal frequency)=0 |
Sets the solver frequency parameter. More... | |
virtual PxReal | getSolverFrequency () const =0 |
Returns solver frequency. More... | |
virtual PxReal | getPreviousTimeStep () const =0 |
Returns previous time step size. More... | |
virtual void | setStiffnessFrequency (PxReal frequency)=0 |
Sets the stiffness frequency parameter. More... | |
virtual PxReal | getStiffnessFrequency () const =0 |
Returns stiffness frequency. More... | |
virtual void | setLinearInertiaScale (PxVec3 scale)=0 |
Sets the acceleration scale factor to adjust inertia effect from global pose changes. More... | |
virtual PxVec3 | getLinearInertiaScale () const =0 |
Returns linear acceleration scale parameter. More... | |
virtual void | setAngularInertiaScale (PxVec3 scale)=0 |
Sets the acceleration scale factor to adjust inertia effect from global pose changes. More... | |
virtual PxVec3 | getAngularInertiaScale () const =0 |
Returns angular acceleration scale parameter. More... | |
virtual void | setCentrifugalInertiaScale (PxVec3 scale)=0 |
Sets the acceleration scale factor to adjust inertia effect from global pose changes. More... | |
virtual PxVec3 | getCentrifugalInertiaScale () const =0 |
Returns centrifugal acceleration scale parameter. More... | |
virtual void | setInertiaScale (PxReal scale)=0 |
Same as setLinearInertiaScale(PxVec3(scale)); setAngularInertiaScale(PxVec3(scale)); getCentrifugalInertiaScale(PxVec3(scale)); More... | |
virtual void | setDampingCoefficient (PxVec3 dampingCoefficient)=0 |
Sets the damping coefficient. More... | |
virtual PxVec3 | getDampingCoefficient () const =0 |
Returns the damping coefficient. More... | |
virtual void | setLinearDragCoefficient (PxVec3 dragCoefficient)=0 |
Sets the linear drag coefficient. More... | |
virtual PxVec3 | getLinearDragCoefficient () const =0 |
Returns the linear drag coefficient. More... | |
virtual void | setAngularDragCoefficient (PxVec3 dragCoefficient)=0 |
Sets the angular drag coefficient. More... | |
virtual PxVec3 | getAngularDragCoefficient () const =0 |
Returns the angular drag coefficient. More... | |
virtual void | setDragCoefficient (PxReal scale)=0 |
Same as setLinearDragCoefficient(PxVec3(coefficient)); setAngularDragCoefficient(PxVec3(coefficient)); More... | |
virtual void | setExternalAcceleration (PxVec3 acceleration)=0 |
Sets external particle accelerations. More... | |
virtual PxVec3 | getExternalAcceleration () const =0 |
Returns external acceleration. More... | |
virtual void | setParticleAccelerations (const PxVec4 *particleAccelerations)=0 |
Updates particle accelerations, w component is ignored. More... | |
virtual bool | getParticleAccelerations (PxVec4 *particleAccelerationsBuffer) const =0 |
Copies particle accelerations to the user provided buffer. More... | |
virtual PxU32 | getNbParticleAccelerations () const =0 |
Returns the number of particle accelerations. More... | |
Constraints | |
Functions related to particle and distance constaints. | |
virtual void | setMotionConstraints (const PxClothParticleMotionConstraint *motionConstraints)=0 |
Updates motion constraints (position and radius of the constraint sphere). More... | |
virtual bool | getMotionConstraints (PxClothParticleMotionConstraint *motionConstraintsBuffer) const =0 |
Copies motion constraints to the user provided buffer. More... | |
virtual PxU32 | getNbMotionConstraints () const =0 |
Returns the number of motion constraints. More... | |
virtual void | setMotionConstraintConfig (const PxClothMotionConstraintConfig &config)=0 |
Specifies motion constraint scale, bias, and stiffness. More... | |
virtual PxClothMotionConstraintConfig | getMotionConstraintConfig () const =0 |
Reads back scale and bias factor for motion constraints. More... | |
virtual void | setSeparationConstraints (const PxClothParticleSeparationConstraint *separationConstraints)=0 |
Updates separation constraints (position and radius of the constraint sphere). More... | |
virtual bool | getSeparationConstraints (PxClothParticleSeparationConstraint *separationConstraintsBuffer) const =0 |
Copies separation constraints to the user provided buffer. More... | |
virtual PxU32 | getNbSeparationConstraints () const =0 |
Returns the number of separation constraints. More... | |
virtual void | clearInterpolation ()=0 |
Assign current to previous positions for collision shapes, motion constraints, and separation constraints. More... | |
virtual void | setStretchConfig (PxClothFabricPhaseType::Enum type, const PxClothStretchConfig &config)=0 |
Sets the solver parameters for the vertical solver phases. More... | |
virtual PxClothStretchConfig | getStretchConfig (PxClothFabricPhaseType::Enum type) const =0 |
Returns the solver parameters for one of the phase types. More... | |
virtual void | setTetherConfig (const PxClothTetherConfig &config)=0 |
Sets the stiffness parameters for the tether constraints. More... | |
virtual PxClothTetherConfig | getTetherConfig () const =0 |
Returns the stiffness parameters for the tether constraints. More... | |
Collision | |
Functions related to particle collision. | |
virtual void | addCollisionSphere (const PxClothCollisionSphere &sphere)=0 |
Adds a new collision sphere. More... | |
virtual void | removeCollisionSphere (PxU32 index)=0 |
Removes collision sphere. More... | |
virtual void | setCollisionSpheres (const PxClothCollisionSphere *spheresBuffer, PxU32 count)=0 |
Updates location and radii of collision spheres. More... | |
virtual PxU32 | getNbCollisionSpheres () const =0 |
Returns the number of collision spheres. More... | |
virtual void | addCollisionCapsule (PxU32 first, PxU32 second)=0 |
Adds a new collision capsule. More... | |
virtual void | removeCollisionCapsule (PxU32 index)=0 |
Removes a collision capsule. More... | |
virtual PxU32 | getNbCollisionCapsules () const =0 |
Returns the number of collision capsules. More... | |
virtual void | addCollisionPlane (const PxClothCollisionPlane &plane)=0 |
Adds a collision plane. More... | |
virtual void | removeCollisionPlane (PxU32 index)=0 |
Removes a collision plane. More... | |
virtual void | setCollisionPlanes (const PxClothCollisionPlane *planesBuffer, PxU32 count)=0 |
Updates positions of collision planes. More... | |
virtual PxU32 | getNbCollisionPlanes () const =0 |
Returns the number of collision planes. More... | |
virtual void | addCollisionConvex (PxU32 mask)=0 |
Adds a new collision convex. More... | |
virtual void | removeCollisionConvex (PxU32 index)=0 |
Removes a collision convex. More... | |
virtual PxU32 | getNbCollisionConvexes () const =0 |
Returns the number of collision convexes. More... | |
virtual void | addCollisionTriangle (const PxClothCollisionTriangle &triangle)=0 |
Adds a new collision triangle. More... | |
virtual void | removeCollisionTriangle (PxU32 index)=0 |
Removes a collision triangle. More... | |
virtual void | setCollisionTriangles (const PxClothCollisionTriangle *trianglesBuffer, PxU32 count)=0 |
Updates positions of collision triangles. More... | |
virtual PxU32 | getNbCollisionTriangles () const =0 |
Returns the number of collision triangles. More... | |
virtual void | getCollisionData (PxClothCollisionSphere *spheresBuffer, PxU32 *capsulesBuffer, PxClothCollisionPlane *planesBuffer, PxU32 *convexesBuffer, PxClothCollisionTriangle *trianglesBuffer) const =0 |
Retrieves the collision shapes. More... | |
virtual void | setVirtualParticles (PxU32 numVirtualParticles, const PxU32 *indices, PxU32 numWeights, const PxVec3 *weights)=0 |
Assigns virtual particles. More... | |
virtual PxU32 | getNbVirtualParticles () const =0 |
Returns the number of virtual particles. More... | |
virtual void | getVirtualParticles (PxU32 *indicesBuffer) const =0 |
Copies index array of virtual particles to the user provided buffer. More... | |
virtual PxU32 | getNbVirtualParticleWeights () const =0 |
Returns the number of the virtual particle weights. More... | |
virtual void | getVirtualParticleWeights (PxVec3 *weightsBuffer) const =0 |
Copies weight table of virtual particles to the user provided buffer. More... | |
virtual void | setFrictionCoefficient (PxReal frictionCoefficient)=0 |
Sets the collision friction coefficient. More... | |
virtual PxReal | getFrictionCoefficient () const =0 |
Returns the friction coefficient. More... | |
virtual void | setCollisionMassScale (PxReal scalingCoefficient)=0 |
Sets the collision mass scaling coefficient. More... | |
virtual PxReal | getCollisionMassScale () const =0 |
Returns the mass-scaling coefficient. More... | |
Self-Collision | |
Functions related to particle against particle collision. | |
virtual void | setSelfCollisionDistance (PxReal distance)=0 |
Sets the self collision distance. More... | |
virtual PxReal | getSelfCollisionDistance () const =0 |
Returns the self-collision distance. More... | |
virtual void | setSelfCollisionStiffness (PxReal stiffness)=0 |
Sets the self collision stiffness. More... | |
virtual PxReal | getSelfCollisionStiffness () const =0 |
Returns the self-collision stiffness. More... | |
virtual void | setSelfCollisionIndices (const PxU32 *indices, PxU32 nbIndices)=0 |
Sets a subset of cloth particles which participate in self-collision. More... | |
virtual bool | getSelfCollisionIndices (PxU32 *indices) const =0 |
Copies array of particles participating in self-collision to the user provided buffer. More... | |
virtual PxU32 | getNbSelfCollisionIndices () const =0 |
Returns the number of particles participating in self-collision. More... | |
virtual void | setRestPositions (const PxVec4 *restPositions)=0 |
Sets the cloth particles rest positions. More... | |
virtual bool | getRestPositions (PxVec4 *restPositions) const =0 |
Copies array of rest positions to the user provided buffer. More... | |
virtual PxU32 | getNbRestPositions () const =0 |
Returns the number of rest positions. More... | |
Inter-Collision | |
Functions related to collision between cloth instances. | |
virtual void | setSimulationFilterData (const PxFilterData &data)=0 |
Sets the user definable collision filter data. More... | |
virtual PxFilterData | getSimulationFilterData () const =0 |
Retrieves the object's collision filter data. More... | |
Scene-Collision | |
Functions related to collision against scene objects. | |
virtual void | setContactOffset (PxReal offset)=0 |
Sets the width by which the cloth bounding box is increased to find nearby scene collision shapes. More... | |
virtual PxReal | getContactOffset () const =0 |
Returns cloth contact offset. More... | |
virtual void | setRestOffset (PxReal offset)=0 |
Sets the minimum distance between colliding cloth particles and scene shapes. More... | |
virtual PxReal | getRestOffset () const =0 |
Returns cloth rest offset. More... | |
Sleeping | |
Functions related to sleeping. | |
virtual void | setSleepLinearVelocity (PxReal threshold)=0 |
Sets the velocity threshold for putting cloth in sleep state. More... | |
virtual PxReal | getSleepLinearVelocity () const =0 |
Returns the velocity threshold for putting cloth in sleep state. More... | |
virtual void | setWakeCounter (PxReal wakeCounterValue)=0 |
Sets the wake counter for the cloth. More... | |
virtual PxReal | getWakeCounter () const =0 |
Returns the wake counter of the cloth. More... | |
virtual void | wakeUp ()=0 |
Forces cloth to wake up from sleep state. More... | |
virtual void | putToSleep ()=0 |
Forces cloth to be put in sleep state. More... | |
virtual bool | isSleeping () const =0 |
Returns true if cloth is in sleep state. More... | |
Public Member Functions inherited from PxActor | |
virtual PxActorType::Enum | getType () const =0 |
Retrieves the type of actor. More... | |
PX_DEPRECATED PX_INLINE PxRigidStatic * | isRigidStatic () |
Attempts to cast to specific actor type. More... | |
PX_DEPRECATED PX_INLINE const PxRigidStatic * | isRigidStatic () const |
PX_DEPRECATED PX_INLINE PxRigidDynamic * | isRigidDynamic () |
PX_DEPRECATED PX_INLINE const PxRigidDynamic * | isRigidDynamic () const |
PX_DEPRECATED PX_INLINE PxParticleSystem * | isParticleSystem () |
PX_DEPRECATED PX_INLINE const PxParticleSystem * | isParticleSystem () const |
PX_DEPRECATED PX_INLINE PxParticleFluid * | isParticleFluid () |
PX_DEPRECATED PX_INLINE const PxParticleFluid * | isParticleFluid () const |
PX_DEPRECATED PX_INLINE PxArticulationLink * | isArticulationLink () |
PX_DEPRECATED PX_INLINE const PxArticulationLink * | isArticulationLink () const |
PX_DEPRECATED PX_INLINE PxCloth * | isCloth () |
PX_DEPRECATED PX_INLINE const PxCloth * | isCloth () const |
PX_DEPRECATED PX_INLINE PxRigidActor * | isRigidActor () |
PX_DEPRECATED PX_INLINE const PxRigidActor * | isRigidActor () const |
PX_DEPRECATED PX_INLINE PxRigidBody * | isRigidBody () |
PX_DEPRECATED PX_INLINE const PxRigidBody * | isRigidBody () const |
PX_DEPRECATED PX_INLINE PxParticleBase * | isParticleBase () |
PX_DEPRECATED PX_INLINE const PxParticleBase * | isParticleBase () const |
virtual PxScene * | getScene () const =0 |
Retrieves the scene which this actor belongs to. More... | |
virtual void | setName (const char *name)=0 |
Sets a name string for the object that can be retrieved with getName(). More... | |
virtual const char * | getName () const =0 |
Retrieves the name string set with setName(). More... | |
virtual void | setActorFlag (PxActorFlag::Enum flag, bool value)=0 |
Raises or clears a particular actor flag. More... | |
virtual void | setActorFlags (PxActorFlags inFlags)=0 |
sets the actor flags More... | |
virtual PxActorFlags | getActorFlags () const =0 |
Reads the PxActor flags. More... | |
virtual void | setDominanceGroup (PxDominanceGroup dominanceGroup)=0 |
Assigns dynamic actors a dominance group identifier. More... | |
virtual PxDominanceGroup | getDominanceGroup () const =0 |
Retrieves the value set with setDominanceGroup(). More... | |
virtual void | setOwnerClient (PxClientID inClient)=0 |
Sets the owner client of an actor. More... | |
virtual PxClientID | getOwnerClient () const =0 |
Returns the owner client that was specified with at creation time. More... | |
virtual void | setClientBehaviorFlags (PxActorClientBehaviorFlags)=0 |
Sets the behavior bits of the actor. More... | |
virtual PxActorClientBehaviorFlags | getClientBehaviorFlags () const =0 |
Retrieves the behavior bits of the actor. More... | |
virtual PxAggregate * | getAggregate () const =0 |
Retrieves the aggregate the actor might be a part of. More... | |
Public Member Functions inherited from PxBase | |
template<class T > | |
T * | is () |
template<class T > | |
const T * | is () const |
PX_INLINE PxType | getConcreteType () const |
Returns concrete type of object. More... | |
PX_INLINE void | setBaseFlag (PxBaseFlag::Enum flag, bool value) |
Set PxBaseFlag. More... | |
PX_INLINE void | setBaseFlags (PxBaseFlags inFlags) |
Set PxBaseFlags. More... | |
PX_INLINE PxBaseFlags | getBaseFlags () const |
Returns PxBaseFlags. More... | |
virtual bool | isReleasable () const |
Whether the object is subordinate. More... | |
Protected Member Functions | |
PX_INLINE | PxCloth (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxCloth (PxBaseFlags baseFlags) |
virtual | ~PxCloth () |
virtual bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. More... | |
Protected Member Functions inherited from PxActor | |
PX_INLINE | PxActor (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxActor (PxBaseFlags baseFlags) |
virtual | ~PxActor () |
Protected Member Functions inherited from PxBase | |
PX_INLINE | PxBase (PxType concreteType, PxBaseFlags baseFlags) |
Constructor setting concrete type and base flags. More... | |
PX_INLINE | PxBase (PxBaseFlags baseFlags) |
Deserialization constructor setting base flags. More... | |
virtual | ~PxBase () |
Destructor. More... | |
template<class T > | |
bool | typeMatch () const |
Additional Inherited Members | |
Public Attributes inherited from PxActor | |
void * | userData |
user can assign this to whatever, usually to create a 1:1 relationship with a user object. More... | |
Protected Attributes inherited from PxBase | |
PxType | mConcreteType |
PxBaseFlags | mBaseFlags |
Set of connected particles tailored towards simulating character cloth.
A cloth object consists of the following components:
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
Adds a new collision capsule.
A collision capsule is defined as the bounding volume of two spheres.
[in] | first | Index of first sphere. |
[in] | second | Index of second sphere. |
|
pure virtual |
Adds a new collision convex.
A collision convex is defined as the intersection of planes.
[in] | mask | The bitmask of the planes that make up the convex. |
|
pure virtual |
Adds a collision plane.
[in] | plane | New collision plane. |
|
pure virtual |
Adds a new collision sphere.
[in] | sphere | New collision sphere. |
|
pure virtual |
Adds a new collision triangle.
[in] | triangle | New collision triangle. |
|
pure virtual |
Assign current to previous positions for collision shapes, motion constraints, and separation constraints.
This allows to prevent false interpolation after leaping to an animation frame, for example. After calling clearInterpolation(), the current positions will be used without interpolation. New positions can be set afterwards to interpolate to by the end of the next frame.
|
pure virtual |
Returns the angular drag coefficient.
|
pure virtual |
Returns angular acceleration scale parameter.
|
pure virtual |
Returns centrifugal acceleration scale parameter.
|
pure virtual |
Returns cloth flags.
|
pure virtual |
Retrieves the collision shapes.
Returns collision spheres, capsules, convexes, and triangles that were added through the addCollision*() methods and modified through the setCollision*() methods.
[out] | spheresBuffer | Spheres destination buffer, must be NULL or the same length as getNbCollisionSpheres(). |
[out] | capsulesBuffer | Capsules destination buffer, must be NULL or the same length as 2*getNbCollisionCapsules(). |
[out] | planesBuffer | Planes destination buffer, must be NULL or the same length as getNbCollisionPlanes(). |
[out] | convexesBuffer | Convexes destination buffer, must be NULL or the same length as getNbCollisionConvexes(). |
[out] | trianglesBuffer | Triangles destination buffer, must be NULL or the same length as getNbCollisionTriangles(). |
|
pure virtual |
Returns the mass-scaling coefficient.
|
inlinevirtual |
Returns string name of dynamic type.
Reimplemented from PxBase.
|
pure virtual |
Returns cloth contact offset.
|
pure virtual |
Returns the damping coefficient.
|
pure virtual |
Returns external acceleration.
|
pure virtual |
Returns a pointer to the corresponding cloth fabric.
|
pure virtual |
Returns the friction coefficient.
|
pure virtual |
Returns global pose.
|
pure virtual |
Returns the linear drag coefficient.
|
pure virtual |
Returns linear acceleration scale parameter.
|
pure virtual |
Reads back scale and bias factor for motion constraints.
|
pure virtual |
Copies motion constraints to the user provided buffer.
[out] | motionConstraintsBuffer | Destination buffer, must be at least getNbMotionConstraints(). |
|
pure virtual |
Returns the number of collision capsules.
|
pure virtual |
Returns the number of collision convexes.
|
pure virtual |
Returns the number of collision planes.
|
pure virtual |
Returns the number of collision spheres.
|
pure virtual |
Returns the number of collision triangles.
|
pure virtual |
Returns the number of motion constraints.
|
pure virtual |
Returns the number of particle accelerations.
|
pure virtual |
Returns the number of particles.
|
pure virtual |
Returns the number of rest positions.
|
pure virtual |
Returns the number of particles participating in self-collision.
|
pure virtual |
Returns the number of separation constraints.
|
pure virtual |
Returns the number of virtual particles.
|
pure virtual |
Returns the number of the virtual particle weights.
|
pure virtual |
Copies particle accelerations to the user provided buffer.
[out] | particleAccelerationsBuffer | Destination buffer, must be at least getNbParticleAccelerations(). |
|
pure virtual |
Returns previous time step size.
Time between sampling of previous and current particle positions for computing particle velocity.
|
pure virtual |
Returns cloth rest offset.
|
pure virtual |
Copies array of rest positions to the user provided buffer.
[out] | restPositions | Destination buffer, must be at least getNbParticles() in length. |
|
pure virtual |
Returns the self-collision distance.
|
pure virtual |
Copies array of particles participating in self-collision to the user provided buffer.
[out] | indices | Destination buffer, must be at least getNbSelfCollisionIndices() in length. |
|
pure virtual |
Returns the self-collision stiffness.
|
pure virtual |
Copies separation constraints to the user provided buffer.
[out] | separationConstraintsBuffer | Destination buffer, must be at least getNbSeparationConstraints(). |
|
pure virtual |
Retrieves the object's collision filter data.
|
pure virtual |
Returns the velocity threshold for putting cloth in sleep state.
|
pure virtual |
Returns solver frequency.
|
pure virtual |
Returns stiffness frequency.
|
pure virtual |
Returns the solver parameters for one of the phase types.
[in] | type | Type of phases to return the config for. |
|
pure virtual |
Returns the stiffness parameters for the tether constraints.
|
pure virtual |
Copies index array of virtual particles to the user provided buffer.
[out] | indicesBuffer | Destination buffer, must be at least 4*getNbVirtualParticles(). |
|
pure virtual |
Copies weight table of virtual particles to the user provided buffer.
[out] | weightsBuffer | Destination buffer, must be at least getNbVirtualParticleWeights(). |
|
pure virtual |
Returns the wake counter of the cloth.
|
pure virtual |
Returns world space bounding box.
[in] | inflation | Scale factor for computed world bounds. Box extents are multiplied by this value. |
Implements PxActor.
|
inlineprotectedvirtual |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxActor.
References PxActor::isKindOf().
|
pure virtual |
Returns true if cloth is in sleep state.
|
pure virtual |
Acquires access to the cloth particle data.
This function returns a pointer to a PxClothParticleData instance providing access to the PxClothParticle array of the current and previous iteration. The user is responsible for calling PxClothParticleData::unlock() after reading or updating the data. In case the lock has been requested using PxDataAccessFlag::eWRITABLE, the unlock() call copies the arrays pointed to by PxClothParticleData::particles/previousParticles back to the internal particle buffer. Updating the data when a read-only lock has been requested results in undefined behavior. Requesting multiple concurrent read-only locks is supported, but no other lock may be active when requesting a write lock.
If PxDataAccessFlag::eDEVICE is set in flags then the returned pointers will be to GPU device memory, this can be used for direct interop with graphics APIs. Note that these pointers should only be considered valid until PxClothParticleData::unlock() is called and should not be stored. PxDataAccessFlag::eDEVICE implies read and write access, and changing the particles/previousParticles members results in undefined behavior.
flags | Specifies if particle data is read or written. |
|
pure virtual |
Acquires read access to the cloth particle data.
|
pure virtual |
Forces cloth to be put in sleep state.
|
pure virtual |
Deletes the cloth. Do not keep a reference to the deleted instance.
Implements PxActor.
|
pure virtual |
Removes a collision capsule.
[in] | index | Index of capsule to remove. |
index
are decremented by 1.
|
pure virtual |
Removes a collision convex.
[in] | index | Index of convex to remove. |
index
are decremented by 1.
|
pure virtual |
Removes a collision plane.
[in] | index | Index of plane to remove. |
index
are decremented by 1.
|
pure virtual |
Removes collision sphere.
[in] | index | Index of sphere to remove. |
index
are decremented by 1.
|
pure virtual |
Removes a collision triangle.
[in] | index | Index of triangle to remove. |
index
are decremented by 1.
|
pure virtual |
Sets the angular drag coefficient.
The angular drag coefficient is the portion of the pose rotation that is applied to each particle per stiffness period (see PxCloth::setStiffnessFrequency).
[in] | dragCoefficient | New angular drag coefficient between 0.0f and 1.0 (default: 0.0). |
|
pure virtual |
Sets the acceleration scale factor to adjust inertia effect from global pose changes.
[in] | scale | New scale factor between 0.0 (no inertia) and 1.0 (full inertia) (default: 1.0). |
|
pure virtual |
Sets the acceleration scale factor to adjust inertia effect from global pose changes.
[in] | scale | New scale factor between 0.0 (no centrifugal force) and 1.0 (full centrifugal force) (default: 1.0). |
|
pure virtual |
Sets cloth flags (e.g. use GPU for simulation, enable CCD, collide against scene).
[in] | flag | Mask of which flags to set. |
[in] | value | Value to set flags to. |
|
pure virtual |
Set all cloth flags.
[in] | inFlags | Bit mask of flag values |
|
pure virtual |
Sets the collision mass scaling coefficient.
During collision it is possible to artificially increase the mass of a colliding particle, this has an effect comparable to making constraints attached to the particle stiffer and can help reduce stretching and interpenetration around collision shapes.
[in] | scalingCoefficient | Unitless multiplier that can take on values > 1 (default: 0.0). |
|
pure virtual |
Updates positions of collision planes.
[in] | planesBuffer | New plane positions by the end of the next simulate() call. |
[in] | count | New number of collision planes. |
|
pure virtual |
Updates location and radii of collision spheres.
[in] | spheresBuffer | New sphere positions and radii by the end of the next simulate() call. |
[in] | count | New number of collision spheres. |
|
pure virtual |
Updates positions of collision triangles.
[in] | trianglesBuffer | New triangle positions by the end of the next simulate() call. |
[in] | count | New number of collision triangles. |
|
pure virtual |
Sets the width by which the cloth bounding box is increased to find nearby scene collision shapes.
The cloth particles collide against shapes in the scene that intersect the cloth bounding box enlarged by the contact offset (if the eSCENE_COLLISION flag is set). Default: 0.0f
[in] | offset | Range: [0, PX_MAX_F32) |
|
pure virtual |
Sets the damping coefficient.
The damping coefficient is the portion of local particle velocity that is canceled per stiffness period (see PxCloth::setStiffnessFrequency).
[in] | dampingCoefficient | New damping coefficient between 0.0 and 1.0 (default: 0.0). |
|
pure virtual |
Same as setLinearDragCoefficient(PxVec3(coefficient)); setAngularDragCoefficient(PxVec3(coefficient));
|
pure virtual |
Sets external particle accelerations.
[in] | acceleration | New acceleration in global coordinates (default: 0.0). |
|
pure virtual |
Sets the collision friction coefficient.
[in] | frictionCoefficient | New friction coefficient between 0.0 and 1.0 (default: 0.0). |
|
pure virtual |
Sets current pose of the cloth without affecting inertia.
Use this to reset the pose (e.g. teleporting).
[in] | pose | New global pose. |
|
pure virtual |
Same as setLinearInertiaScale(PxVec3(scale)); setAngularInertiaScale(PxVec3(scale)); getCentrifugalInertiaScale(PxVec3(scale));
|
pure virtual |
Sets the linear drag coefficient.
The linear drag coefficient is the portion of the pose translation that is applied to each particle per stiffness period (see PxCloth::setStiffnessFrequency).
[in] | dragCoefficient | New linear drag coefficient between 0.0f and 1.0 (default: 0.0). |
|
pure virtual |
Sets the acceleration scale factor to adjust inertia effect from global pose changes.
[in] | scale | New scale factor between 0.0 (no inertia) and 1.0 (full inertia) (default: 1.0). |
|
pure virtual |
Specifies motion constraint scale, bias, and stiffness.
[in] | config | Motion constraints solver parameters. |
|
pure virtual |
Updates motion constraints (position and radius of the constraint sphere).
[in] | motionConstraints | motion constraints at the end of the next simulate() call. |
|
pure virtual |
Updates particle accelerations, w component is ignored.
[in] | particleAccelerations | New particle accelerations. |
|
pure virtual |
Updates cloth particle location or inverse weight for current and previous particle state.
[in] | currentParticles | The particle data for the current particle state or NULL if the state should not be changed. |
[in] | previousParticles | The particle data for the previous particle state or NULL if the state should not be changed. |
|
pure virtual |
Sets the minimum distance between colliding cloth particles and scene shapes.
Cloth particles colliding against shapes in the scene get no closer to the shape's surface than specified by the rest offset (if the eSCENE_COLLISION flag is set). Default: 0.0f
[in] | offset | Range: [0, PX_MAX_F32) |
|
pure virtual |
Sets the cloth particles rest positions.
If non-null the cloth self-collision will consider the rest positions by discarding particle->particle collision where the distance between the associated rest particles is < the self collision distance. This allows self-collision distances that are larger than the minimum edge length in the mesh. Typically this function should be called with the same positions used to construct the cloth instance.
[in] | restPositions | Undeformed particle positions, the w component will be ignored |
|
pure virtual |
Sets the self collision distance.
A value larger than 0.0 enables particle versus particle collision.
[in] | distance | Minimum distance at which two particles repel each other (default: 0.0). |
|
pure virtual |
Sets a subset of cloth particles which participate in self-collision.
If non-null the cloth self-collision will consider a subset of particles instead of all the particles. This can be used to improve self-collision performance or to increase the minimum distance between two self-colliding particles (and therefore the maximum sensible self-collision distance).
[in] | indices | array of particle indices which participate in self-collision. |
[in] | nbIndices | number of particle indices, or 0 to use all particles for self-collision. |
|
pure virtual |
Sets the self collision stiffness.
Self-collision stiffness controls how much two particles repel each other when they are closer than the self-collision distance.
[in] | stiffness | Fraction of distance residual to resolve per iteration (default: 1.0). |
|
pure virtual |
Updates separation constraints (position and radius of the constraint sphere).
[in] | separationConstraints | separation constraints at the end of the next simulate() call. |
|
pure virtual |
Sets the user definable collision filter data.
data | The data that will be returned in the PxScene filter shader callback. |
|
pure virtual |
Sets the velocity threshold for putting cloth in sleep state.
If none of the particles moves faster (in local space) than the threshold for a while, the cloth will be put in sleep state and simulation will be skipped.
[in] | threshold | Velocity threshold (default: 0.0f) |
|
pure virtual |
Sets the solver frequency parameter.
Solver frequency specifies how often the simulation step is computed per second. For example, a value of 60 represents one simulation step per frame in a 60fps scene. A value of 120 will represent two simulation steps per frame, etc.
[in] | frequency | Solver frequency per second (default: 60.0). |
|
pure virtual |
Sets the stiffness frequency parameter.
The stiffness frequency controls the power-law nonlinearity of all rate of change parameters (stretch stiffness, shear stiffness, bending stiffness, tether stiffness, self-collision stiffness, motion constraint stiffness, damp coefficient, linear and angular drag coefficients). Increasing the frequency avoids numerical cancellation for values near zero or one, but increases the non-linearity of the parameter. It is not recommended to change this parameter after cloth initialization. For example, the portion of edge overstretch removed per second is equal to the stretch stiffness raised to the power of the stiffness frequency.
[in] | frequency | Stiffness frequency per second (default: 10.0). |
|
pure virtual |
Sets the solver parameters for the vertical solver phases.
[in] | config | Stretch solver parameters. |
[in] | type | Type of phases to set config for. |
|
pure virtual |
Sets pose that the cloth should move to by the end of the next simulate() call.
This function will move the cloth in world space. The resulting simulation may reflect inertia effect as a result of pose acceleration.
[in] | pose | Target pose at the end of the next simulate() call. |
|
pure virtual |
Sets the stiffness parameters for the tether constraints.
[in] | config | Tether constraints solver parameters. |
|
pure virtual |
Assigns virtual particles.
Virtual particles provide more robust and accurate collision handling against collision spheres and capsules. More virtual particles will generally increase the accuracy of collision handling, and thus a sufficient number of virtual particles can mimic triangle-based collision handling.
Virtual particles are specified as barycentric interpolation of real particles: The position of a virtual particle is w0 * P0 + w1 * P1 + w2 * P2, where P0, P1, P2 real particle positions. The barycentric weights w0, w1, w2 are stored in a separate table so they can be shared across multiple virtual particles.
[in] | numVirtualParticles | total number of virtual particles. |
[in] | indices | Each virtual particle has four indices, the first three for real particle indices, and the last for the weight table index. Thus, the length of indices needs to be 4*numVirtualParticles. |
[in] | numWeights | total number of unique weights triples. |
[in] | weights | array for barycentric weights. |
|
pure virtual |
Sets the wake counter for the cloth.
The wake counter value determines how long all particles need to move less than the velocity threshold until the cloth is put to sleep (see setSleepLinearVelocity()).
[in] | wakeCounterValue | Wake counter value. Range: [0, PX_MAX_F32) |
|
pure virtual |
Forces cloth to wake up from sleep state.