A single Support struct (one hidden class) is filled once per collision pair, then
getSupport — a single, monomorphic function — is called many times per pair by GJK/EPA.
The per-shape polymorphism lives entirely in the fill (cold, once per pair); the hot path is one
function with a switch on kind.
Radius contract:
convexRadius is the reported radius. getSupport never adds it; the collision driver
reads it and passes it to gjkClosestPoints/EPA for the shrunk-core-plus-radius distance math.
addRadius is an extra radius added along the (local) direction by getSupport itself (the EPA
speculative-separation / cast convex radius). 0 on the GJK path.
"mode" (include vs exclude convex radius) is baked into the params by the fill: exclude uses the
shrunk core + reports convexRadius; include uses the full/rounded core + convexRadius = 0.
Monomorphic support evaluation.
A single Support struct (one hidden class) is filled once per collision pair, then getSupport — a single, monomorphic function — is called many times per pair by GJK/EPA. The per-shape polymorphism lives entirely in the fill (cold, once per pair); the hot path is one function with a
switchonkind.Radius contract:
convexRadiusis the reported radius.getSupportnever adds it; the collision driver reads it and passes it togjkClosestPoints/EPA for the shrunk-core-plus-radius distance math.addRadiusis an extra radius added along the (local) direction bygetSupportitself (the EPA speculative-separation / cast convex radius). 0 on the GJK path.convexRadius; include uses the full/rounded core +convexRadius = 0.