API referenceGeometry
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
| Parameter | Type |
|---|---|
box | Box |
Returns
boxSize()
function boxSize(box): Vec3;Defined in: bear/geometry/box.ts:53
Size of the box; zero when empty (mirrors Box3.getSize).
Parameters
| Parameter | Type |
|---|---|
box | Box |
Returns
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
| Parameter | Type |
|---|---|
width | number |
depth | number |
height | number |
Returns
emptyBox()
function emptyBox(): Box;Defined in: bear/geometry/box.ts:9
A box that unions as the identity: min > max on every axis.
Returns
isEmptyBox()
function isEmptyBox(box): boolean;Defined in: bear/geometry/box.ts:16
Parameters
| Parameter | Type |
|---|---|
box | Box |
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
| Parameter | Type |
|---|---|
box | Box |
transform | TransformMatrix |
Returns
unionBoxes()
function unionBoxes(boxes): Box;Defined in: bear/geometry/box.ts:23
Union of boxes. Empty boxes contribute nothing; no boxes yields empty.
Parameters
| Parameter | Type |
|---|---|
boxes | readonly Box[] |