/// <summary> /// Grow the bounds to encapsulate the bounds. /// </summary> /// <param name="bounds">the new bounds to encapsulate.</param> public void Encapsulate(Bounds2D bounds) { Encapsulate(bounds.Center - bounds.Extents); Encapsulate(bounds.Center + bounds.Extents); }
public bool Intersects(Bounds2D bounds) { return((Math.Abs(Center.x - bounds.Center.x) < Extents.x + bounds.Size.x) && (Math.Abs(Center.y - bounds.Center.y) < Extents.y + bounds.Extents.y)); }