public bool Intersects(SharpDX.RectangleF rect) { var testRect = new SharpDX.RectangleF(Owner.Transform.Translation.X - OriginX, Owner.Transform.Translation.Y - OriginY, BaseWidth, BaseHeight); bool contains = false; rect.Contains(ref testRect, out contains); bool intersects = rect.Intersects(testRect); return contains || intersects; }
public static bool Test(SharpDX.Plane plane, Vector3 a, Vector3 b, Vector3 c) { var p1 = plane.Intersects(ref a); var p2 = plane.Intersects(ref b); var p3 = plane.Intersects(ref c); // if all three points are on same side and none of them are on the plane then there is no intersection return !(p1 == p2 && p2 == p3 && p1 != PlaneIntersectionType.Intersecting); }