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

Method enableConvexPairWithIndex

src/engine/OverlappingPairs.cpp:301–322  ·  view source on GitHub ↗

Enable a convex overlapping pair

Source from the content-addressed store, hash-verified

299
300// Enable a convex overlapping pair
301void OverlappingPairs::enableConvexPairWithIndex(uint64 pairIndex) {
302
303 RP3D_PROFILE("OverlappingPairs::enableConvexPairWithIndex()", mProfiler);
304
305 ConvexOverlappingPair* pair = &(mDisabledConvexPairs[static_cast<uint32>(pairIndex)]);
306
307 assert(!pair->isEnabled);
308
309 const uint64 newPairIndex = mConvexPairs.size();
310
311 // Map the entity with the new pair lookup index
312 mMapConvexPairIdToPairIndex.add(Pair<uint64, uint64>(pair->pairID, newPairIndex));
313
314 // Create a new pair to be added into the array of pairs
315 mConvexPairs.emplace(pair->pairID, pair->broadPhaseId1, pair->broadPhaseId2, pair->collider1, pair->collider2,
316 pair->narrowPhaseAlgorithmType, true);
317 mConvexPairs[newPairIndex].collidingInCurrentFrame = pair->collidingInCurrentFrame;
318 mConvexPairs[newPairIndex].collidingInPreviousFrame = pair->collidingInPreviousFrame;
319
320 // Remove the previous overlapping pair from the convex array
321 removeDisabledConvexPairWithIndex(pairIndex, false);
322}
323
324// Disable a convex overlapping pair (because both bodies of the pair are disabled)
325void OverlappingPairs::disableConvexPairWithIndex(uint64 pairIndex) {

Callers

nothing calls this directly

Calls 3

emplaceMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected