Compute the broad-phase collision detection
| 101 | |
| 102 | // Compute the broad-phase collision detection |
| 103 | void CollisionDetectionSystem::computeBroadPhase() { |
| 104 | |
| 105 | RP3D_PROFILE("CollisionDetectionSystem::computeBroadPhase()", mProfiler); |
| 106 | |
| 107 | assert(mBroadPhaseOverlappingNodes.size() == 0); |
| 108 | |
| 109 | // Ask the broad-phase to compute all the shapes overlapping with the shapes that |
| 110 | // have moved or have been added in the last frame. This call can only add new |
| 111 | // overlapping pairs in the collision detection. |
| 112 | mBroadPhaseSystem.computeOverlappingPairs(mMemoryManager, mBroadPhaseOverlappingNodes); |
| 113 | |
| 114 | // Create new overlapping pairs if necessary |
| 115 | updateOverlappingPairs(mBroadPhaseOverlappingNodes); |
| 116 | |
| 117 | // Remove non overlapping pairs |
| 118 | removeNonOverlappingPairs(); |
| 119 | |
| 120 | mBroadPhaseOverlappingNodes.clear(); |
| 121 | } |
| 122 | |
| 123 | // Remove pairs that are not overlapping anymore |
| 124 | void CollisionDetectionSystem::removeNonOverlappingPairs() { |
nothing calls this directly
no test coverage detected