INNER CODE UNIT · JavaScript
radius
MageStudio/Mage · src/physics/index.js:402
const radius = Math.max(size.width, size.height, size.length) / 2;
shape.radius = options.colliderRadius != null ? options.colliderRadius : radius;
} else {
shape.width = options.colliderWidth != null ? options.colliderWidth : size.width;
shape.height = options.colliderHeight != null ? options.colliderHeight : size.height;
shape.length = options.colliderLength != null ? options.colliderLength : size.length;
}
// A hull is defined by its geometry, so the measured box above is kept
// only as the shape's AABB — it still sizes CCD and drives the childMap
// region test — while `points` carries the actual shape to the worker.
if (colliderType === COLLIDER_TYPES.MODEL_SHAPE) {
const points = extractHullPoints(body, worldCenter, worldQuat, excluded);
if (points) {
shape.points = points;
} else {
// No geometry to wrap (an empty holder, or fully coplanar