Collision2D#
Allocation-free point sweep against an axis-aligned box. Expand the box for a square ball. Fraction is 0..1 along the displacement. This is a query, not a rigid-body physics solver.
public static class Collision2DMembers: SweepCircle · SweepPoint
SweepCircle#
public static bool SweepCircle(Vector2 origin, Vector2 delta, float radius, ReadOnlySpan<Vector2> polygon, out SweepHit2D hit);Sweeps a circle against a CCW convex polygon, including rounded vertex contacts. Geometry must be finite and nondegenerate. Initial overlap returns a separation depth; callers should separate first and reflect only when moving into the returned normal.
SweepPoint#
public static bool SweepPoint(Vector2 origin, Vector2 delta, Bounds2D box, out SweepHit2D hit);Related types#
Source#
- Collision2D.cs