O'Reilly logo

Learning Physics Modeling with PhysX by Krishna Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Releasing particles

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);

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required