public bool isBelow(CollisionBox target) { Rectangle rect = Rectangle.Intersect(cb.getBoundingBox(), target.getBoundingBox()); if (this.Intersects(target) ? cb.getBoundingBox().Bottom == rect.Bottom : false) return rect.Height < rect.Width; return false; }
public bool isRight(CollisionBox target) { Rectangle rect = Rectangle.Intersect(cb.getBoundingBox(), target.getBoundingBox()); if (this.Intersects(target) ? cb.getBoundingBox().Right == rect.Right : false) return rect.Height > rect.Width; return false; }
public bool isAbove(CollisionBox target) { Rectangle rect = Rectangle.Intersect(cb.getBoundingBox(), target.getBoundingBox()); if (this.Intersects(target) ? cb.getBoundingBox().Top == rect.Top : false) return rect.Height < rect.Width; return false; }
public bool Intersects(CollisionBox target) { if (cb.getBoundingBox().Intersects(target.getBoundingBox())) if (cb.getBoundinType() == target.getBoundinType()) { if (cb.getBoundinType() == boundingType.AABB) return true; else if (cb.getBoundinType() == boundingType.AIDBC) { return Math.Abs(Vector2.Distance(cb.getCenter(), target.getCenter())) <= (cb.getSize().X + target.getSize().X)/2; } } else { } return false; }