public void expandToInclude(ref Vector2 pt) { if (Validity == PointValidity.Valid) { if (pt.x < Min.x) { Min.x = pt.x; } else if (pt.x > Max.x) { Max.x = pt.x; } if (pt.y < Min.y) { Min.y = pt.y; } else if (pt.y > Max.y) { Max.y = pt.y; } } else { Min = Max = pt; Validity = PointValidity.Valid; } }
public bool CanJumpToPoint(MazePoint p) { return(PointValidity.ValidPoint(p, Size)); }
/// <summary> /// Resets a bounding box to invalid. /// </summary> public void clear() { Min.x = Max.x = Min.y = Max.y = 0; Validity = PointValidity.Invalid; }
/// <summary> /// create a boundingbox with the given min and max points. /// </summary> /// <param name="minPt">min point</param> /// <param name="maxPt">max point</param> public AABB(ref Vector2 minPt, ref Vector2 maxPt) { Min = minPt; Max = maxPt; Validity = PointValidity.Valid; }
/// <summary> /// Basic constructor. creates a bounding box that is invalid (describes no space) /// </summary> public AABB() { Min = Max = Vector2.zero; Validity = PointValidity.Invalid; }
public void expandToInclude(ref Vector2 pt) { if (Validity == PointValidity.Valid) { if (pt.X < Min.X) { Min.X = pt.X; } else if (pt.X > Max.X) { Max.X = pt.X; } if (pt.Y < Min.Y) { Min.Y = pt.Y; } else if (pt.Y > Max.Y) { Max.Y = pt.Y; } } else { Min = Max = pt; Validity = PointValidity.Valid; } }
/// <summary> /// Resets a bounding box to invalid. /// </summary> public void clear() { Min.X = Max.X = Min.Y = Max.Y = 0; Validity = PointValidity.Invalid; }
/// <summary> /// create a JelloAABB with the given min and max points. /// </summary> /// <param name="min">The JelloAABB.Min point (lower left).</param> /// <param name="max">The JelloAABB.max point(upper right).</param> public JelloAABB(ref Vector2 min, ref Vector2 max) { Min = min; Max = max; Validity = PointValidity.Valid; }