PxParticleRigidBuffer
Defined in include/PxParticleBuffer.h
-
class PxParticleRigidBuffer : public PxParticleBuffer
A particle buffer used to simulate rigid bodies using shape matching with particles.
- Deprecated:
Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
See PxPhysics::createParticleRigidBuffer.
Public Functions
-
virtual PxU32 *getRigidOffsets() const = 0
Get the particle indices of the first particle for each shape matched rigid body.
- Returns
A device buffer containing the list of particle start indices of each shape matched rigid body.
-
virtual PxReal *getRigidCoefficients() const = 0
Get the stiffness coefficients for all shape matched rigid bodies in this buffer.
Stiffness must be in the range [0, 1].
- Returns
A device buffer containing the list of stiffness coefficients for each rigid body.
-
virtual PxVec4 *getRigidLocalPositions() const = 0
Get the local position of each particle relative to the rigid body’s center of mass.
- Returns
A pointer to a device buffer containing the local position for each particle.
-
virtual PxVec4 *getRigidTranslations() const = 0
Get the world-space translations for all rigid bodies in this buffer.
- Returns
A pointer to a device buffer containing the world-space translations for all shape-matched rigid bodies in this buffer.
-
virtual PxVec4 *getRigidRotations() const = 0
Get the world-space rotation of every shape-matched rigid body in this buffer.
Rotations are specified as quaternions.
- Returns
A pointer to a device buffer containing the world-space rotation for every shape-matched rigid body in this buffer.
-
virtual PxVec4 *getRigidLocalNormals() const = 0
Get the local space normals for each particle relative to the shape of the corresponding rigid body.
The 4th component of every PxVec4 should be the negative signed distance of the particle inside its shape.
- Returns
A pointer to a device buffer containing the local-space normals for each particle.
-
virtual void setNbRigids(PxU32 nbRigids) = 0
Set the number of shape matched rigid bodies in this buffer.
- Parameters
nbRigids – [in] The number of shape matched rigid bodies
-
virtual PxU32 getNbRigids() const = 0
Get the number of shape matched rigid bodies in this buffer.
- Returns
The number of shape matched rigid bodies in this buffer.
-
virtual PxVec4 *getPositionInvMasses() const = 0
Get positions and inverse masses for this particle buffer.
- Returns
A pointer to a device buffer containing the positions and inverse mass packed as PxVec4(pos.x, pos.y, pos.z, inverseMass).
-
virtual PxVec4 *getVelocities() const = 0
Get velocities for this particle buffer.
- Returns
A pointer to a device buffer containing the velocities packed as PxVec4(vel.x, vel.y, vel.z, 0.0f).
-
virtual PxU32 *getPhases() const = 0
Get phases for this particle buffer.
- Returns
A pointer to a device buffer containing the per-particle phases for this particle buffer.
-
virtual PxParticleVolume *getParticleVolumes() const = 0
Get particle volumes for this particle buffer.
- Deprecated:
Particle-cloth, -rigids, -attachments and -volumes have been deprecated. See PxParticleVolume
- Returns
A pointer to a device buffer containing the PxParticleVolume s for this particle buffer.
-
virtual void setNbActiveParticles(PxU32 nbActiveParticles) = 0
Set the number of active particles for this particle buffer.
The number of active particles can be <= PxParticleBuffer::getMaxParticles(). The particle system will simulate the first x particles in the PxParticleBuffer, where x is the number of active particles.
- Parameters
nbActiveParticles – [in] The number of active particles.
-
virtual PxU32 getNbActiveParticles() const = 0
Get the number of active particles for this particle buffer.
- Returns
The number of active particles.
-
virtual PxU32 getMaxParticles() const = 0
Get the maximum number particles this particle buffer can hold.
The maximum number of particles is specified when creating a PxParticleBuffer. See PxPhysics::createParticleBuffer.
- Returns
The maximum number of particles.
-
virtual PxU32 getNbParticleVolumes() const = 0
Get the number of particle volumes in this particle buffer.
- Deprecated:
Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
- Returns
The number of PxParticleVolume s for this particle buffer.
-
virtual void setNbParticleVolumes(PxU32 nbParticleVolumes) = 0
Set the number of PxParticleVolume s for this particle buffer.
- Deprecated:
Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
- Parameters
nbParticleVolumes – [in] The number of particle volumes in this particle buffer.
-
virtual PxU32 getMaxParticleVolumes() const = 0
Get the maximum number of particle volumes this particle buffer can hold.
- Deprecated:
Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
See PxParticleVolume.
- Returns
The maximum number of particle volumes this particle buffer can hold.
-
virtual void setRigidFilters(PxParticleRigidFilterPair *filters, PxU32 nbFilters) = 0
Set the PxParticleRigidFilterPair s for collision filtering of particles in this buffer with rigid bodies.
- Deprecated:
Particle-cloth, -rigids, -attachments and -volumes have been deprecated. See PxParticleRigidFilterPair
- Parameters
filters – [in] A device buffer containing PxParticleRigidFilterPair s.
nbFilters – [in] The number of particle-rigid body collision filtering pairs.
-
virtual void setRigidAttachments(PxParticleRigidAttachment *attachments, PxU32 nbAttachments) = 0
Set the particle-rigid body attachments for particles in this particle buffer.
- Deprecated:
Particle-cloth, -rigids, -attachments and -volumes have been deprecated.
- Parameters
attachments – [in] A device buffer containing PxParticleRigidAttachment s.
nbAttachments – [in] The number of particle-rigid body attachments.
-
virtual PxU32 getFlatListStartIndex() const = 0
Get the start index for the first particle of this particle buffer in the complete list of particles of the particle system this buffer is used in.
The return value is only correct if the particle buffer is assigned to a particle system and at least one call to simulate() has been performed.
- Returns
The index of the first particle in the complete particle list.
-
virtual void raiseFlags(PxParticleBufferFlag::Enum flags) = 0
Raise dirty flags on this particle buffer to communicate that the corresponding data has been updated by the user.
See PxParticleBufferFlag.
- Parameters
flags – [in] The flag corresponding to the data that is dirty.
-
virtual void release() = 0
Release this buffer and deallocate all the memory.
-
virtual PxU32 getUniqueId() const = 0
Retrieve unique index that does not change over the lifetime of a PxParticleBuffer.
-
virtual const char *getConcreteTypeName() const = 0
Returns string name of dynamic type.
- Returns
Class name of most derived type of this object.
-
inline PxType getConcreteType() const
Returns concrete type of object.
See also
- Returns
PxConcreteType::Enum of serialized object
-
inline void setBaseFlag(PxBaseFlag::Enum flag, bool value)
Set PxBaseFlag
- Parameters
flag – [in] The flag to be set
value – [in] The flags new value
-
inline void setBaseFlags(PxBaseFlags inFlags)
Set PxBaseFlags
See also
PxBaseFlags
- Parameters
inFlags – [in] The flags to be set
-
inline PxBaseFlags getBaseFlags() const
Returns PxBaseFlags.
See also
PxBaseFlags
- Returns
PxBaseFlags
-
inline virtual bool isReleasable() const
Whether the object is subordinate.
A class is subordinate, if it can only be instantiated in the context of another class.
See also
- Returns
Whether the class is subordinate
Public Members
-
PxU32 bufferUniqueId
Unique index that does not change over the lifetime of a PxParticleBuffer.
- Deprecated:
Will be removed in a future version, use getUniqueId() instead.
-
void *userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Protected Functions
-
inline virtual ~PxParticleRigidBuffer()
-
PxParticleRigidBuffer(const PxParticleRigidBuffer&)
-
PxParticleRigidBuffer &operator=(const PxParticleRigidBuffer&)
-
inline virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
-
template<class T>
inline bool typeMatch() const