src/Quadtree.cs
/// <summary>Find all items intersecting the given ray, ordered closest to <paramref name="start"/> first.</summary>
/// <param name="start">Start point.</param>
/// <param name="rotation">Rotation (in radians).</param>
/// <param name="thickness">Thickness (width) of ray.</param>
/// <returns>Items that intersect the given ray.</returns>
Find all items intersecting the given ray, ordered closest to  first.
Find all items intersecting the given ray ordered closest to first .
public ItemList Raycast(Vector2 start, float rotation, float thickness = 1) {
            var end = new Vector2(start.X + (MathF.Cos(rotation) * float.MaxValue), start.Y + (MathF.Sin(rotation) * float.MaxValue));
            var items = Query<ItemList>(new RotRect(start, new Vector2(MathF.Sqrt(Vector2.DistanceSquared(start, end)), thickness), rotation, new Vector2(0, thickness / 2)));
            items.Sort((T x, T y) => Vector2.DistanceSquared(start, x.Bounds.XY) < Vector2.DistanceSquared(start, x.Bounds.XY) ? -1 : 0);
            return items;
        }
public ItemList Raycast ( Vector2 start , float rotation , float thickness = 1 ) { var end = new Vector2 ( start . X + ( MathF . Cos ( rotation ) * float . MaxValue ) , start . Y + ( MathF . Sin ( rotation ) * float . MaxValue ) ) ; var items = Query < ItemList > ( new RotRect ( start , new Vector2 ( MathF . Sqrt ( Vector2 . DistanceSquared ( start , end ) ) , thickness ) , rotation , new Vector2 ( 0 , thickness / 2 ) ) ) ; items . Sort ( ( T x , T y ) => Vector2 . DistanceSquared ( start , x . Bounds . XY ) < Vector2 . DistanceSquared ( start , x . Bounds . XY ) ? - 1 : 0 ) ; return items ; }
Find all items intersecting the given ray, ordered closest to  first.
Find all items intersecting the given ray ordered closest to first .
Items that intersect the given ray.
Items that intersect the given ray .
start
Vector2
None
rotation
float
Rotation (in radians).
Rotation ( in radians ) .
thickness
float
Thickness (width) of ray.
Thickness ( width ) of ray .