Public Member Functions | Protected Member Functions | List of all members
PxParticleFluid Class Referenceabstract

The particle fluid class represents the main module for particle based fluid simulation. SPH (Smoothed Particle Hydrodynamics) is used to animate the particles. This class inherits the properties of the PxParticleBase class and adds particle-particle interactions. More...

#include <PxParticleFluid.h>

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

Public Member Functions

virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type. More...
 
Particle Access and Manipulation
virtual PxParticleFluidReadDatalockParticleFluidReadData (PxDataAccessFlags flags)=0
 Locks the particle data and provides the data descriptor for accessing the particles including fluid particle densities. More...
 
virtual PxParticleFluidReadDatalockParticleFluidReadData ()=0
 Locks the particle data and provides the data descriptor for accessing the particles including fluid particle densities. More...
 
Particle Fluid Parameters
virtual PxReal getStiffness () const =0
 Returns the fluid stiffness. More...
 
virtual void setStiffness (PxReal stiffness)=0
 Sets the fluid stiffness (must be positive). More...
 
virtual PxReal getViscosity () const =0
 Returns the fluid viscosity. More...
 
virtual void setViscosity (PxReal viscosity)=0
 Sets the fluid viscosity (must be positive). More...
 
virtual void setRestParticleDistance (PxReal restParticleDistance)=0
 Sets the typical distance of particles in the relaxed state of the fluid. More...
 
Particle Fluid Property Read Back
virtual PxReal getRestParticleDistance () const =0
 Returns the typical distance of particles in the relaxed state of the fluid. More...
 
- Public Member Functions inherited from PxParticleBase
virtual void setParticleBaseFlag (PxParticleBaseFlag::Enum flag, bool val)=0
 Sets particle system flags. More...
 
virtual PxParticleBaseFlags getParticleBaseFlags () const =0
 Returns particle system flags. More...
 
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...
 
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...
 
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...
 
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...
 
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...
 
- 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
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 PxParticleFluid (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxParticleFluid (PxBaseFlags baseFlags)
 
virtual ~PxParticleFluid ()
 
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 PxParticleBase
PX_INLINE PxParticleBase (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxParticleBase (PxBaseFlags baseFlags)
 
virtual ~PxParticleBase ()
 

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 Attributes inherited from PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 

Detailed Description

The particle fluid class represents the main module for particle based fluid simulation. SPH (Smoothed Particle Hydrodynamics) is used to animate the particles. This class inherits the properties of the PxParticleBase class and adds particle-particle interactions.

There are two kinds of particle interaction forces which govern the behaviour of the fluid:

  1. Pressure forces: These forces result from particle densities higher than the "rest density" of the fluid. The rest density is given by specifying the inter-particle distance at which the fluid is in its relaxed state. Particles which are closer than the rest spacing are pushed away from each other.
  2. Viscosity forces: These forces act on neighboring particles depending on the difference of their velocities. Particles drag other particles with them which is used to simulate the viscous behaviour of the fluid.

For a good introduction to SPH fluid simulation, see http://www.matthiasmueller.info/publications/sca03.pdf

See Also
PxParticleBase, PxParticleFluidReadData, PxPhysics.createParticleFluid

Constructor & Destructor Documentation

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

Member Function Documentation

virtual const char* PxParticleFluid::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Reimplemented from PxBase.

virtual PxReal PxParticleFluid::getRestParticleDistance ( ) const
pure virtual

Returns the typical distance of particles in the relaxed state of the fluid.

Returns
Rest particle distance.
virtual PxReal PxParticleFluid::getStiffness ( ) const
pure virtual

Returns the fluid stiffness.

Returns
The fluid stiffness.
virtual PxReal PxParticleFluid::getViscosity ( ) const
pure virtual

Returns the fluid viscosity.

Returns
The viscosity of the fluid.
virtual bool PxParticleFluid::isKindOf ( const char *  superClass) const
inlineprotectedvirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from PxParticleBase.

References PxParticleBase::isKindOf().

virtual PxParticleFluidReadData* PxParticleFluid::lockParticleFluidReadData ( PxDataAccessFlags  flags)
pure virtual

Locks the particle data and provides the data descriptor for accessing the particles including fluid particle densities.

Note
Only PxDataAccessFlag::eREADABLE and PxDataAccessFlag::eDEVICE are supported, PxDataAccessFlag::eWRITABLE will be ignored.
See Also
PxParticleFluidReadData
PxParticleBase::lockParticleReadData()
virtual PxParticleFluidReadData* PxParticleFluid::lockParticleFluidReadData ( )
pure virtual

Locks the particle data and provides the data descriptor for accessing the particles including fluid particle densities.

Note
This is the same as calling lockParticleFluidReadData(PxDataAccessFlag::eREADABLE).
See Also
PxParticleFluidReadData
PxParticleBase::lockParticleReadData()
virtual void PxParticleFluid::setRestParticleDistance ( PxReal  restParticleDistance)
pure virtual

Sets the typical distance of particles in the relaxed state of the fluid.

Parameters
restParticleDistanceThe new restParticleDistance of the fluid.
virtual void PxParticleFluid::setStiffness ( PxReal  stiffness)
pure virtual

Sets the fluid stiffness (must be positive).

Parameters
stiffnessThe new fluid stiffness.
virtual void PxParticleFluid::setViscosity ( PxReal  viscosity)
pure virtual

Sets the fluid viscosity (must be positive).

Parameters
viscosityThe new viscosity of the fluid.

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