INNER CODE UNIT · JavaScript
shapes
MageStudio/Mage · src/physics/index.js:548
const shapes = shaped.flatMap(element =>
this.buildCompoundShapes(element, rootWorldPos, invRootQuat, colliderBodies),
);
const options = root.getPhysicsOptions() || {};
// Continuous collision detection radius for a dynamic compound: sized from
// the THINNEST leaf so a fast body can't tunnel through the smallest
// shape. Matches the single-body box/sphere CCD (a lone box/sphere now
// realizes as a one-shape compound, so it must keep its CCD here).
const ccdRadius = shapes.reduce((min, s) => {
const r =
s.radius != null
? s.radius
: Math.min(s.width || 1, s.height || 1, s.length || 1) / 2;
return Math.min(min, r);
}, Infinity);