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

Simulation event

Whenever a rigid body overlaps with a trigger shape, or when two rigid bodies collide with each other, a function callback is called, providing the required filter shader. These simulation events can be received by inheriting the PxSimulationEventCallback class. This is basically an interface class that helps us listen to simulation events. Once you create a derived class from the PxSimulationEventCallback class, an instance of it is used to register the simulation callback in PhysX.

The code snippet for registering the simulation event callback is as follows:

// sceneDesc is an instance of 'PxSceneDesc'
sceneDesc.simulationEventCallback = &gContactReportCallback;

In this example, sceneDesc is the instance of the PxSceneDesc class, ...

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