public AABB(AABB Other) { this.X = Other.X; this.Y = Other.Y; this.Width = Other.Width; this.Height = Other.Height; }
public static bool Inside(ref AABB A, ref Vector2 B) { if (B.X < A.X) return false; if (B.X >= A.X + A.Width) return false; if (B.Y < A.Y) return false; if (B.Y >= A.Y + A.Height) return false; return true; }
public static bool Intersect(AABB A, AABB B) { if (B.X + B.Width < A.X) return false; if (B.X > A.X + A.Width) return false; if (B.Y + B.Height < A.Y) return false; if (B.Y > A.Y + A.Height) return false; return true; }