Disable an overlapping pair (because both bodies of the pair are disabled)
| 268 | |
| 269 | // Disable an overlapping pair (because both bodies of the pair are disabled) |
| 270 | void OverlappingPairs::disablePair(uint64 pairId) { |
| 271 | |
| 272 | RP3D_PROFILE("OverlappingPairs::disablePair()", mProfiler); |
| 273 | |
| 274 | assert(!isPairDisabled(pairId)); |
| 275 | assert(mMapConvexPairIdToPairIndex.find(pairId) != mMapConvexPairIdToPairIndex.end() || |
| 276 | mMapConcavePairIdToPairIndex.find(pairId) != mMapConcavePairIdToPairIndex.end()); |
| 277 | |
| 278 | // Get the existing overlapping pair from the convex/concave array |
| 279 | auto it = mMapConvexPairIdToPairIndex.find(pairId); |
| 280 | if (it != mMapConvexPairIdToPairIndex.end()) { |
| 281 | |
| 282 | // Disable the pair |
| 283 | disableConvexPairWithIndex(it->second); |
| 284 | } |
| 285 | else { |
| 286 | it = mMapConcavePairIdToPairIndex.find(pairId); |
| 287 | if (it != mMapConcavePairIdToPairIndex.end()) { |
| 288 | |
| 289 | // Disable the pair |
| 290 | disableConcavePairWithIndex(it->second); |
| 291 | } |
| 292 | else { |
| 293 | // Should not happen |
| 294 | assert(false); |
| 295 | return; |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | // Enable a convex overlapping pair |
| 301 | void OverlappingPairs::enableConvexPairWithIndex(uint64 pairIndex) { |
no test coverage detected