Skip to content

PhysicsWorld.OverlapPolygonShapes Method

Definition

Namespace: Brine2D.Physics

Overloads
OverlapPolygonShapes(ReadOnlySpan<Vector2>, Span<OverlapHit>, bool, Nullable<PhysicsQueryFilter>) Returns all shape hits (one per shape) overlapping the given convex polygon, written into results. Vertices are in world space (3–8 vertices).
OverlapPolygonShapes(ReadOnlySpan<Vector2>, Span<OverlapHit>, Nullable<PhysicsQueryFilter>) Returns all shape hits (one per shape) overlapping the given convex polygon, written into results. Vertices are in world space (3–8 vertices).

PhysicsWorld.OverlapPolygonShapes(ReadOnlySpan\<Vector2>, Span\<OverlapHit>, bool, Nullable\<PhysicsQueryFilter>) Method

Returns all shape hits (one per shape) overlapping the given convex polygon, written into results. Vertices are in world space (3–8 vertices).

public int OverlapPolygonShapes(System.ReadOnlySpan<System.Numerics.Vector2> vertices, System.Span<Brine2D.Physics.OverlapHit> results, out bool wasTruncated, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

vertices System.ReadOnlySpan<System.Numerics.Vector2>

Convex polygon vertices in world space.

results System.Span<OverlapHit>

Buffer to receive results.

wasTruncated System.Boolean

Set to true when the internal collection buffer was too small.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of results written.

Exceptions

System.ArgumentOutOfRangeException
Thrown when vertex count is outside 3–8.

PhysicsWorld.OverlapPolygonShapes(ReadOnlySpan\<Vector2>, Span\<OverlapHit>, Nullable\<PhysicsQueryFilter>) Method

Returns all shape hits (one per shape) overlapping the given convex polygon, written into results. Vertices are in world space (3–8 vertices).

public int OverlapPolygonShapes(System.ReadOnlySpan<System.Numerics.Vector2> vertices, System.Span<Brine2D.Physics.OverlapHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

vertices System.ReadOnlySpan<System.Numerics.Vector2>

Convex polygon vertices in world space.

results System.Span<OverlapHit>

Buffer to receive results.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of results written.

Exceptions

System.ArgumentOutOfRangeException
Thrown when vertex count is outside 3–8.