Physics · function
overlapWorld
Every body overlapping a shape at a pose. Fills out to its length and returns how many.
Explained in Your first game, Rigid bodies.
function overlapWorld(bodies: BodySet, tree: DynamicTree, shape: ConvexShape, pose: ShapePose, out: Int32Array, filter?: QueryFilter): numberimport { overlapWorld } from '@driftengine/physics';Parameters
| Parameter | Type | Description |
|---|---|---|
bodies | BodySet | |
tree | DynamicTree | |
shape | ConvexShape | |
pose | ShapePose | |
out | Int32Array | |
filter? | QueryFilter |
In depth
A return equal to out.length means the buffer filled, and the caller has been told about that
many rather than about all of them. Returning the true total instead would invite a loop over
entries that were never written.