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, ...