Physics · function
shapecastWorld
Sweep a shape from one point to another and report the first body it touches.
Explained in Your first game, Rigid bodies.
function shapecastWorld(bodies: BodySet, tree: DynamicTree, shape: ConvexShape, pose: ShapePose, dx: number, dy: number, dz: number, out: RayHit, filter?: QueryFilter): booleanimport { shapecastWorld } from '@driftengine/physics';Parameters
| Parameter | Type | Description |
|---|---|---|
bodies | BodySet | |
tree | DynamicTree | |
shape | ConvexShape | |
pose | ShapePose | |
dx | number | |
dy | number | |
dz | number | |
out | RayHit | |
filter? | QueryFilter |
In depth
Conservative advancement: step by the current separation, which cannot overshoot a contact, and stop after a fixed number of steps. A fixed count rather than a tolerance, because §3a forbids iterating to one.