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

Method computeBroadPhase

src/systems/CollisionDetectionSystem.cpp:103–121  ·  view source on GitHub ↗

Compute the broad-phase collision detection

Source from the content-addressed store, hash-verified

101
102// Compute the broad-phase collision detection
103void 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
124void CollisionDetectionSystem::removeNonOverlappingPairs() {

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected