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

Method removeCollider

src/systems/CollisionDetectionSystem.cpp:1163–1183  ·  view source on GitHub ↗

Remove a body from the collision detection

Source from the content-addressed store, hash-verified

1161
1162// Remove a body from the collision detection
1163void CollisionDetectionSystem::removeCollider(Collider* collider) {
1164
1165 const int colliderBroadPhaseId = collider->getBroadPhaseId();
1166
1167 assert(colliderBroadPhaseId != -1);
1168 assert(mMapBroadPhaseIdToColliderEntity.containsKey(colliderBroadPhaseId));
1169
1170 // Remove all the overlapping pairs involving this collider
1171 Array<uint64>& overlappingPairs = mCollidersComponents.getOverlappingPairs(collider->getEntity());
1172 while(overlappingPairs.size() > 0) {
1173
1174 // TODO : Remove all the contact manifold of the overlapping pair from the contact manifolds array of the two bodies involved
1175
1176 removeOverlappingPair(overlappingPairs[0], false);
1177 }
1178
1179 mMapBroadPhaseIdToColliderEntity.remove(colliderBroadPhaseId);
1180
1181 // Remove the body from the broad-phase
1182 mBroadPhaseSystem.removeCollider(collider);
1183}
1184
1185// Ray casting method
1186void CollisionDetectionSystem::raycast(RaycastCallback* raycastCallback, const Ray& ray, unsigned short raycastWithCategoryMaskBits) const {

Callers

nothing calls this directly

Calls 5

containsKeyMethod · 0.80
getBroadPhaseIdMethod · 0.45
getEntityMethod · 0.45
sizeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected