overlapShape
overlapShape(
source,options): readonlyOverlapResult[]
Each entity whose colliders shape overlaps where it stands now, once
however many of its colliders it overlaps, in order of entity id: a
sword’s arc, a blast’s reach, a goal mouth. Touching counts. It samples
the shape where it is, so an arc that must hit all it swept through
overlaps at several poses along the swing, or casts its blade with
castShape. An empty list where it overlaps none. Pooled, as
castRay’s result is.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
QuerySource |
options |
OverlapShapeOptions |
Returns
Section titled “Returns”readonly OverlapResult[]
Example
Section titled “Example”for (const struck of overlapShape(step, { shape: box({ size: [1.6, 0.4, 1.2] }), position: tip, rotation: swing })) strike(struck.entity);