Public Member Functions | List of all members
PxParticleBase Class Referenceabstract

The particle base class represents the shared module for particle based simulation. This class can't be instantiated. More...

#include <PxParticleBase.h>

Inheritance diagram for PxParticleBase:
Inheritance graph
[legend]
Collaboration diagram for PxParticleBase:
Collaboration graph
[legend]

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 PxParticleReadDatalockParticleReadData (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 PxParticleReadDatalockParticleReadData ()=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 PxClothisCloth ()
 
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 PxScenegetScene () 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 PxAggregategetAggregate () 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
 

Detailed Description

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.

See Also
PxParticleCreationData, PxParticleReadData, PxShapeFlag, PxParticleSystem, PxParticleFluid

Constructor & Destructor Documentation

PX_INLINE PxParticleBase::PxParticleBase ( PxType  concreteType,
PxBaseFlags  baseFlags 
)
inlineprotected
PX_INLINE PxParticleBase::PxParticleBase ( PxBaseFlags  baseFlags)
inlineprotected
virtual PxParticleBase::~PxParticleBase ( )
inlineprotectedvirtual

Member Function Documentation

virtual void PxParticleBase::addForces ( PxU32  numParticles,
const PxStrideIterator< const PxU32 > &  indexBuffer,
const PxStrideIterator< const PxVec3 > &  forceBuffer,
PxForceMode::Enum  forceMode 
)
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.

Parameters
numParticlesNumber of particle updates.
indexBufferStructure describing indices of particles that should be updated. (Has to be consistent with numParticles).
forceBufferStructure describing values for particle updates depending on forceMode. (Has to be consistent with numParticles).
forceModeDescribes type of update.
virtual bool PxParticleBase::createParticles ( const PxParticleCreationData creationData)
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.

Parameters
creationDataspecifies particle attributes for the particles to be created. (all buffers set have to be consistent with numParticles).
Returns
whether the operation was successful.
See Also
PxParticleCreationData, PxParticleReadData, PxParticlesExt.IndexPool
virtual PxReal PxParticleBase::getContactOffset ( ) const
pure virtual

Returns the distance at which contacts are generated between particles and collision geometry.

Returns
contact offset.
virtual PxReal PxParticleBase::getDamping ( ) const
pure virtual

Returns the particle system damping.

Returns
The particle system damping.
virtual PxReal PxParticleBase::getDynamicFriction ( ) const
pure virtual

Returns the dynamic friction used for collision with shapes.

Returns
The dynamic friction.
virtual PxVec3 PxParticleBase::getExternalAcceleration ( ) const
pure virtual

Returns the external acceleration applied to each particle at each time step.

Returns
The external acceleration applied to particles.
virtual PxReal PxParticleBase::getGridSize ( ) const
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().

Returns
The grid size.
virtual PxReal PxParticleBase::getMaxMotionDistance ( ) const
pure virtual

Returns the maximal motion distance (the particle can move the maximal distance of getMaxMotionDistance() during one timestep).

Returns
maximum motion distance.
virtual PxU32 PxParticleBase::getMaxParticles ( ) const
pure virtual

Returns the maximum number of particles for this particle system.

Returns
Max number of particles for this particle system.
virtual PxParticleBaseFlags PxParticleBase::getParticleBaseFlags ( ) const
pure virtual

Returns particle system flags.

Returns
The current flag values.
virtual PxReal PxParticleBase::getParticleMass ( ) const
pure virtual

Returns the mass of a particle.

Returns
Particle mass.
virtual PxParticleReadDataFlags PxParticleBase::getParticleReadDataFlags ( ) const
pure virtual

Returns particle read data flags.

Returns
The particle read data flags.
See Also
PxParticleReadDataFlags
virtual void PxParticleBase::getProjectionPlane ( PxVec3 normal,
PxReal distance 
) const
pure virtual

Returns the plane the particles are projected to.

Parameters
[out]normalParticle projection plane normal
[out]distanceParticle projection plane constant term
virtual PxReal PxParticleBase::getRestitution ( ) const
pure virtual

Returns the restitution used for collision with shapes.

Returns
The restitution.
virtual PxReal PxParticleBase::getRestOffset ( ) const
pure virtual

Returns the distance between particles and collision geometry, which is maintained during simulation.

Returns
rest offset.
virtual PxFilterData PxParticleBase::getSimulationFilterData ( ) const
pure virtual

Retrieves the object's collision filter data.

See Also
setSimulationFilterData()
virtual PxReal PxParticleBase::getStaticFriction ( ) const
pure virtual

Returns the static friction used for collision with shapes.

Returns
The static friction.
virtual bool PxParticleBase::isKindOf ( const char *  superClass) const
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().

virtual PxParticleReadData* PxParticleBase::lockParticleReadData ( PxDataAccessFlags  flags)
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().

Parameters
flagsIf PxDataAccessFlag::eDEVICE is specified for GPU particles then pointers to GPU memory will be returned otherwise it will be ignored.
Note
PxDataAccessFlag::eWRITEABLE is not supported and will be ignored
If using PxDataAccessFlag::eDEVICE, newly created particles will not become visible in the GPU buffers until a subsequent simulation step has completed
See Also
PxParticleReadData
virtual PxParticleReadData* PxParticleBase::lockParticleReadData ( )
pure virtual

Locks the particle read data and provides the data descriptor for accessing the particles.

Note
This method does the same as lockParticleReadData(PxDataAccessFlags::eREADABLE)
See Also
PxParticleReadData
virtual void PxParticleBase::releaseParticles ( PxU32  numParticles,
const PxStrideIterator< const PxU32 > &  indexBuffer 
)
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.

Parameters
numParticlesNumber of particles to be released.
indexBufferStructure describing indices of particles that should be deleted. (Has to be consistent with numParticles).
See Also
PxParticleReadData
virtual void PxParticleBase::releaseParticles ( )
pure virtual

Releases all particles.

Application readable particle data is updated accordingly.

virtual PX_DEPRECATED void PxParticleBase::resetFiltering ( )
pure virtual

Marks the object to reset interactions and re-run collision filters in the next simulation step.

Deprecated:
Note
This method has been deprecated. Please use PxScene::resetFiltering() instead.
virtual void PxParticleBase::setContactOffset ( PxReal  contactOffset)
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.

Parameters
contactOffsetNew contactOffset value.
virtual void PxParticleBase::setDamping ( PxReal  damp)
pure virtual

Sets the particle system damping (must be nonnegative).

Parameters
dampThe new particle system damping.
virtual void PxParticleBase::setDynamicFriction ( PxReal  friction)
pure virtual

Sets the dynamic friction used for collision with shapes.

Must be between 0 and 1.

Parameters
frictionThe new dynamic friction
virtual void PxParticleBase::setExternalAcceleration ( const PxVec3 acceleration)
pure virtual

Sets the external acceleration applied to each particle at each time step.

Parameters
accelerationExternal acceleration to apply to particles.
See Also
getExternalAcceleration()
virtual void PxParticleBase::setGridSize ( PxReal  gridSize)
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().

Parameters
gridSizeNew gridSize value.
virtual void PxParticleBase::setMaxMotionDistance ( PxReal  distance)
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.

Parameters
distanceNew Max motionDistance value.
virtual void PxParticleBase::setParticleBaseFlag ( PxParticleBaseFlag::Enum  flag,
bool  val 
)
pure virtual

Sets particle system flags.

Parameters
flagMember of PxParticleBaseFlag.
valNew flag value.
virtual void PxParticleBase::setParticleMass ( PxReal  mass)
pure virtual

Sets the mass of a particle.

Parameters
massThe particle mass.
virtual void PxParticleBase::setParticleReadDataFlag ( PxParticleReadDataFlag::Enum  flag,
bool  val 
)
pure virtual

Sets particle read data flags.

Parameters
flagMember of PxParticleReadDataFlag.
valNew flag value.
See Also
PxParticleReadDataFlags
virtual void PxParticleBase::setPositions ( PxU32  numParticles,
const PxStrideIterator< const PxU32 > &  indexBuffer,
const PxStrideIterator< const PxVec3 > &  positionBuffer 
)
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.

Parameters
numParticlesNumber of particle updates.
indexBufferStructure describing indices of particles that should be updated. (Has to be consistent with numParticles).
positionBufferStructure describing positions for position updates. (Has to be consistent with numParticles).
virtual void PxParticleBase::setProjectionPlane ( const PxVec3 normal,
PxReal  distance 
)
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

Parameters
[in]normalParticle projection plane normal
[in]distanceParticle projection plane constant term
virtual void PxParticleBase::setRestitution ( PxReal  rest)
pure virtual

Sets the restitution used for collision with shapes.

Must be between 0 and 1.

Parameters
restThe new restitution.
virtual void PxParticleBase::setRestOffset ( PxReal  restOffset)
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.

Parameters
restOffsetNew restOffset value.
virtual void PxParticleBase::setRestOffsets ( PxU32  numParticles,
const PxStrideIterator< const PxU32 > &  indexBuffer,
const PxStrideIterator< const PxF32 > &  restOffsetBuffer 
)
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.

Parameters
numParticlesNumber of particle updates.
indexBufferStructure describing indices of particles that should be updated. (Has to be consistent with numParticles).
restOffsetBufferStructure describing rest offsets for rest offset updates. (Has to be consistent with numParticles).
See Also
PxParticleBaseFlag.ePER_PARTICLE_REST_OFFSET
virtual void PxParticleBase::setSimulationFilterData ( const PxFilterData data)
pure virtual

Sets the user definable collision filter data.

See Also
getSimulationFilterData()
virtual void PxParticleBase::setStaticFriction ( PxReal  friction)
pure virtual

Sets the static friction used for collision with shapes.

Must be non-negative.

Parameters
frictionThe new static friction
virtual void PxParticleBase::setVelocities ( PxU32  numParticles,
const PxStrideIterator< const PxU32 > &  indexBuffer,
const PxStrideIterator< const PxVec3 > &  velocityBuffer 
)
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.

Parameters
numParticlesNumber of particle updates.
indexBufferStructure describing indices of particles that should be updated. (Has to be consistent with numParticles).
velocityBufferStructure describing velocities for velocity updates. (Has to be consistent with numParticles).

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


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com