t3d. Box2

Represents an axis-aligned bounding box (AABB) in 2D space.

Constructor

new Box2(min, max)

Parameters:
NameTypeDescription
mint3d.Vector2(optional) Vector2 representing the lower (x, y) boundary of the box. Default is ( + Infinity, + Infinity ).
maxt3d.Vector2(optional) Vector2 representing the upper (x, y) boundary of the box. Default is ( - Infinity, - Infinity ).

Methods

clone() → {t3d.Box2}

Returns a new Box2 with the same min and max as this one.
Returns:
Type: 
t3d.Box2

copy(box) → {t3d.Box2}

Copies the min and max from box to this box.
Parameters:
NameTypeDescription
boxt3d.Box2
Returns:
Type: 
t3d.Box2

set(x1, y1, x2, y2)

Parameters:
NameTypeDescription
x1Number
y1Number
x2Number
y2Number