29#ifndef PX_PARTICLE_SYSTEM_H
30#define PX_PARTICLE_SYSTEM_H
34#include "foundation/PxSimpleTypes.h"
37#include "PxFiltering.h"
38#include "PxParticleSystemFlag.h"
40#include "cudamanager/PxCudaTypes.h"
49#pragma warning(disable : 4435)
52class PxCudaContextManager;
53class PxGpuParticleSystem;
55class PxParticleAndDiffuseBuffer;
56class PxParticleBuffer;
57class PxParticleMaterial;
63template <
typename Type>
69 PxGpuMirroredPointer(Type* devicePtr, Type* hostPtr) : mDevicePtr(devicePtr), mHostPtr(hostPtr) { }
127typedef PxFlags<PxParticleFlag::Enum, PxU32> PxParticleFlags;
436 PX_INLINE PxParticleSystem(PxBaseFlags baseFlags) : PxActor(baseFlags) {}
PxActor is the base class for the main simulation objects in the physics SDK.
Definition PxActor.h:201
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition PxActor.h:368
The shared base class for all particle buffers, can be instantiated directly to simulate granular and...
Definition PxParticleBuffer.h:81
Material class to represent a set of particle material properties.
Definition PxParticleMaterial.h:50
Particle system callback base class to schedule work that should be done before, while or after the p...
Definition PxParticleSystem.h:77
virtual void onPostSolve(const PxGpuMirroredPointer< PxGpuParticleSystem > &gpuParticleSystem, CUstream stream)=0
Method gets called after the particle system simulation step completed.
virtual ~PxParticleSystemCallback()
Destructor.
Definition PxParticleSystem.h:109
virtual void onAdvance(const PxGpuMirroredPointer< PxGpuParticleSystem > &gpuParticleSystem, CUstream stream)=0
Method gets called when the simulation step of the particle system is performed.
virtual void onBegin(const PxGpuMirroredPointer< PxGpuParticleSystem > &gpuParticleSystem, CUstream stream)=0
Method gets called when dirty data from the particle system is uploated to the gpu.
The shared base class for all particle systems.
Definition PxParticleSystem.h:137
virtual void addRigidAttachment(PxRigidActor *actor)=0
Creates a rigid attachment between a particle and a rigid actor.
virtual void setSimulationFilterData(const PxFilterData &data)=0
Set collision filter settings.
virtual PxU32 getNbParticleMaterials() const =0
Returns number of particle materials.
virtual bool isKindOf(const char *name) const PX_OVERRIDE
Returns whether a given type name matches with the type of this instance.
Definition PxParticleSystem.h:437
virtual PxReal getContactOffset() const =0
Return the contact offset.
virtual void setMaxVelocity(PxReal maxVelocity)=0
Set the maximal velocity particles can reach.
virtual PxParticleFlags getParticleFlags() const =0
Retrieves the particle flags.
virtual void setMaxDepenetrationVelocity(PxReal maxDepenetrationVelocity)=0
Set the maximal depenetration velocity particles can reach.
virtual PxU32 createPhase(PxParticleMaterial *material, PxParticlePhaseFlags flags)=0
Creates combined particle flag with particle material and particle phase flags.
virtual PxParticleSystemCallback * getParticleSystemCallback() const =0
Retrieves the simulationEventCallback pointer set with setSimulationEventCallback().
virtual void removeRigidAttachment(PxRigidActor *actor)=0
Removes a rigid attachment between a particle and a rigid body.
virtual PxReal getMaxDepenetrationVelocity()=0
Retrieves maximal depenetration velocity a particle can have.
virtual PxCudaContextManager * getCudaContextManager() const =0
Return the cuda context manager.
virtual PxReal getSolidRestOffset() const =0
Return the solid rest offset.
virtual PxVec3 getPeriodicBoundary() const =0
Gets periodic boundary wrap value.
virtual void addParticleBuffer(PxParticleBuffer *particleBuffer)=0
Add an existing particle buffer to the particle system.
virtual void getSolverIterationCounts(PxU32 &minPositionIters, PxU32 &minVelocityIters) const =0
Retrieves the solver iteration counts.
virtual PxFilterData getSimulationFilterData() const =0
Retrieves the collision filter settings.
virtual void enableCCD(bool enable)=0
Enable continuous collision detection for particles.
virtual void setParticleContactOffset(PxReal particleContactOffset)=0
Set the contact offset for the interactions between particles.
virtual PxReal getParticleContactOffset() const =0
Return the particle contact offset.
virtual PxU32 getGpuParticleSystemIndex()=0
Returns the GPU particle system index.
virtual PxReal getMaxVelocity()=0
Retrieves maximal velocity a particle can have.
virtual void setContactOffset(PxReal contactOffset)=0
Set the contact offset for the collision between particles and rigids or soft bodies.
virtual void setSolidRestOffset(PxReal solidRestOffset)=0
Set the solid rest offset.
virtual void setParticleFlags(PxParticleFlags flags)=0
Set particle flags.
virtual void setParticleSystemCallback(PxParticleSystemCallback *callback)=0
Sets a user notify object which receives special simulation events when they occur.
virtual void setPeriodicBoundary(const PxVec3 &boundary)=0
Sets periodic boundary wrap value.
virtual void setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters=1)=0
Sets the solver iteration counts for the body.
virtual void removeParticleBuffer(PxParticleBuffer *particleBuffer)=0
Remove particle buffer from the particle system.
virtual void setRestOffset(PxReal restOffset)=0
Set the rest offset for the collision between particles and rigids or soft bodies.
virtual PxReal getRestOffset() const =0
Return the rest offset.
virtual void setParticleFlag(PxParticleFlag::Enum flag, bool val)=0
Set particle flag.
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
3 Element vector class.
Definition PxVec3.h:50
#define PX_OVERRIDE
Definition PxPreprocessor.h:375
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PxFilterData is user-definable data which gets passed into the collision filtering shader and/or call...
Definition PxFiltering.h:365
Container to hold a pair of corresponding device and host pointers. These pointers should point to GP...
Definition PxParticleSystem.h:65
Flags which control the behaviour of a particle system.
Definition PxParticleSystem.h:118
Enum
Definition PxParticleSystem.h:120
@ eDISABLE_SELF_COLLISION
Disables particle self-collision.
Definition PxParticleSystem.h:121
@ eFULL_DIFFUSE_ADVECTION
Enables full advection of diffuse particles. By default, diffuse particles are advected only by parti...
Definition PxParticleSystem.h:123
@ eDISABLE_RIGID_COLLISION
Disables particle-rigid body collision.
Definition PxParticleSystem.h:122