Physics · function
collideShapes
Fill out and return whether the shapes are within margin of touching.
Explained in Your first game, Rigid bodies.
function collideShapes(shapeA: ConvexShape, poseA: ShapePose, shapeB: ConvexShape, poseB: ShapePose, margin: number, out: Manifold): booleanimport { collideShapes } from '@driftengine/physics';Parameters
| Parameter | Type | Description |
|---|---|---|
shapeA | ConvexShape | |
poseA | ShapePose | |
shapeB | ConvexShape | |
poseB | ShapePose | |
margin | number | |
out | Manifold |
In depth
A positive separation inside the margin is a speculative contact: the constraint will permit approach up to exactly that gap and no further, which is what gives continuous collision without a separate time-of-impact pass.