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

Method updateHasSimulationCollider

src/body/Body.cpp:466–481  ·  view source on GitHub ↗

Update whether the body has at least one simulation provider

Source from the content-addressed store, hash-verified

464
465// Update whether the body has at least one simulation provider
466void Body::updateHasSimulationCollider() {
467
468 // For each collider of the body
469 const uint32 bodyIndex = mWorld.mBodyComponents.getEntityIndex(mEntity);
470 const Array<Entity>& colliderEntities = mWorld.mBodyComponents.mColliders[bodyIndex];
471 for (uint32 i=0; i < colliderEntities.size(); i++) {
472
473 // Get the currently overlapping pairs for this collider
474 const bool isSimulationCollider = mWorld.mCollidersComponents.getIsSimulationCollider(colliderEntities[i]);
475
476 if (isSimulationCollider) {
477 mWorld.mBodyComponents.mHasSimulationCollider[bodyIndex] = true;
478 return;
479 }
480 }
481}
482
483#ifdef IS_RP3D_PROFILING_ENABLED
484

Callers 1

Calls 3

getEntityIndexMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected