Particles can be released by using the
PxParticleBase::releaseParticles() function, which require two parameters. The first parameter is of the
Px32 type and holds the count of particles that have to be released. The second parameter is of the
PxStrideIterator<PxU32> type and describes the indices of particles that should be deleted. The indices always have to be consistent with the particle count. We can also use the same function without any parameter, which will release all particles in a PhysX scene.
//ps is the instance of PxParticleSystem or PxParticleFluid ps->releaseParticles(numParticles,indexBuffer);