|
RavEngine
|
Filter callback to specify handling of collision pairs. More...
#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. | |
Filter callback to specify handling of collision pairs.
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.
|
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) |
| [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) |
| [in,out] | pairFlags | In: Pair flags returned by the filter shader. Out: Additional information on how an accepted pair should get processed |
|
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 |
|
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.
| [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 |