示例#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)
                       ));
        }
示例#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;
示例#3
0
 public static BoxF Scaled(BoxF r, float p)
 => Sse3.IsSupported
 ? ScaledSse3(r, p)
 : ScaledNaive(r, p);
示例#4
0
 public static BoxF Unioned(BoxF a, BoxF b)
 => Sse.IsSupported
 ? UnionedSse(a, b)
 : UnionedNaive(a, b);
示例#5
0
 public static void GetBounds(this QuadF q, out BoxF b)
 => QuadF.BoundingBox(q, out b);