API Docs for:
Show:

BBox Class

Defined in: ../src/geo.js:639
Module: GL

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)

Methods

clone

() BBox

Defined in ../src/geo.js:665

create an bbox copy from another one

Returns:

BBox:

returns a float32array with the bbox

copy

(
  • out
  • where
)
BBox

Defined in ../src/geo.js:675

copy one bbox into another

Parameters:

  • out BBox

    where to store the result

  • where BBox

    to read the bbox

Returns:

BBox:

returns out

create

() BBox

Defined in ../src/geo.js:655

create an empty bbox

Returns:

BBox:

returns a float32array with the bbox

fromCenterHalfsize

(
  • center
  • halfsize
)
BBox

Defined in ../src/geo.js:717

create a bbox from center and halfsize

Parameters:

  • center Vec3
  • halfsize Vec3

Returns:

BBox:

returns a float32array with the bbox

fromMinMax

(
  • min
  • max
)
BBox

Defined in ../src/geo.js:703

create a bbox from min and max points

Parameters:

  • min Vec3
  • max Vec3

Returns:

BBox:

returns a float32array with the bbox

fromPoint

(
  • point
)
BBox

Defined in ../src/geo.js:688

create a bbox from one point

Parameters:

  • point Vec3

Returns:

BBox:

returns a float32array with the bbox

fromPoints

(
  • points
)
BBox

Defined in ../src/geo.js:731

create a bbox from a typed-array containing points

Parameters:

  • points Float32Array

Returns:

BBox:

returns a float32array with the bbox

getCorners

(
  • bb
  • result
)
Float32Array

Defined in ../src/geo.js:859

Computes the eight corners of the BBox and returns it

Parameters:

  • bb BBox

    the bounding box

  • result Float32Array

    optional, should be 8 * 3

Returns:

Float32Array:

returns the 8 corners

setCenterHalfsize

(
  • out
  • min
  • max
  • radius
)
BBox

Defined in ../src/geo.js:805

set the values to a BB from center and halfsize

Parameters:

  • out BBox

    where to store the result

  • min Vec3
  • max Vec3
  • radius Number

    [optional] (the minimum distance from the center to the further point)

Returns:

BBox:

returns out

setCenterHalfsize

(
  • out
  • bb
  • mat
)
BBox

Defined in ../src/geo.js:832

Apply a matrix transformation to the BBox (applies to every corner and recomputes the BB)

Parameters:

  • out BBox

    where to store the result

  • bb BBox

    bbox you want to transform

  • mat Mat4

    transformation

Returns:

BBox:

returns out

setFromPoints

(
  • out
  • points
)
BBox

Defined in ../src/geo.js:744

set the values to a BB from a set of points

Parameters:

  • out BBox

    where to store the result

  • points Float32Array

Returns:

BBox:

returns a float32array with the bbox

setMinMax

(
  • out
  • min
  • max
)
BBox

Defined in ../src/geo.js:774

set the values to a BB from min and max

Parameters:

  • out BBox

    where to store the result

  • min Vec3
  • max Vec3

Returns:

BBox:

returns out