MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / CallbackData

Method CallbackData

src/collision/OverlapCallback.cpp:70–92  ·  view source on GitHub ↗

CollisionCallbackData Constructor

Source from the content-addressed store, hash-verified

68
69// CollisionCallbackData Constructor
70OverlapCallback::CallbackData::CallbackData(Array<ContactPair>& contactPairs, Array<ContactPair>& lostContactPairs, bool onlyReportTriggers, PhysicsWorld& world)
71 :mContactPairs(contactPairs), mLostContactPairs(lostContactPairs),
72 mContactPairsIndices(world.mMemoryManager.getHeapAllocator()), mLostContactPairsIndices(world.mMemoryManager.getHeapAllocator()), mWorld(world) {
73
74 // Filter the contact pairs to only keep the overlap/trigger events (not the contact events)
75 const uint64 nbContactPairs = mContactPairs.size();
76 for (uint64 i=0; i < nbContactPairs; i++) {
77
78 // If the contact pair contains contacts (and is therefore not an overlap/trigger event)
79 if (!onlyReportTriggers || mContactPairs[i].isTrigger) {
80 mContactPairsIndices.add(i);
81 }
82 }
83 // Filter the lost contact pairs to only keep the overlap/trigger events (not the contact events)
84 const uint64 nbLostContactPairs = mLostContactPairs.size();
85 for (uint64 i=0; i < nbLostContactPairs; i++) {
86
87 // If the contact pair contains contacts (and is therefore not an overlap/trigger event)
88 if (!onlyReportTriggers || mLostContactPairs[i].isTrigger) {
89 mLostContactPairsIndices.add(i);
90 }
91 }
92}

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected