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): voidimport { prepareContact } from '@driftengine/physics';Parameters
| Parameter | Type | Description |
|---|---|---|
bodies | BodySet | |
a | number | |
b | number | |
m | Manifold | |
c | ContactConstraints | |
warmNormal | Float32Array | null | |
warmT1 | Float32Array | null | |
warmT2 | Float32Array | 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.