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:
-
center
Vec3 -
halfsize
Vec3
Returns:
returns a float32array with the bbox
fromMinMax
-
min
-
max
create a bbox from min and max points
Parameters:
-
min
Vec3 -
max
Vec3
Returns:
returns a float32array with the bbox
fromPoint
-
point
create a bbox from one point
Parameters:
-
point
Vec3
Returns:
returns a float32array with the bbox
fromPoints
-
points
create a bbox from a typed-array containing points
Parameters:
-
points
Float32Array
Returns:
returns a float32array with the bbox
getCorners
-
bb
-
result
Computes the eight corners of the BBox and returns it
Parameters:
-
bb
BBoxthe bounding box
-
result
Float32Arrayoptional, 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:
-
out
BBoxwhere to store the result
-
min
Vec3 -
max
Vec3 -
radius
Number[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:
-
out
BBoxwhere to store the result
-
points
Float32Array
Returns:
returns a float32array with the bbox