29#ifndef PX_PARTICLE_EXT_H
30#define PX_PARTICLE_EXT_H
35#include "PxParticleSystem.h"
36#include "PxParticleBuffer.h"
37#include "foundation/PxArray.h"
38#include "foundation/PxHashMap.h"
39#include "foundation/PxUserAllocated.h"
40#include "PxAttachment.h"
59 PxU32 numActiveParticles;
64 PxParticleBufferDesc() : positions(NULL), velocities(NULL), phases(NULL), volumes(NULL), numActiveParticles(0), maxParticles(0), numVolumes(0), maxVolumes(0) { }
73 PxU32 maxDiffuseParticles;
74 PxU32 maxActiveDiffuseParticles;
84 PxParticleRigidDesc() : rigidOffsets(NULL), rigidCoefficients(NULL), rigidTranslations(NULL), rigidRotations(NULL),
85 rigidLocalPositions(NULL), rigidLocalNormals(NULL), maxRigids(0), numActiveRigids(0) { }
88 PxReal* rigidCoefficients;
91 PxVec4* rigidLocalPositions;
94 PxU32 numActiveRigids;
105 virtual void release() = 0;
130 const PxU32* triangles,
const PxU32 numTriangles,
131 const PxParticleSpring* springs,
const PxU32 numSprings,
const PxVec4* restPositions,
const PxU32 numParticles) = 0;
151 virtual void addCloth(
const PxReal blendScale,
const PxReal restVolume,
const PxReal pressure,
152 const PxU32* triangles,
const PxU32 numTriangles,
153 const PxParticleSpring* springs,
const PxU32 numSprings,
154 const PxVec4* restPositions,
const PxU32 numParticles) = 0;
185 virtual void release() = 0;
214 virtual void addVolume(
const PxU32 particleOffset,
const PxU32 numParticles,
const PxU32* triangles,
const PxU32 numTriangles) = 0;
227 virtual void release() = 0;
245 const PxVec4* localPositions,
const PxVec4* localNormals, PxU32 numParticles) = 0;
275 PxU32 mNumDeviceAttachments;
276 PxU32 mNumDeviceFilters;
278 PxCudaContextManager* mCudaContextManager;
294 bool removeRigidAttachment(
PxRigidActor* rigidBody,
const PxU32 particleID);
295 void addRigidFilter(
PxRigidActor* rigidBody,
const PxU32 particleID);
296 bool removeRigidFilter(
PxRigidActor* rigidBody,
const PxU32 particleID);
298 void copyToDevice(CUstream stream = 0);
310PxParticleRigidBufferHelper* PxCreateParticleRigidBufferHelper(PxU32 maxRigids, PxU32 maxParticles, PxCudaContextManager* cudaContextManager);
323PxParticleClothBufferHelper* PxCreateParticleClothBufferHelper(
const PxU32 maxCloths,
const PxU32 maxTriangles,
const PxU32 maxSprings,
const PxU32 maxParticles, PxCudaContextManager* cudaContextManager);
334PxParticleVolumeBufferHelper* PxCreateParticleVolumeBufferHelper(PxU32 maxVolumes, PxU32 maxTriangles, PxCudaContextManager* cudaContextManager);
384 PxCudaContextManager* cudaContextManager);
Holds user-defined attachment data to attach particles to other bodies.
Definition PxParticleExt.h:264
Helper class to manage PxParticleClothDesc buffers used for communicating particle based cloths to Px...
Definition PxParticleExt.h:103
virtual PxU32 getNumTriangles() const =0
virtual PxU32 getMaxSprings() const =0
virtual void addCloth(const PxParticleCloth &particleCloth, const PxU32 *triangles, const PxU32 numTriangles, const PxParticleSpring *springs, const PxU32 numSprings, const PxVec4 *restPositions, const PxU32 numParticles)=0
Adds a PxParticleCloth to this PxParticleClothBufferHelper instance.
virtual PxU32 getMaxTriangles() const =0
virtual PxU32 getNumSprings() const =0
virtual PxParticleClothDesc & getParticleClothDesc()=0
Returns a PxParticleClothDesc for this PxParticleClothBufferHelper instance to be used for spring par...
virtual PxU32 getMaxCloths() const =0
virtual PxU32 getNumParticles() const =0
virtual void addCloth(const PxReal blendScale, const PxReal restVolume, const PxReal pressure, const PxU32 *triangles, const PxU32 numTriangles, const PxParticleSpring *springs, const PxU32 numSprings, const PxVec4 *restPositions, const PxU32 numParticles)=0
Adds a cloth to this PxParticleClothBufferHelper instance.
virtual PxU32 getNumCloths() const =0
virtual PxU32 getMaxParticles() const =0
Helper class to manage PxParticleRigidDesc buffers used for communicating particle based rigids to Px...
Definition PxParticleExt.h:225
virtual PxU32 getMaxParticles() const =0
virtual PxU32 getMaxRigids() const =0
virtual PxU32 getNumRigids() const =0
virtual void addRigid(const PxVec3 &translation, const PxQuat &rotation, const PxReal coefficient, const PxVec4 *localPositions, const PxVec4 *localNormals, PxU32 numParticles)=0
Adds a rigid.
virtual PxU32 getNumParticles() const =0
virtual PxParticleRigidDesc & getParticleRigidDesc()=0
Get the PxParticleRigidDesc for this buffer.
Helper class to manage communicating PxParticleVolumes data to PxParticleBuffer.
Definition PxParticleExt.h:183
virtual PxParticleVolumeMesh * getParticleVolumeMeshes()=0
virtual PxU32 * getTriangles()=0
virtual PxU32 getNumTriangles() const =0
virtual PxU32 getNumVolumes() const =0
virtual PxU32 getMaxTriangles() const =0
virtual PxParticleVolume * getParticleVolumes()=0
virtual PxU32 getMaxVolumes() const =0
virtual void addVolume(const PxParticleVolume &volume, const PxParticleVolumeMesh &volumeMesh, const PxU32 *triangles, const PxU32 numTriangles)=0
Adds a PxParticleVolume with a PxParticleVolumeMesh.
virtual void addVolume(const PxU32 particleOffset, const PxU32 numParticles, const PxU32 *triangles, const PxU32 numTriangles)=0
Adds a volume.
Parameters to configure the behavior of diffuse particles.
Definition PxParticleBuffer.h:238
Definition PxHashMap.h:78
A particle buffer used to simulate diffuse particles.
Definition PxParticleBuffer.h:283
The shared base class for all particle buffers, can be instantiated directly to simulate granular and...
Definition PxParticleBuffer.h:81
A particle buffer used to simulate particle cloth.
Definition PxParticleBuffer.h:429
A particle buffer used to simulate rigid bodies using shape matching with particles.
Definition PxParticleBuffer.h:491
The shared base class for all particle systems.
Definition PxParticleSystem.h:137
This is a quaternion class. For more information on quaternion mathematics consult a mathematics sour...
Definition PxQuat.h:50
PxRigidActor represents a base class shared between dynamic and static rigid bodies in the physics SD...
Definition PxRigidActor.h:53
Definition PxUserAllocated.h:43
3 Element vector class.
Definition PxVec3.h:50
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Structure to define user-defined particle state when constructing a new particle system that includes...
Definition PxParticleExt.h:71
Structure to define user-defined particle state when constructing a new particle system.
Definition PxParticleExt.h:54
Structure to define user-defined particle state when constructing a new particle system that includes...
Definition PxParticleExt.h:83
Helper struct that holds information about a specific mesh in a PxParticleVolumeBufferHelper.
Definition PxParticleExt.h:174
PxU32 count
The number of triangles of this mesh.
Definition PxParticleExt.h:176
PxU32 startIndex
The index of the first triangle of this mesh in the triangle array of the PxParticleVolumeBufferHelpe...
Definition PxParticleExt.h:175
A constraint descriptor for limiting movement to a conical region.
Definition PxConeLimitedConstraint.h:48
Structure to describe the set of particle cloths in the same #PxParticleClothBuffer....
Definition PxParticleBuffer.h:372
Particle cloth structure. Holds information about a single piece of cloth that is part of a #PxPartic...
Definition PxParticleBuffer.h:352
Struct to specify attachment between a particle/vertex and a rigid.
Definition PxAttachment.h:49
Struct for storing a particle/vertex - rigid filter pair with comparison operators.
Definition PxFiltering.h:751
Particle volume structure. Used to track the bounding volume of a user-specified set of particles....
Definition PxParticleBuffer.h:64
Structure to describe the output of the particle cloth preprocessing. Used as an input to specify clo...
Definition PxParticleBuffer.h:395