Update the broad-phase state for this body (because it has moved for instance)
| 220 | |
| 221 | // Update the broad-phase state for this body (because it has moved for instance) |
| 222 | void Body::updateBroadPhaseState() const { |
| 223 | |
| 224 | // For all the colliders of the body |
| 225 | const Array<Entity>& colliderEntities = mWorld.mBodyComponents.getColliders(mEntity); |
| 226 | const uint32 nbColliderEntities = static_cast<uint32>(colliderEntities.size()); |
| 227 | for (uint32 i=0; i < nbColliderEntities; i++) { |
| 228 | |
| 229 | // Update the local-to-world transform of the collider |
| 230 | mWorld.mCollidersComponents.setLocalToWorldTransform(colliderEntities[i], |
| 231 | mWorld.mTransformComponents.getTransform(mEntity) * |
| 232 | mWorld.mCollidersComponents.getLocalToBodyTransform(colliderEntities[i])); |
| 233 | |
| 234 | // Update the collider |
| 235 | mWorld.mCollisionDetection.updateCollider(colliderEntities[i]); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | // Set whether or not the body is active |
| 240 | /** |
nothing calls this directly
no test coverage detected