Beispiel #1
0
 public AABB(AABB Other)
 {
     this.X = Other.X;
     this.Y = Other.Y;
     this.Width = Other.Width;
     this.Height = Other.Height;
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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;
 }