Box2
An axis-aligned bounding box (AABB) in 2D space.
The box is mutable and not thread-safe; confine an instance to a single thread, as in three.js.
The constructor stores the given vectors by reference (it does not copy them). Passing the same vector as both bounds, or sharing a vector with another object, means later mutations are visible through every alias. Use set or clone when you need independent storage.
Constructors
Properties
Functions
Returns true if this box fully contains box (an identical box counts as contained).
Returns true if point lies within or on the boundary of this box.
Returns the Euclidean distance from point to the nearest edge of this box (0 if inside). An empty box yields +Infinity.
Expands this box to include point.
Expands this box equilaterally by vector (x on both horizontal sides, y on both vertical sides).
Returns true if box intersects this box (touching edges count).
Expands this box to enclose all the given points. An empty sequence leaves the box empty.