Remove a body from the collision detection
| 1161 | |
| 1162 | // Remove a body from the collision detection |
| 1163 | void 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 |
| 1186 | void CollisionDetectionSystem::raycast(RaycastCallback* raycastCallback, const Ray& ray, unsigned short raycastWithCategoryMaskBits) const { |
nothing calls this directly
no test coverage detected