public void Set(RectBox.Rect2i src) { this.left = src.left; this.top = src.top; this.right = src.right; this.bottom = src.bottom; }
public Rect2i(RectBox.Rect2i r) { left = r.left; top = r.top; right = r.right; bottom = r.bottom; }
public override bool Equals(object obj) { RectBox.Rect2i r = (RectBox.Rect2i)obj; if (r != null) { return(left == r.left && top == r.top && right == r.right && bottom == r.bottom); } return(false); }
public bool SetIntersect(RectBox.Rect2i a, RectBox.Rect2i b) { if (a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom) { left = MathUtils.Max(a.left, b.left); top = MathUtils.Max(a.top, b.top); right = MathUtils.Min(a.right, b.right); bottom = MathUtils.Min(a.bottom, b.bottom); return(true); } return(false); }
public void Union(RectBox.Rect2i r) { Union(r.left, r.top, r.right, r.bottom); }
public static bool Intersects(RectBox.Rect2i a, RectBox.Rect2i b) { return(a.left < b.right && b.left < a.right && a.top < b.bottom && b.top < a.bottom); }
public bool Intersect(RectBox.Rect2i r) { return(Intersect(r.left, r.top, r.right, r.bottom)); }
public bool Contains(RectBox.Rect2i r) { return(this.left < this.right && this.top < this.bottom && left <= r.left && top <= r.top && right >= r.right && bottom >= r.bottom); }