A cloth fabric is a structure that contains all the internal solver constraints of a cloth mesh. More...
#include <PxClothFabric.h>
Public Member Functions | |
virtual void | release ()=0 |
Release the cloth fabric. More... | |
virtual PxU32 | getNbParticles () const =0 |
Returns number of particles. More... | |
virtual PxU32 | getNbPhases () const =0 |
Returns number of phases. More... | |
virtual PxU32 | getNbRestvalues () const =0 |
Returns number of rest values. More... | |
virtual PxU32 | getNbSets () const =0 |
Returns number of sets. More... | |
virtual PxU32 | getNbParticleIndices () const =0 |
Get number of particle indices. More... | |
virtual PxU32 | getNbTethers () const =0 |
Get number of tether constraints. More... | |
virtual PxU32 | getPhases (PxClothFabricPhase *userPhaseBuffer, PxU32 bufferSize) const =0 |
Copies the phase array to a user specified buffer. More... | |
virtual PxU32 | getSets (PxU32 *userSetBuffer, PxU32 bufferSize) const =0 |
Copies the set array to a user specified buffer. More... | |
virtual PxU32 | getParticleIndices (PxU32 *userParticleIndexBuffer, PxU32 bufferSize) const =0 |
Copies the particle indices array to a user specified buffer. More... | |
virtual PxU32 | getRestvalues (PxReal *userRestvalueBuffer, PxU32 bufferSize) const =0 |
Copies the rest values array to a user specified buffer. More... | |
virtual PxU32 | getTetherAnchors (PxU32 *userAnchorBuffer, PxU32 bufferSize) const =0 |
Copies the tether anchors array to a user specified buffer. More... | |
virtual PxU32 | getTetherLengths (PxReal *userLengthBuffer, PxU32 bufferSize) const =0 |
Copies the tether lengths array to a user specified buffer. More... | |
virtual PX_DEPRECATED PxClothFabricPhaseType::Enum | getPhaseType (PxU32 phaseIndex) const =0 |
Returns the type of a phase. More... | |
virtual void | scaleRestlengths (PxReal scale)=0 |
Scale all rest values of length dependent constraints. More... | |
virtual PxU32 | getReferenceCount () const =0 |
Reference count of the cloth instance. More... | |
virtual const char * | getConcreteTypeName () const |
Returns string name of dynamic type. 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 | PxClothFabric (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxClothFabric (PxBaseFlags baseFlags) |
virtual | ~PxClothFabric () |
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 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 | |
Protected Attributes inherited from PxBase | |
PxType | mConcreteType |
PxBaseFlags | mBaseFlags |
A cloth fabric is a structure that contains all the internal solver constraints of a cloth mesh.
A fabric consists of phases
that represent a group of internal constraints of the same type. Each phase references an array of rest-values
and a set
of particle indices. The data representation for the fabric has layers of indirect indices:
Additionally, a fabric also stores the data for the tether constraints, which limit the distances between two particles. The tether constraints are stored in an array, and the index of a constraint determines which particle is affected: element i affects particle iN, where N is the number of particles. The tether anchor is the index of the other particle, and the tether length is the maximum distance that these two particles are allowed to be away from each other. A tether constraint is momentum conserving if the anchor particle has infinite mass (zero inverse weight).
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
|
inlinevirtual |
Returns string name of dynamic type.
Reimplemented from PxBase.
|
pure virtual |
Get number of particle indices.
|
pure virtual |
Returns number of particles.
|
pure virtual |
Returns number of phases.
|
pure virtual |
Returns number of rest values.
|
pure virtual |
Returns number of sets.
|
pure virtual |
Get number of tether constraints.
|
pure virtual |
Copies the particle indices array to a user specified buffer.
The particle indices array determines which particles are affected by each constraint. It has the same length as getNbParticleIndices() and twice the number of constraints.
[in] | userParticleIndexBuffer | Destination buffer to copy the set data to. |
[in] | bufferSize | Size of userParticleIndexBuffer, should be at least getNbParticleIndices(). |
|
pure virtual |
Copies the phase array to a user specified buffer.
The phase array is a mapping of the phase index to the corresponding phase. The array has the same length as getNbPhases().
[in] | userPhaseBuffer | Destination buffer to copy the phase data to. |
[in] | bufferSize | Size of userPhaseBuffer, should be at least getNbPhases(). |
|
pure virtual |
Returns the type of a phase.
[in] | phaseIndex | The index of the phase to return the type for. |
|
pure virtual |
Reference count of the cloth instance.
At creation, the reference count of the fabric is 1. Every cloth instance referencing this fabric increments the count by 1. When the reference count reaches 0, and only then, the fabric gets released automatically.
|
pure virtual |
Copies the rest values array to a user specified buffer.
The rest values array holds the target value of the constraint in rest state, for example edge length for stretch constraints. It stores one value per constraint, so its length is half of getNbParticleIndices(), and it has the same length as getNbRestvalues(). The rest-values are stored in the order they are (indirectly) referenced by the phases.
[in] | userRestvalueBuffer | Destination buffer to copy the set data to. |
[in] | bufferSize | Size of userRestvalueBuffer, should be at least getNbRestvalues(). |
Copies the set array to a user specified buffer.
The set array is the inclusive prefix sum of the number of constraints per set. It has the same length as getNbSets().
[in] | userSetBuffer | Destination buffer to copy the set data to. |
[in] | bufferSize | Size of userSetBuffer, should be at least getNbSets(). |
|
pure virtual |
Copies the tether anchors array to a user specified buffer.
The tether anchors array stores for each particle the index of another particle from which it cannot move further away than specified by the tether lengths array.
[in] | userAnchorBuffer | Destination buffer to copy the set data to. |
[in] | bufferSize | Size of userAnchorBuffer, should be at least getNbTethers(). |
|
pure virtual |
Copies the tether lengths array to a user specified buffer.
The tether lengths array stores for each particle how far it is allowed to move away from the particle specified by the tether anchor array.
[in] | userLengthBuffer | Destination buffer to copy the set data to. |
[in] | bufferSize | Size of userLengthBuffer, should be at least getNbTethers(). |
|
inlineprotectedvirtual |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxBase.
References PxBase::isKindOf().
|
pure virtual |
Release the cloth fabric.
Releases the application's reference to the cloth fabric. The fabric is destroyed when the application's reference is released and all cloth instances referencing the fabric are destroyed.
Implements PxBase.
|
pure virtual |
Scale all rest values of length dependent constraints.
[in] | scale | The scale factor to multiply each rest value with. |