Instrumentation · interface
ContactReport
What is around a box, in numbers a person can check.
Explained in In-game tools.
interface ContactReportimport type { ContactReport } from '@driftengine/core';In depth
A development tool, not a physics path: collide.ts already resolves contacts and
is tuned to do it without allocating. This answers a different question — which
colliders are here, and by how much — for a diagnostic that runs when somebody
presses a key, so it favours being readable over being fast.
Signed depth per axis rather than a single distance, because the two failures worth telling apart look identical otherwise: a body 5 cm inside a deck and a body 5 cm above one are both "5 cm from a collider".
Properties
| Name | Type | Description |
|---|---|---|
index | number | |
hull | boolean | True where the collider is a hull; its box is then the broad phase only. |
minX | number | |
minY | number | |
minZ | number | |
maxX | number | |
maxY | number | |
maxZ | number | |
depthX | number | Overlap along the axis. Positive is penetration, negative is the gap. |
depthY | number | |
depthZ | number | |
distanceM | number | Straight line between the boxes. Zero exactly when all three axes overlap. |