internal static BoxF UnionedNaive(BoxF a, BoxF b) { var aTopLeft = a.TopLeft; var aBottomRight = a.BottomRight; var bTopLeft = b.TopLeft; var bBottomRight = b.BottomRight; return(new BoxF( Vector2.Min(aTopLeft, bTopLeft), Vector2.Max(aBottomRight, bBottomRight) )); }
internal static bool IsIntersectingNaive(BoxF a, BoxF b) => b.Left <= a.Right && b.Right >= a.Left && b.Top <= a.Bottom && b.Bottom >= a.Top;
public static BoxF Scaled(BoxF r, float p) => Sse3.IsSupported ? ScaledSse3(r, p) : ScaledNaive(r, p);
public static BoxF Unioned(BoxF a, BoxF b) => Sse.IsSupported ? UnionedSse(a, b) : UnionedNaive(a, b);
public static void GetBounds(this QuadF q, out BoxF b) => QuadF.BoundingBox(q, out b);