Beispiel #1
0
        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)
                       ));
        }
Beispiel #2
0
 internal static bool IsIntersectingNaive(BoxF a, BoxF b)
 => b.Left <= a.Right &&
 b.Right >= a.Left &&
 b.Top <= a.Bottom &&
 b.Bottom >= a.Top;
Beispiel #3
0
 public static BoxF Scaled(BoxF r, float p)
 => Sse3.IsSupported
 ? ScaledSse3(r, p)
 : ScaledNaive(r, p);
Beispiel #4
0
 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);