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): number
import { overlapWorld } from '@driftengine/physics';

Parameters

ParameterTypeDescription
bodiesBodySet
treeDynamicTree
shapeConvexShape
poseShapePose
outInt32Array
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.