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

Filter shader

The filter shader in PhysX is used for collision filtering, and to customize the collection of flags describing the actions to take on a collision pair, such as whether to report the collision of rigid bodies or not. PhysX 3 also provides a default implementation of the filter shader using the PxDefaultSimulationFilterShader class, which basically emulates the PhysX 2.8.x collision filtering. The PhysX filter shader basically customizes the collection of flags defined in the PxPairFlag structure. We can use it to customize the callback events of the PhysX simulation that we are interested in.

The code snippet of a user-defined filter shader is as follows:

PxFilterFlags contactReportFilterShader(PxFilterObjectAttributes attributes0, ...

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