/// <summary> /// Detects a collision between two BoundingRectangles /// </summary> /// <param name="a"></param> /// <param name="b"></param> /// <returns>true for collision, false otherwise</returns> public static bool Collides(BoundingRectangle a, BoundingRectangle b) { return(!(a.Right < b.Left || a.Left > b.Right || a.Top > b.Bottom || a.Bottom < b.Top)); }
public static bool Collides(BoundingRectangle r, BoundingCircle c) => Collides(c, r);
public bool CollidesWith(BoundingRectangle other) { return(CollisionHelper.Collides(this, other)); }