Skip to content

PhysicsWorld.ShapeCastAllShapes Method

Definition

Namespace: Brine2D.Physics

Overloads
ShapeCastAllShapes(Vector2, float, float, float, Vector2, float, List<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps an oriented box along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.
ShapeCastAllShapes(Vector2, float, float, float, Vector2, float, Span<ShapeCastHit>, bool, Nullable<PhysicsQueryFilter>) Sweeps an oriented box along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.
ShapeCastAllShapes(Vector2, float, float, float, Vector2, float, Span<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps an oriented box along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.
ShapeCastAllShapes(Vector2, float, Vector2, float, List<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps a circle along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.
ShapeCastAllShapes(Vector2, float, Vector2, float, Span<ShapeCastHit>, bool, Nullable<PhysicsQueryFilter>) Sweeps a circle along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.
ShapeCastAllShapes(Vector2, float, Vector2, float, Span<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps a circle along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.
ShapeCastAllShapes(Vector2, Vector2, float, Vector2, float, List<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps a capsule along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.
ShapeCastAllShapes(Vector2, Vector2, float, Vector2, float, Span<ShapeCastHit>, bool, Nullable<PhysicsQueryFilter>) Sweeps a capsule along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.
ShapeCastAllShapes(Vector2, Vector2, float, Vector2, float, Span<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps a capsule along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.
ShapeCastAllShapes(ReadOnlySpan<Vector2>, Vector2, float, List<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps a convex polygon along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.
ShapeCastAllShapes(ReadOnlySpan<Vector2>, Vector2, float, Span<ShapeCastHit>, bool, Nullable<PhysicsQueryFilter>) Sweeps a convex polygon along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once. Vertices are in world space at the start of the sweep (3–8 vertices).
ShapeCastAllShapes(ReadOnlySpan<Vector2>, Vector2, float, Span<ShapeCastHit>, Nullable<PhysicsQueryFilter>) Sweeps a convex polygon along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once. Vertices are in world space at the start of the sweep (3–8 vertices).

PhysicsWorld.ShapeCastAllShapes(Vector2, float, float, float, Vector2, float, List\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps an oriented box along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.

public void ShapeCastAllShapes(System.Numerics.Vector2 origin, float halfWidth, float halfHeight, float angle, System.Numerics.Vector2 direction, float maxDistance, System.Collections.Generic.List<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

origin System.Numerics.Vector2

halfWidth System.Single

halfHeight System.Single

angle System.Single

direction System.Numerics.Vector2

maxDistance System.Single

results System.Collections.Generic.List<ShapeCastHit>

filter System.Nullable<PhysicsQueryFilter>

PhysicsWorld.ShapeCastAllShapes(Vector2, float, float, float, Vector2, float, Span\<ShapeCastHit>, bool, Nullable\<PhysicsQueryFilter>) Method

Sweeps an oriented box along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.

public int ShapeCastAllShapes(System.Numerics.Vector2 origin, float halfWidth, float halfHeight, float angle, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, out bool wasTruncated, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

origin System.Numerics.Vector2

Center of the box at the start of the sweep in pixel coordinates.

halfWidth System.Single

Half-width of the box in pixels.

halfHeight System.Single

Half-height of the box in pixels.

angle System.Single

Rotation of the box in radians.

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

wasTruncated System.Boolean

Set to true when the results buffer was too small to hold all hits.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.

PhysicsWorld.ShapeCastAllShapes(Vector2, float, float, float, Vector2, float, Span\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps an oriented box along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.

public int ShapeCastAllShapes(System.Numerics.Vector2 origin, float halfWidth, float halfHeight, float angle, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

origin System.Numerics.Vector2

Center of the box at the start of the sweep in pixel coordinates.

halfWidth System.Single

Half-width of the box in pixels.

halfHeight System.Single

Half-height of the box in pixels.

angle System.Single

Rotation of the box in radians.

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.

PhysicsWorld.ShapeCastAllShapes(Vector2, float, Vector2, float, List\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps a circle along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.

public void ShapeCastAllShapes(System.Numerics.Vector2 origin, float radius, System.Numerics.Vector2 direction, float maxDistance, System.Collections.Generic.List<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

origin System.Numerics.Vector2

radius System.Single

direction System.Numerics.Vector2

maxDistance System.Single

results System.Collections.Generic.List<ShapeCastHit>

filter System.Nullable<PhysicsQueryFilter>

PhysicsWorld.ShapeCastAllShapes(Vector2, float, Vector2, float, Span\<ShapeCastHit>, bool, Nullable\<PhysicsQueryFilter>) Method

Sweeps a circle along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.

public int ShapeCastAllShapes(System.Numerics.Vector2 origin, float radius, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, out bool wasTruncated, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

origin System.Numerics.Vector2

Center of the circle at the start of the sweep in pixel coordinates.

radius System.Single

Circle radius in pixels.

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

wasTruncated System.Boolean

Set to true when the results buffer was too small to hold all hits.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.

PhysicsWorld.ShapeCastAllShapes(Vector2, float, Vector2, float, Span\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps a circle along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.

public int ShapeCastAllShapes(System.Numerics.Vector2 origin, float radius, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

origin System.Numerics.Vector2

Center of the circle at the start of the sweep in pixel coordinates.

radius System.Single

Circle radius in pixels.

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.

PhysicsWorld.ShapeCastAllShapes(Vector2, Vector2, float, Vector2, float, List\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps a capsule along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.

public void ShapeCastAllShapes(System.Numerics.Vector2 center1, System.Numerics.Vector2 center2, float radius, System.Numerics.Vector2 direction, float maxDistance, System.Collections.Generic.List<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

center1 System.Numerics.Vector2

center2 System.Numerics.Vector2

radius System.Single

direction System.Numerics.Vector2

maxDistance System.Single

results System.Collections.Generic.List<ShapeCastHit>

filter System.Nullable<PhysicsQueryFilter>

PhysicsWorld.ShapeCastAllShapes(Vector2, Vector2, float, Vector2, float, Span\<ShapeCastHit>, bool, Nullable\<PhysicsQueryFilter>) Method

Sweeps a capsule along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.

public int ShapeCastAllShapes(System.Numerics.Vector2 center1, System.Numerics.Vector2 center2, float radius, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, out bool wasTruncated, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

center1 System.Numerics.Vector2

First capsule center point at the start of the sweep in pixel coordinates.

center2 System.Numerics.Vector2

Second capsule center point at the start of the sweep in pixel coordinates.

radius System.Single

Capsule radius in pixels.

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

wasTruncated System.Boolean

Set to true when the results buffer was too small to hold all hits.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.

PhysicsWorld.ShapeCastAllShapes(Vector2, Vector2, float, Vector2, float, Span\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps a capsule along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once.

public int ShapeCastAllShapes(System.Numerics.Vector2 center1, System.Numerics.Vector2 center2, float radius, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

center1 System.Numerics.Vector2

First capsule center point at the start of the sweep in pixel coordinates.

center2 System.Numerics.Vector2

Second capsule center point at the start of the sweep in pixel coordinates.

radius System.Single

Capsule radius in pixels.

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.

PhysicsWorld.ShapeCastAllShapes(ReadOnlySpan\<Vector2>, Vector2, float, List\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps a convex polygon along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Retries with a larger internal buffer if needed — guaranteed to return every hit. Clears results before writing.

public void ShapeCastAllShapes(System.ReadOnlySpan<System.Numerics.Vector2> vertices, System.Numerics.Vector2 direction, float maxDistance, System.Collections.Generic.List<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

vertices System.ReadOnlySpan<System.Numerics.Vector2>

direction System.Numerics.Vector2

maxDistance System.Single

results System.Collections.Generic.List<ShapeCastHit>

filter System.Nullable<PhysicsQueryFilter>

PhysicsWorld.ShapeCastAllShapes(ReadOnlySpan\<Vector2>, Vector2, float, Span\<ShapeCastHit>, bool, Nullable\<PhysicsQueryFilter>) Method

Sweeps a convex polygon along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once. Vertices are in world space at the start of the sweep (3–8 vertices).

public int ShapeCastAllShapes(System.ReadOnlySpan<System.Numerics.Vector2> vertices, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, out bool wasTruncated, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

vertices System.ReadOnlySpan<System.Numerics.Vector2>

Convex polygon vertices in world space (3–8 vertices).

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

wasTruncated System.Boolean

Set to true when the results buffer was too small to hold all hits.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.

PhysicsWorld.ShapeCastAllShapes(ReadOnlySpan\<Vector2>, Vector2, float, Span\<ShapeCastHit>, Nullable\<PhysicsQueryFilter>) Method

Sweeps a convex polygon along a direction and returns all shape hits (not deduplicated, sorted nearest-first) into results. Compound bodies may appear more than once. Vertices are in world space at the start of the sweep (3–8 vertices).

public int ShapeCastAllShapes(System.ReadOnlySpan<System.Numerics.Vector2> vertices, System.Numerics.Vector2 direction, float maxDistance, System.Span<Brine2D.Physics.ShapeCastHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);

Parameters

vertices System.ReadOnlySpan<System.Numerics.Vector2>

Convex polygon vertices in world space (3–8 vertices).

direction System.Numerics.Vector2

Sweep direction (does not need to be normalized). Must be non-zero.

maxDistance System.Single

Maximum sweep distance in pixels.

results System.Span<ShapeCastHit>

Buffer to receive hits, sorted nearest-first.

filter System.Nullable<PhysicsQueryFilter>

Optional query filter.

Returns

System.Int32
Number of hits written to results.

Exceptions

System.ArgumentException
Thrown when direction is zero.