BoundingBox
Constructors
Constructs the smallest bounding box that contains points.
Properties
The minimum position contained within the bounding box.
The maximum position contained within the bounding box.
Methods
Returns a copy of the bounding box.
Returns the center point of the bounding box (the average of min and
max).
Returns a vector representing the size (Vec(width, height)) of the
bounding box.
Returns the width of the bounding box.
Returns the height of the bounding box.
Returns the signed area of the bounding box.
This is equivalent to box.width() * box.height(). If min is greater
than max, the area will be negative.
Returns true if the min and max of this bounding box are finite real
numbers (not NaN or Infinity).
Ensures that the min is less than max, and max is greater than min.
This special case is considered to be the "canonical" configuration.
Grows this bounding box so that point is contained within it.
Grows this bounding box to that box is contained within it.
Grows this bounding box by a scalar distance on every side.
distancenumberThe distance to expand by. Negative values with "shrink" this box.
boxReturns true if box is fully contained within the bounding box. If
box is exactly equal, it counts as being fully contained.
boxReturns true if any part of box overlaps the bounding box.
Constructs a bounding box by intersecting two or more bounding boxes. The
resulting bounding box will enclose the area shared by the input bounding
boxes. If the input bounding boxes do not all intersect, this will return
undefined. Undefined entries in the array are ignored.
Constructs a bounding box that encloses all the given bounding boxes. Undefined entries in the array are ignored.
An axis-aligned rectangle. Usually used to represent the minimum and maximum extent of some geometry on the
xandyaxes.