Skip to Content
Bear documentation

box

Import from bear/geometry/box.

Functions

boxCenter()

function boxCenter(box): Vec3;

Defined in: bear/geometry/box.ts:63

Center point of a box.

Parameters

ParameterType
boxBox

Returns

Vec3


boxSize()

function boxSize(box): Vec3;

Defined in: bear/geometry/box.ts:53

Size of the box; zero when empty (mirrors Box3.getSize).

Parameters

ParameterType
boxBox

Returns

Vec3


centeredBox()

function centeredBox(
   width, 
   depth, 
   height
): Box;

Defined in: bear/geometry/box.ts:72

A box of the given size centered on the origin.

Parameters

ParameterType
widthnumber
depthnumber
heightnumber

Returns

Box


emptyBox()

function emptyBox(): Box;

Defined in: bear/geometry/box.ts:9

A box that unions as the identity: min > max on every axis.

Returns

Box


isEmptyBox()

function isEmptyBox(box): boolean;

Defined in: bear/geometry/box.ts:16

Parameters

ParameterType
boxBox

Returns

boolean


transformBox()

function transformBox(box, transform): Box;

Defined in: bear/geometry/box.ts:37

Axis-aligned box containing the transformed corners. Empty stays empty.

Parameters

ParameterType
boxBox
transformTransformMatrix

Returns

Box


unionBoxes()

function unionBoxes(boxes): Box;

Defined in: bear/geometry/box.ts:23

Union of boxes. Empty boxes contribute nothing; no boxes yields empty.

Parameters

ParameterType
boxesreadonly Box[]

Returns

Box

On this page