Physics · function

prepareContact

Turn one manifold into a constraint, with its effective masses and its local anchors.

Explained in Your first game, Rigid bodies.

function prepareContact(bodies: BodySet, a: number, b: number, m: Manifold, c: ContactConstraints, warmNormal: Float32Array | null, warmT1: Float32Array | null, warmT2: Float32Array | null): void
import { prepareContact } from '@driftengine/physics';

Parameters

ParameterTypeDescription
bodiesBodySet
anumber
bnumber
mManifold
cContactConstraints
warmNormalFloat32Array | null
warmT1Float32Array | null
warmT2Float32Array | null

In depth

warm supplies the previous tick's impulses by feature id, or −1 where there is none. Warm starting is what lets a stack converge in a handful of iterations rather than a hundred.