Class

Box

Box()

An AABB box: Useful for culling, picking, …

Constructor

new Box()

Constructor

View Source Math/Box.js, line 11

Members

vec3

center

Center

View Source Math/Box.js, line 52

vec3

maxBounds

Maximum bounds

View Source Math/Box.js, line 21

vec3

maxTransformedBounds

Maximum bounds (with transformation applied)

View Source Math/Box.js, line 36

vec3

minBounds

Minimun bounds

View Source Math/Box.js, line 28

vec3

minTransformedBounds

Minimum bounds (with transformation applied)

View Source Math/Box.js, line 44

vec3

size

Size

View Source Math/Box.js, line 60

Methods

applyMatrix(matrix) → {Box}

Apply a transformation matrix to know absolute position
Parameters:
Name Type Description
matrix mat4 A matrix

View Source Math/Box.js, line 103

A reference to the instance
Box

compute(positions) → {boolean}

Compute bounds
Parameters:
Name Type Description
positions Float32Array A continious array with vertices positions

View Source Math/Box.js, line 69

False is the given array is invalid
boolean

intersectBox(box) → {boolean}

Check if box intersect/collide with the another box
Parameters:
Name Type Description
box Box A Box instance

View Source Math/Box.js, line 124

True if boxes intersects
boolean

intersectRay(ray, outPositionnullable) → {boolean}

Check if box intersect/collide with the given ray
Parameters:
Name Type Attributes Description
ray Ray A Ray instance
outPosition Array.<number> <nullable>
An array to stock intersection position

View Source Math/Box.js, line 142

True if box intersect with the ray
boolean