PxDefaultSimulationFilterShader#
Defined in include/extensions/PxDefaultSimulationFilterShader.h
- PxFilterFlags PxDefaultSimulationFilterShader(
- PxFilterObjectAttributes attributes0,
- PxFilterData filterData0,
- PxFilterObjectAttributes attributes1,
- PxFilterData filterData1,
- PxPairFlags &pairFlags,
- const void *constantBlock,
- PxU32 constantBlockSize,
Implementation of a simple filter shader that emulates PhysX 2.8.x filtering.
This shader provides the following logic:
If one of the two filter objects is a trigger, the pair is acccepted and PxPairFlag::eTRIGGER_DEFAULT will be used for trigger reports
Else, if the filter mask logic (see further below) discards the pair it will be suppressed (PxFilterFlag::eSUPPRESS)
Else, the pair gets accepted and collision response gets enabled (PxPairFlag::eCONTACT_DEFAULT)
Each actor can belong to a single collision group. Use PxSetGroup to set the group of an actor and PxGetGroup to retrieve the group of an actor. A collision group is an integer value between 0 and 31 defining which group the actor belongs to. Because that value is written to an actor’s shapes internally (it is stored in the shapes’ PxFilterData), this feature does not work with shared shapes, unless they all belong to actors whose groups are similar. For example it would not work to share a shape between actors A and B, and then assign A to group 0 and B to group 1, as they would both internally try to write different group values to the same shape.1) Collision groups of the pair are enabled 2) Collision filtering equation is satisfied
Once actors are assigned to groups, it is possible to define how groups collide with each-other using the PxSetGroupCollisionFlag function. Use this function to set a simple boolean value per group pairs, defining if the corresponding groups should collide. If not, collisions between actors of these non-colliding groups will be automatically disabled by the PxDefaultSimulationFilterShader.
See also
PxSimulationFilterShader PxGetGroupCollisionFlag PxSetGroupCollisionFlag PxGetGroup PxSetGroup