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

Shutting down PhysX

Now that our PhysX simulation is done, we need to destroy the PhysX related objects and release the memory.

Calling the PxScene::release() method will remove all actors, particle systems, and constraint shaders from the scene. Calling PxPhysics::release() will shut down the entire physics. Soon after, you may want to call PxFoundation::release() to release the foundation object, as follows:

void ShutdownPhysX() 
{
  gScene->release();
  gPhysicsSDK->release();
  gFoundation->release();
}

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