The particle base class represents the shared module for particle based simulation. This class can't be instantiated. More...
#include <PxParticleBase.h>
Public Member Functions | |
virtual void | setParticleBaseFlag (PxParticleBaseFlag::Enum flag, bool val)=0 |
Sets particle system flags. More... | |
virtual PxParticleBaseFlags | getParticleBaseFlags () const =0 |
Returns particle system flags. More... | |
Particle Access and Manipulation | |
virtual PxParticleReadData * | lockParticleReadData (PxDataAccessFlags flags)=0 |
Locks the particle data and provides the data descriptor for accessing the particles. After reading from the buffers the application needs to call PxParticleReadData::unlock() before any SDK operation can access the buffers. Particularly the buffers need to be unlocked before calling PxParticleBase::lockParticleReadData(), PxParticleBase::createParticles(), PxParticleBase::releaseParticles(), PxScene::fetchResults(). More... | |
virtual PxParticleReadData * | lockParticleReadData ()=0 |
Locks the particle read data and provides the data descriptor for accessing the particles. More... | |
virtual bool | createParticles (const PxParticleCreationData &creationData)=0 |
Creates new particles. More... | |
virtual void | releaseParticles (PxU32 numParticles, const PxStrideIterator< const PxU32 > &indexBuffer)=0 |
Releases particles. More... | |
virtual void | releaseParticles ()=0 |
Releases all particles. More... | |
virtual void | setPositions (PxU32 numParticles, const PxStrideIterator< const PxU32 > &indexBuffer, const PxStrideIterator< const PxVec3 > &positionBuffer)=0 |
Sets particle positions. More... | |
virtual void | setVelocities (PxU32 numParticles, const PxStrideIterator< const PxU32 > &indexBuffer, const PxStrideIterator< const PxVec3 > &velocityBuffer)=0 |
Sets particle velocities. More... | |
virtual void | setRestOffsets (PxU32 numParticles, const PxStrideIterator< const PxU32 > &indexBuffer, const PxStrideIterator< const PxF32 > &restOffsetBuffer)=0 |
Sets particle rest offsets. More... | |
virtual void | addForces (PxU32 numParticles, const PxStrideIterator< const PxU32 > &indexBuffer, const PxStrideIterator< const PxVec3 > &forceBuffer, PxForceMode::Enum forceMode)=0 |
Set forces to be applied to the particles when the simulation starts. More... | |
ParticleBase Parameters | |
virtual PxReal | getDamping () const =0 |
Returns the particle system damping. More... | |
virtual void | setDamping (PxReal damp)=0 |
Sets the particle system damping (must be nonnegative). More... | |
virtual PxVec3 | getExternalAcceleration () const =0 |
Returns the external acceleration applied to each particle at each time step. More... | |
virtual void | setExternalAcceleration (const PxVec3 &acceleration)=0 |
Sets the external acceleration applied to each particle at each time step. More... | |
virtual void | getProjectionPlane (PxVec3 &normal, PxReal &distance) const =0 |
Returns the plane the particles are projected to. More... | |
virtual void | setProjectionPlane (const PxVec3 &normal, PxReal distance)=0 |
Sets the plane the particles are projected to. More... | |
Collisions | |
virtual PxReal | getParticleMass () const =0 |
Returns the mass of a particle. More... | |
virtual void | setParticleMass (PxReal mass)=0 |
Sets the mass of a particle. More... | |
virtual PxReal | getRestitution () const =0 |
Returns the restitution used for collision with shapes. More... | |
virtual void | setRestitution (PxReal rest)=0 |
Sets the restitution used for collision with shapes. More... | |
virtual PxReal | getDynamicFriction () const =0 |
Returns the dynamic friction used for collision with shapes. More... | |
virtual void | setDynamicFriction (PxReal friction)=0 |
Sets the dynamic friction used for collision with shapes. More... | |
virtual PxReal | getStaticFriction () const =0 |
Returns the static friction used for collision with shapes. More... | |
virtual void | setStaticFriction (PxReal friction)=0 |
Sets the static friction used for collision with shapes. More... | |
Collision Filtering | |
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... | |
virtual PX_DEPRECATED void | resetFiltering ()=0 |
Marks the object to reset interactions and re-run collision filters in the next simulation step. More... | |
Public Member Functions inherited from PxActor | |
virtual void | release ()=0 |
Deletes the actor. More... | |
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 PxBounds3 | getWorldBounds (float inflation=1.01f) const =0 |
Retrieves the axis aligned bounding box enclosing the actor. 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 | |
virtual const char * | getConcreteTypeName () const |
Returns string name of dynamic type. More... | |
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... | |
ParticleSystem Property Read Back | |
virtual PxU32 | getMaxParticles () const =0 |
Returns the maximum number of particles for this particle system. More... | |
virtual PxReal | getMaxMotionDistance () const =0 |
Returns the maximal motion distance (the particle can move the maximal distance of getMaxMotionDistance() during one timestep). More... | |
virtual void | setMaxMotionDistance (PxReal distance)=0 |
Sets the maximal motion distance (the particle can move the maximal distance during one timestep). Immutable when the particle system is part of a scene. More... | |
virtual PxReal | getRestOffset () const =0 |
Returns the distance between particles and collision geometry, which is maintained during simulation. More... | |
virtual void | setRestOffset (PxReal restOffset)=0 |
Sets the distance between particles and collision geometry, which is maintained during simulation. If per particle restOffsets are used, they need to be in the range [0.0f, restOffset]. Immutable when the particle system is part of a scene. More... | |
virtual PxReal | getContactOffset () const =0 |
Returns the distance at which contacts are generated between particles and collision geometry. More... | |
virtual void | setContactOffset (PxReal contactOffset)=0 |
Sets the distance at which contacts are generated between particles and collision geometry. Immutable when the particle system is part of a scene. More... | |
virtual PxReal | getGridSize () const =0 |
Returns the particle grid size used for internal spatial data structures. More... | |
virtual void | setGridSize (PxReal gridSize)=0 |
Sets the particle grid size used for internal spatial data structures. Immutable when the particle system is part of a scene. The actual grid size used might differ from the grid size set in the setGridSize(). More... | |
virtual PxParticleReadDataFlags | getParticleReadDataFlags () const =0 |
Returns particle read data flags. More... | |
virtual void | setParticleReadDataFlag (PxParticleReadDataFlag::Enum flag, bool val)=0 |
Sets particle read data flags. More... | |
PX_INLINE | PxParticleBase (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxParticleBase (PxBaseFlags baseFlags) |
virtual | ~PxParticleBase () |
virtual bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. More... | |
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 Member Functions inherited from PxActor | |
PX_INLINE | PxActor (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxActor (PxBaseFlags baseFlags) |
virtual | ~PxActor () |
Protected Attributes inherited from PxBase | |
PxType | mConcreteType |
PxBaseFlags | mBaseFlags |
The particle base class represents the shared module for particle based simulation. This class can't be instantiated.
The particle base class manages a set of particles. Particles can be created, released and updated directly through the API. When a particle is created the user gets an index for it which can be used to address the particle until it is released again.
Particles collide with static and dynamic shapes. They are also affected by the scene gravity and a user force, as well as global velocity damping. When a particle collides, a particle flag is raised corresponding to the type of actor, static or dynamic, it collided with. Additionally a shape can be flagged as a drain (See PxShapeFlag), in order to get a corresponding particle flag raised when a collision occurs. This information can be used to delete particles.
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
|
pure virtual |
Set forces to be applied to the particles when the simulation starts.
This call is ignored on particle system that aren't assigned to a scene.
numParticles | Number of particle updates. |
indexBuffer | Structure describing indices of particles that should be updated. (Has to be consistent with numParticles). |
forceBuffer | Structure describing values for particle updates depending on forceMode. (Has to be consistent with numParticles). |
forceMode | Describes type of update. |
|
pure virtual |
Creates new particles.
The PxParticleCreationData descriptor is used to create new particles based on the provided PxParticleCreationData. Providing particle indices and positions is mandatory. Indices need to be consistent with the available particle slots within the range [0, maxParticles-1]. The new particles can be immediately read from the application readable particle data, PxParticleReadData.
creationData | specifies particle attributes for the particles to be created. (all buffers set have to be consistent with numParticles). |
|
pure virtual |
Returns the distance at which contacts are generated between particles and collision geometry.
|
pure virtual |
Returns the particle system damping.
|
pure virtual |
Returns the dynamic friction used for collision with shapes.
|
pure virtual |
Returns the external acceleration applied to each particle at each time step.
|
pure virtual |
Returns the particle grid size used for internal spatial data structures.
The actual grid size used might differ from the grid size set in the setGridSize().
|
pure virtual |
Returns the maximal motion distance (the particle can move the maximal distance of getMaxMotionDistance() during one timestep).
|
pure virtual |
Returns the maximum number of particles for this particle system.
|
pure virtual |
Returns particle system flags.
|
pure virtual |
Returns the mass of a particle.
|
pure virtual |
Returns particle read data flags.
|
pure virtual |
Returns the plane the particles are projected to.
[out] | normal | Particle projection plane normal |
[out] | distance | Particle projection plane constant term |
|
pure virtual |
Returns the restitution used for collision with shapes.
|
pure virtual |
Returns the distance between particles and collision geometry, which is maintained during simulation.
|
pure virtual |
Retrieves the object's collision filter data.
|
pure virtual |
Returns the static friction used for collision with shapes.
|
inlineprotectedvirtual |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxActor.
Reimplemented in PxParticleFluid, and PxParticleSystem.
References PxActor::isKindOf().
Referenced by PxParticleSystem::isKindOf(), and PxParticleFluid::isKindOf().
|
pure virtual |
Locks the particle data and provides the data descriptor for accessing the particles. After reading from the buffers the application needs to call PxParticleReadData::unlock() before any SDK operation can access the buffers. Particularly the buffers need to be unlocked before calling PxParticleBase::lockParticleReadData(), PxParticleBase::createParticles(), PxParticleBase::releaseParticles(), PxScene::fetchResults().
flags | If PxDataAccessFlag::eDEVICE is specified for GPU particles then pointers to GPU memory will be returned otherwise it will be ignored. |
|
pure virtual |
Locks the particle read data and provides the data descriptor for accessing the particles.
|
pure virtual |
Releases particles.
Particles corresponding to passed indices are released. Releasing a particle will immediately mark the particle in the application readable particle data, PxParticleReadData, as being invalid, removing PxParticleFlag::eVALID. Passing duplicate indices is not allowed.
numParticles | Number of particles to be released. |
indexBuffer | Structure describing indices of particles that should be deleted. (Has to be consistent with numParticles). |
|
pure virtual |
Releases all particles.
Application readable particle data is updated accordingly.
|
pure virtual |
Marks the object to reset interactions and re-run collision filters in the next simulation step.
|
pure virtual |
Sets the distance at which contacts are generated between particles and collision geometry. Immutable when the particle system is part of a scene.
contactOffset | New contactOffset value. |
|
pure virtual |
Sets the particle system damping (must be nonnegative).
damp | The new particle system damping. |
|
pure virtual |
Sets the dynamic friction used for collision with shapes.
Must be between 0 and 1.
friction | The new dynamic friction |
|
pure virtual |
Sets the external acceleration applied to each particle at each time step.
acceleration | External acceleration to apply to particles. |
|
pure virtual |
Sets the particle grid size used for internal spatial data structures. Immutable when the particle system is part of a scene. The actual grid size used might differ from the grid size set in the setGridSize().
gridSize | New gridSize value. |
|
pure virtual |
Sets the maximal motion distance (the particle can move the maximal distance during one timestep). Immutable when the particle system is part of a scene.
distance | New Max motionDistance value. |
|
pure virtual |
Sets particle system flags.
flag | Member of PxParticleBaseFlag. |
val | New flag value. |
|
pure virtual |
Sets the mass of a particle.
mass | The particle mass. |
|
pure virtual |
Sets particle read data flags.
flag | Member of PxParticleReadDataFlag. |
val | New flag value. |
|
pure virtual |
Sets particle positions.
Directly sets the positions of particles. The supplied positions are used to change particles in the order of the indices listed in the index buffer. Duplicate indices are allowed. A position buffer of stride zero is allowed. Application readable particle data is updated accordingly.
numParticles | Number of particle updates. |
indexBuffer | Structure describing indices of particles that should be updated. (Has to be consistent with numParticles). |
positionBuffer | Structure describing positions for position updates. (Has to be consistent with numParticles). |
|
pure virtual |
Sets the plane the particles are projected to.
Points p on the plane have to fulfill the equation:
(normal.x * p.x) + (normal.y * p.y) + (normal.z * p.z) + d = 0
[in] | normal | Particle projection plane normal |
[in] | distance | Particle projection plane constant term |
|
pure virtual |
Sets the restitution used for collision with shapes.
Must be between 0 and 1.
rest | The new restitution. |
|
pure virtual |
Sets the distance between particles and collision geometry, which is maintained during simulation. If per particle restOffsets are used, they need to be in the range [0.0f, restOffset]. Immutable when the particle system is part of a scene.
restOffset | New restOffset value. |
|
pure virtual |
Sets particle rest offsets.
Directly sets the rest offsets of particles. The supplied rest offsets are used to change particles in the order of the indices listed in the index buffer. The provided offsets need to be in the range [0.0f, restOffset]. Duplicate indices are allowed. A rest offset buffer of stride zero is allowed. Application readable particle data is updated accordingly.
numParticles | Number of particle updates. |
indexBuffer | Structure describing indices of particles that should be updated. (Has to be consistent with numParticles). |
restOffsetBuffer | Structure describing rest offsets for rest offset updates. (Has to be consistent with numParticles). |
|
pure virtual |
Sets the user definable collision filter data.
|
pure virtual |
Sets the static friction used for collision with shapes.
Must be non-negative.
friction | The new static friction |
|
pure virtual |
Sets particle velocities.
Directly sets the velocities of particles. The supplied velocities are used to change particles in the order of the indices listed in the index buffer. Duplicate indices are allowed. A velocity buffer of stride zero is allowed. Application readable particle data is updated accordingly.
numParticles | Number of particle updates. |
indexBuffer | Structure describing indices of particles that should be updated. (Has to be consistent with numParticles). |
velocityBuffer | Structure describing velocities for velocity updates. (Has to be consistent with numParticles). |