Physics · const
MAX_BODY_PARTS
The most parts one body may be made of.
Explained in Your first game, Rigid bodies.
const MAX_BODY_PARTS = 32import { MAX_BODY_PARTS } from '@driftengine/physics';In depth
It lives here rather than beside decomposeConvex, and that is a measurement rather than a
preference. It was declared in decompose.ts, which is offline and which nothing in a frame
should reach; importing one integer from there put the whole decomposition — the voxeliser, the
flood fill, the merge, the direction table — into every bundle that touches the physics runtime.
physics-only moved outside its 3% band and an A/B against this one import line was what said so.
A constant about how many shapes a body may hold is a fact about bodies. decompose.ts imports it
from here to cap maxHulls, which is the direction the dependency should have run in from the
start.