#include <PxFiltering.h>
Public Member Functions | |
virtual PxFilterFlags | pairFound (PxU32 pairID, PxFilterObjectAttributes attributes0, PxFilterData filterData0, const PxActor *a0, const PxShape *s0, PxFilterObjectAttributes attributes1, PxFilterData filterData1, const PxActor *a1, const PxShape *s1, PxPairFlags &pairFlags)=0 |
Filter method to specify how a pair of potentially colliding objects should be processed. | |
virtual void | pairLost (PxU32 pairID, PxFilterObjectAttributes attributes0, PxFilterData filterData0, PxFilterObjectAttributes attributes1, PxFilterData filterData1, bool objectRemoved)=0 |
Callback to inform that a tracked collision pair is gone. | |
virtual bool | statusChange (PxU32 &pairID, PxPairFlags &pairFlags, PxFilterFlags &filterFlags)=0 |
Callback to give the opportunity to change the filter state of a tracked collision pair. | |
Protected Member Functions | |
virtual | ~PxSimulationFilterCallback () |
This class is provided to implement more complex and flexible collision pair filtering logic, for instance, taking the state of the user application into account. Filter callbacks also give the user the opportunity to track collision pairs and update their filter state.
You might want to check the documentation on PxSimulationFilterShader as well since it includes more general information on filtering.
The callbacks may execute in user threads or simulation threads, possibly simultaneously. The corresponding objects may have been deleted by the application earlier in the frame. It is the application's responsibility to prevent race conditions arising from using the SDK API in the callback while an application thread is making write calls to the scene, and to ensure that the callbacks are thread-safe. Return values which depend on when the callback is called during the frame will introduce nondeterminism into the simulation.
virtual PxSimulationFilterCallback::~PxSimulationFilterCallback | ( | ) | [inline, protected, virtual] |
virtual PxFilterFlags PxSimulationFilterCallback::pairFound | ( | PxU32 | pairID, | |
PxFilterObjectAttributes | attributes0, | |||
PxFilterData | filterData0, | |||
const PxActor * | a0, | |||
const PxShape * | s0, | |||
PxFilterObjectAttributes | attributes1, | |||
PxFilterData | filterData1, | |||
const PxActor * | a1, | |||
const PxShape * | s1, | |||
PxPairFlags & | pairFlags | |||
) | [pure virtual] |
Filter method to specify how a pair of potentially colliding objects should be processed.
This method gets called when the filter flags returned by the filter shader (see PxSimulationFilterShader) indicate that the filter callback should be invoked (PxFilterFlag::eCALLBACK or PxFilterFlag::eNOTIFY set). Return the PxFilterFlag flags and set the PxPairFlag flags to define what the simulation should do with the given collision pair.
[in] | pairID | Unique ID of the collision pair used to issue filter status changes for the pair (see statusChange()) |
[in] | attributes0 | The filter attribute of the first object |
[in] | filterData0 | The custom filter data of the first object |
[in] | a0 | Actor pointer of the first object |
[in] | s0 | Shape pointer of the first object (NULL if the object has no shapes, for example in the case of a particle system) |
[in] | attributes1 | The filter attribute of the second object |
[in] | filterData1 | The custom filter data of the second object |
[in] | a1 | Actor pointer of the second object |
[in] | s1 | Shape pointer of the second object (NULL if the object has no shapes, for example in the case of a particle system) |
[in,out] | pairFlags | In: Pair flags returned by the filter shader. Out: Additional information on how an accepted pair should get processed |
virtual void PxSimulationFilterCallback::pairLost | ( | PxU32 | pairID, | |
PxFilterObjectAttributes | attributes0, | |||
PxFilterData | filterData0, | |||
PxFilterObjectAttributes | attributes1, | |||
PxFilterData | filterData1, | |||
bool | objectRemoved | |||
) | [pure virtual] |
Callback to inform that a tracked collision pair is gone.
This method gets called when a collision pair disappears or gets re-filtered. Only applies to collision pairs which have been marked as filter callback pairs (PxFilterFlag::eNOTIFY set in pairFound()).
[in] | pairID | Unique ID of the collision pair that disappeared |
[in] | attributes0 | The filter attribute of the first object |
[in] | filterData0 | The custom filter data of the first object |
[in] | attributes1 | The filter attribute of the second object |
[in] | filterData1 | The custom filter data of the second object |
[in] | objectRemoved | True if the pair was lost because one of the objects got removed from the scene |
virtual bool PxSimulationFilterCallback::statusChange | ( | PxU32 & | pairID, | |
PxPairFlags & | pairFlags, | |||
PxFilterFlags & | filterFlags | |||
) | [pure virtual] |
Callback to give the opportunity to change the filter state of a tracked collision pair.
This method gets called once per simulation step to let the application change the filter and pair flags of a collision pair that has been reported in pairFound() and requested callbacks by setting PxFilterFlag::eNOTIFY. To request a change of filter status, the target pair has to be specified by its ID, the new filter and pair flags have to be provided and the method should return true.
The application is responsible to ensure that this method does not get called for pairs that have been reported as lost, see pairLost().
[out] | pairID | ID of the collision pair for which the filter status should be changed |
[out] | pairFlags | The new pairFlags to apply to the collision pair |
[out] | filterFlags | The new filterFlags to apply to the collision pair |