Create a 2d box bounded by min and max.
(optional) Input 2d vector representing the lower (x, y) boundary of the box. Set it to ( + Infinity, + Infinity ) if undefined or null provided.
(optional) Input 2d vector representing the upper (x, y) boundary of the box. Set it to ( - Infinity, - Infinity ) if undefined or null provided.
Center point of this box
Return the width, height and depth of this box.
Clamp the point within the bounds of this box.
Input one 2d point
Input the result will be copied into this Vector2.
Return the target
Return true if the specified point lies within or on the boundaries of this box.
Input 2d point to check for inclusion.
Return true if the specified point lies within or on the boundaries of this box.
Return the distance from any edge of this box to the specified point. If the point lies inside of this box, the distance will be 0.
Input 2d vector to measure distance to.
Return the distance from any edge of this box to the specified point.
Expand the boundaries of this box to include point.
Input one point that should be included in the box.
Return this box
Expand this box equilaterally by vector. The width of this box will be expanded by the x component of vector in both directions. The height of this box will be expanded by the y component of vector in both directions.
Input 2d vector to expand the box by.
Return this box
Return the center point of the box as a 2d vector.
Input the result will be copied into this 2d vector.
Return the center point of the box as a 2d vector.
Return a point as a proportion of this box's width and height.
Input one point
Input the result will be copied into this 2d vector.
Return a point as a proportion of this box's width and height.
Return the width and height of this box.
Input the result will be copied into this 2d vector.
Return this box.
Return the intersection of this and box, setting the upper bound of this box to the lesser of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes' lower bounds.
Input box to intersect with
Return this box
Set the lower and upper (x, y) boundaries of this box. Please note that this method only copies the values from the given objects.
Input 2d vector representing the lower (x, y) boundary of the box.
Input 2d vector representing the upper (x, y) boundary of the box.
Return this box
Center this box on center and set this box's width and height to the values specified in size.
Input the desired center position of the box.
Input the desired x and y dimensions of the box.
Return this box
Set the upper and lower bounds of this box to include all of the points in points.
Input one array of 2d vector that the resulting box will contain.
Return this box
Add offset to both the upper and lower bounds of this box, effectively moving this box offset units in 2D space.
Input direction and distance of offset.
Return this box
Union this box with box, setting the upper bound of this box to the greater of the two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes' lower bounds.
Input the box that will be unioned with this box.
Return this box
The class representing an axis-aligned bounding box (AABB) in 2D space.