BBox Class
BBox is a class to create BoundingBoxes but it works as glMatrix, creating Float32Array with the info inside instead of objects The bounding box is stored as center,halfsize,min,max,radius (total of 13 floats)
Item Index
Methods
clone
()
BBox
create an bbox copy from another one
Returns:
returns a float32array with the bbox
fromCenterHalfsize
-
center -
halfsize
create a bbox from center and halfsize
Parameters:
-
centerVec3 -
halfsizeVec3
Returns:
returns a float32array with the bbox
fromMinMax
-
min -
max
create a bbox from min and max points
Parameters:
-
minVec3 -
maxVec3
Returns:
returns a float32array with the bbox
fromPoint
-
point
create a bbox from one point
Parameters:
-
pointVec3
Returns:
returns a float32array with the bbox
fromPoints
-
points
create a bbox from a typed-array containing points
Parameters:
-
pointsFloat32Array
Returns:
returns a float32array with the bbox
getCorners
-
bb -
result
Computes the eight corners of the BBox and returns it
Parameters:
-
bbBBoxthe bounding box
-
resultFloat32Arrayoptional, should be 8 * 3
Returns:
returns the 8 corners
setCenterHalfsize
-
out -
min -
max -
radius
set the values to a BB from center and halfsize
Parameters:
-
outBBoxwhere to store the result
-
minVec3 -
maxVec3 -
radiusNumber[optional] (the minimum distance from the center to the further point)
Returns:
returns out
setFromPoints
-
out -
points
set the values to a BB from a set of points
Parameters:
-
outBBoxwhere to store the result
-
pointsFloat32Array
Returns:
returns a float32array with the bbox
