PxContactPairIndex
Defined in include/PxSimulationEventCallback.h
-
struct PxContactPairIndex : public PxContactPairExtraDataItem
Marker for the beginning of a new item set in the extra data stream.
If CCD with multiple passes is enabled, then a fast moving object might bounce on and off the same object multiple times. Also, different shapes of the same actor might gain and lose contact with an other object over multiple passes. This marker allows to separate the extra data items for each collision case, as well as distinguish the shape pair reports of different CCD passes.
Example: Let us assume that an actor a0 with shapes s0_0 and s0_1 hits another actor a1 with shape s1. First s0_0 will hit s1, then a0 will slightly rotate and s0_1 will hit s1 while s0_0 will lose contact with s1. Furthermore, let us say that contact event pose information is requested as extra data. The extra data stream will look like this:
PxContactPairIndexA | PxContactPairPoseA | PxContactPairIndexB | PxContactPairPoseB
The corresponding array of PxContactPair events (see PxSimulationEventCallback.onContact()) will look like this:
PxContactPair(touch_found: s0_0, s1) | PxContactPair(touch_lost: s0_0, s1) | PxContactPair(touch_found: s0_1, s1)
The index of PxContactPairIndexA will point to the first entry in the PxContactPair array, for PxContactPairIndexB, index will point to the third entry.
See also
Public Functions
-
inline PxContactPairIndex()
-
inline PxContactPairIndex()