RavEngine
Loading...
Searching...
No Matches
physx::PxParticleBuffer Class Referenceabstract

The shared base class for all particle buffers, can be instantiated directly to simulate granular and fluid particles. More...

#include <PxParticleBuffer.h>

Inheritance diagram for physx::PxParticleBuffer:
[legend]
Collaboration diagram for physx::PxParticleBuffer:
[legend]

Public Member Functions

virtual PxVec4 * getPositionInvMasses () const =0
 Get positions and inverse masses for this particle buffer.
 
virtual PxVec4 * getVelocities () const =0
 Get velocities for this particle buffer.
 
virtual PxU32 * getPhases () const =0
 Get phases for this particle buffer.
 
virtual PxParticleVolume * getParticleVolumes () const =0
 Get particle volumes for this particle buffer.
 
virtual void setNbActiveParticles (PxU32 nbActiveParticles)=0
 Set the number of active particles for this particle buffer.
 
virtual PxU32 getNbActiveParticles () const =0
 Get the number of active particles for this particle buffer.
 
virtual PxU32 getMaxParticles () const =0
 Get the maximum number particles this particle buffer can hold.
 
virtual PxU32 getNbParticleVolumes () const =0
 Get the number of particle volumes in this particle buffer.
 
virtual void setNbParticleVolumes (PxU32 nbParticleVolumes)=0
 Set the number of #PxParticleVolume s for this particle buffer.
 
virtual PxU32 getMaxParticleVolumes () const =0
 Get 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.
 
virtual void setRigidAttachments (PxParticleRigidAttachment *attachments, PxU32 nbAttachments)=0
 Set the particle-rigid body attachments for particles in this particle buffer.
 
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.
 
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.
 
virtual void release ()=0
 Release this buffer and deallocate all the memory.
 
virtual void onParticleSystemDestroy ()=0
 Cleanup helper used in case a particle system is released before the particle buffers have been removed.
 
virtual void setInternalData (void *data)=0
 Reserved for internal use.
 
- Public Member Functions inherited from physx::PxBase
virtual const char * getConcreteTypeName () const =0
 Returns string name of dynamic type.
 
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object.
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag

 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags

 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags.
 
virtual bool isReleasable () const
 Whether the object is subordinate.
 

Public Attributes

PxU32 bufferIndex
 Index of this buffer in the particle system it is assigned to.
 
const PxU32 bufferUniqueId
 Unique index that does not change over the lifetime of a PxParticleBuffer.
 

Protected Member Functions

PX_INLINE PxParticleBuffer (PxU32 uniqueId)
 
PX_INLINE PxParticleBuffer (PxU32 uniqueId, PxType type)
 
- Protected Member Functions inherited from physx::PxBase
PX_INLINE PxBase (PxType concreteType, PxBaseFlags baseFlags)
 Constructor setting concrete type and base flags.
 
PX_INLINE PxBase (PxBaseFlags baseFlags)
 Deserialization constructor setting base flags.
 
virtual ~PxBase ()
 Destructor.
 
virtual bool isKindOf (const char *superClass) const
 Returns whether a given type name matches with the type of this instance.
 
template<class T >
bool typeMatch () const
 

Additional Inherited Members

- Protected Attributes inherited from physx::PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 
PxU32 mBuiltInRefCount
 

Detailed Description

The shared base class for all particle buffers, can be instantiated directly to simulate granular and fluid particles.

See PxPhysics::createParticleBuffer.

A particle buffer is a container that specifies per-particle attributes of a set of particles that will be used during the simulation of a particle system. It exposes direct access to the underlying GPU buffers and is independent of the scene and particle system. Particle buffers can be added/removed from a particle system at any time between simulation steps, and transferred from one particle system to another.

Member Function Documentation

◆ getFlatListStartIndex()

virtual PxU32 physx::PxParticleBuffer::getFlatListStartIndex ( ) const
pure virtual

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.

◆ getMaxParticles()

virtual PxU32 physx::PxParticleBuffer::getMaxParticles ( ) const
pure virtual

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.

◆ getMaxParticleVolumes()

virtual PxU32 physx::PxParticleBuffer::getMaxParticleVolumes ( ) const
pure virtual

Get the maximum number of particle volumes this particle buffer can hold.

See #PxParticleVolume.

Returns
The maximum number of particle volumes this particle buffer can hold.

◆ getNbActiveParticles()

virtual PxU32 physx::PxParticleBuffer::getNbActiveParticles ( ) const
pure virtual

Get the number of active particles for this particle buffer.

Returns
The number of active particles.

◆ getNbParticleVolumes()

virtual PxU32 physx::PxParticleBuffer::getNbParticleVolumes ( ) const
pure virtual

Get the number of particle volumes in this particle buffer.

Returns
The number of #PxParticleVolume s for this particle buffer.

◆ getParticleVolumes()

virtual PxParticleVolume * physx::PxParticleBuffer::getParticleVolumes ( ) const
pure virtual

Get particle volumes for this particle buffer.

See #PxParticleVolume

Returns
A pointer to a device buffer containing the #PxParticleVolume s for this particle buffer.

◆ getPhases()

virtual PxU32 * physx::PxParticleBuffer::getPhases ( ) const
pure virtual

Get phases for this particle buffer.

See #PxParticlePhase

Returns
A pointer to a device buffer containing the per-particle phases for this particle buffer.

◆ getPositionInvMasses()

virtual PxVec4 * physx::PxParticleBuffer::getPositionInvMasses ( ) const
pure virtual

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

◆ getVelocities()

virtual PxVec4 * physx::PxParticleBuffer::getVelocities ( ) const
pure virtual

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

◆ raiseFlags()

virtual void physx::PxParticleBuffer::raiseFlags ( PxParticleBufferFlag::Enum  flags)
pure virtual

Raise dirty flags on this particle buffer to communicate that the corresponding data has been updated by the user.

Parameters
[in]flagsThe flag corresponding to the data that is dirty.

See #PxParticleBufferFlag.

◆ release()

virtual void physx::PxParticleBuffer::release ( )
pure virtual

Release this buffer and deallocate all the memory.

Implements physx::PxBase.

◆ setNbActiveParticles()

virtual void physx::PxParticleBuffer::setNbActiveParticles ( PxU32  nbActiveParticles)
pure virtual

Set the number of active particles for this particle buffer.

Parameters
[in]nbActiveParticlesThe number of active particles.

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.

◆ setNbParticleVolumes()

virtual void physx::PxParticleBuffer::setNbParticleVolumes ( PxU32  nbParticleVolumes)
pure virtual

Set the number of #PxParticleVolume s for this particle buffer.

Parameters
[in]nbParticleVolumesThe number of particle volumes in this particle buffer.

◆ setRigidAttachments()

virtual void physx::PxParticleBuffer::setRigidAttachments ( PxParticleRigidAttachment *  attachments,
PxU32  nbAttachments 
)
pure virtual

Set the particle-rigid body attachments for particles in this particle buffer.

See #PxParticleRigidAttachment

Parameters
[in]attachmentsA device buffer containing #PxParticleRigidAttachment s.
[in]nbAttachmentsThe number of particle-rigid body attachments.

◆ setRigidFilters()

virtual void physx::PxParticleBuffer::setRigidFilters ( PxParticleRigidFilterPair *  filters,
PxU32  nbFilters 
)
pure virtual

Set the #PxParticleRigidFilterPair s for collision filtering of particles in this buffer with rigid bodies.

See #PxParticleRigidFilterPair

Parameters
[in]filtersA device buffer containing #PxParticleRigidFilterPair s.
[in]nbFiltersThe number of particle-rigid body collision filtering pairs.

The documentation for this class was generated from the following file: