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

Method removePair

src/engine/OverlappingPairs.cpp:77–107  ·  view source on GitHub ↗

Remove an overlapping pair

Source from the content-addressed store, hash-verified

75
76// Remove an overlapping pair
77void OverlappingPairs::removePair(uint64 pairId) {
78
79 RP3D_PROFILE("OverlappingPairs::removePair()", mProfiler);
80
81 assert(mMapConvexPairIdToPairIndex.containsKey(pairId) || mMapConcavePairIdToPairIndex.containsKey(pairId) ||
82 mMapDisabledConvexPairIdToPairIndex.containsKey(pairId) || mMapDisabledConcavePairIdToPairIndex.containsKey(pairId));
83
84 auto it = mMapConvexPairIdToPairIndex.find(pairId);
85 if (it != mMapConvexPairIdToPairIndex.end()) {
86 removeConvexPairWithIndex(it->second, true);
87 return;
88 }
89
90 auto it2 = mMapConcavePairIdToPairIndex.find(pairId);
91 if (it2 != mMapConcavePairIdToPairIndex.end()) {
92 removeConcavePairWithIndex(it2->second, true);
93 return;
94 }
95
96 auto it3 = mMapDisabledConvexPairIdToPairIndex.find(pairId);
97 if (it3 != mMapDisabledConvexPairIdToPairIndex.end()) {
98 removeDisabledConvexPairWithIndex(it3->second, true);
99 return;
100 }
101
102 auto it4 = mMapDisabledConcavePairIdToPairIndex.find(pairId);
103 if (it4 != mMapDisabledConcavePairIdToPairIndex.end()) {
104 removeDisabledConcavePairWithIndex(it4->second, true);
105 return;
106 }
107}
108
109// Remove an disabled convex overlapping pair
110void OverlappingPairs::removeDisabledConvexPairWithIndex(uint64 pairIndex, bool removeFromColliders) {

Callers 1

removeOverlappingPairMethod · 0.80

Calls 3

containsKeyMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected