PhysicsWorld.OverlapBox Method
Definition
Namespace: Brine2D.Physics
| Overloads | |
|---|---|
| OverlapBox\(Vector2, float, float, float, Span<OverlapHit>, bool, Nullable<PhysicsQueryFilter>\) | Returns all bodies \(deduplicated by body\) overlapping the given oriented box, written into results. Use OverlapBoxShapes\(Vector2, float, float, float, Span<OverlapHit>, bool, Nullable<PhysicsQueryFilter>\) for per-shape granularity. |
| OverlapBox\(Vector2, float, float, float, Span<OverlapHit>, Nullable<PhysicsQueryFilter>\) | Returns all bodies \(deduplicated by body\) overlapping the given oriented box, written into results. Use OverlapBoxShapes\(Vector2, float, float, float, Span<OverlapHit>, bool, Nullable<PhysicsQueryFilter>\) for per-shape granularity. |
PhysicsWorld.OverlapBox\(Vector2, float, float, float, Span\<OverlapHit\>, bool, Nullable\<PhysicsQueryFilter\>\) Method
Returns all bodies \(deduplicated by body\) overlapping the given oriented box, written into results. Use OverlapBoxShapes\(Vector2, float, float, float, Span<OverlapHit>, bool, Nullable<PhysicsQueryFilter>\) for per-shape granularity.
public int OverlapBox(System.Numerics.Vector2 center, float halfWidth, float halfHeight, float angle, System.Span<Brine2D.Physics.OverlapHit> results, out bool wasTruncated, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);
Parameters
center System.Numerics.Vector2
Box center 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.
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.
PhysicsWorld.OverlapBox\(Vector2, float, float, float, Span\<OverlapHit\>, Nullable\<PhysicsQueryFilter\>\) Method
Returns all bodies \(deduplicated by body\) overlapping the given oriented box, written into results. Use OverlapBoxShapes\(Vector2, float, float, float, Span<OverlapHit>, bool, Nullable<PhysicsQueryFilter>\) for per-shape granularity.
public int OverlapBox(System.Numerics.Vector2 center, float halfWidth, float halfHeight, float angle, System.Span<Brine2D.Physics.OverlapHit> results, System.Nullable<Brine2D.Physics.PhysicsQueryFilter> filter=null);
Parameters
center System.Numerics.Vector2
Box center 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.
results System.Span<OverlapHit>
Buffer to receive results.
filter System.Nullable<PhysicsQueryFilter>
Optional query filter.
Returns
System.Int32
Number of results written.