BoundingBox

Class used to store bounding box information

Hierarchy

  • BoundingBox

Implements

Index

Constructors

constructor

Find examples in Playground
  • Creates a new bounding box

    Parameters

    • min: Vector3

      defines the minimum vector (in local space)

    • max: Vector3

      defines the maximum vector (in local space)

    Returns BoundingBox

Properties

center

Find examples in Playground
center: Vector3

Gets the center of the bounding box in local space

centerWorld

Find examples in Playground
centerWorld: Vector3

Gets the center of the bounding box in world space

directions

Find examples in Playground
directions: Vector3[]

Gets the OBB (object bounding box) directions

extendSize

Find examples in Playground
extendSize: Vector3

Gets the extend size in local space

extendSizeWorld

Find examples in Playground
extendSizeWorld: Vector3

Gets the extend size in world space

maximum

Find examples in Playground
maximum: Vector3

Gets the maximum vector in local space

maximumWorld

Find examples in Playground
maximumWorld: Vector3

Gets the maximum vector in world space

minimum

Find examples in Playground
minimum: Vector3

Gets the minimum vector in local space

minimumWorld

Find examples in Playground
minimumWorld: Vector3

Gets the minimum vector in world space

vectors

Find examples in Playground
vectors: Vector3[]

Gets the 8 vectors representing the bounding box in local space

vectorsWorld

Find examples in Playground
vectorsWorld: Vector3[]

Gets the 8 vectors representing the bounding box in world space

Methods

getWorldMatrix

Find examples in Playground
  • Gets the world matrix of the bounding box

    Returns Matrix

    a matrix

intersectsMinMax

Find examples in Playground
  • Tests if the bounding box intersects with a box defined by a min and max vectors

    Parameters

    • min: Vector3

      defines the min vector to use

    • max: Vector3

      defines the max vector to use

    Returns boolean

    true if there is an intersection

intersectsPoint

Find examples in Playground
  • intersectsPoint(point: Vector3): boolean
  • Tests if a point is inside the bounding box

    Parameters

    • point: Vector3

      defines the point to test

    Returns boolean

    true if the point is inside the bounding box

intersectsSphere

Find examples in Playground
  • Tests if the bounding box intersects with a bounding sphere

    Parameters

    Returns boolean

    true if there is an intersection

isCompletelyInFrustum

Find examples in Playground
  • isCompletelyInFrustum(frustumPlanes: Plane[]): boolean
  • Tests if the bounding box is entirely inside the frustum planes

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum planes to test

    Returns boolean

    true if there is an inclusion

isInFrustum

Find examples in Playground
  • isInFrustum(frustumPlanes: Plane[]): boolean
  • Tests if the bounding box is intersecting the frustum planes

    Parameters

    • frustumPlanes: Plane[]

      defines the frustum planes to test

    Returns boolean

    true if there is an intersection

reConstruct

Find examples in Playground
  • Recreates the entire bounding box from scratch

    Parameters

    • min: Vector3

      defines the new minimum vector (in local space)

    • max: Vector3

      defines the new maximum vector (in local space)

    Returns void

scale

Find examples in Playground
  • Scale the current bounding box by applying a scale factor

    Parameters

    • factor: number

      defines the scale factor to apply

    Returns BoundingBox

    the current bounding box

setWorldMatrix

Find examples in Playground
  • Sets the world matrix stored in the bounding box

    Parameters

    • matrix: Matrix

      defines the matrix to store

    Returns BoundingBox

    current bounding box

Static Intersects

Find examples in Playground
  • Tests if two bounding boxes are intersections

    Parameters

    Returns boolean

    true if there is an intersection

Static IntersectsSphere

Find examples in Playground
  • IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean
  • Tests if a bounding box defines by a min/max vectors intersects a sphere

    Parameters

    • minPoint: Vector3

      defines the minimum vector of the bounding box

    • maxPoint: Vector3

      defines the maximum vector of the bounding box

    • sphereCenter: Vector3

      defines the sphere center

    • sphereRadius: number

      defines the sphere radius

    Returns boolean

    true if there is an intersection

Static IsCompletelyInFrustum

Find examples in Playground
  • IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean
  • Tests if a bounding box defined with 8 vectors is entirely inside frustum planes

    Parameters

    • boundingVectors: Vector3[]

      defines an array of 8 vectors representing a bounding box

    • frustumPlanes: Plane[]

      defines the frustum planes to test

    Returns boolean

    true if there is an inclusion

Static IsInFrustum

Find examples in Playground
  • IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean
  • Tests if a bounding box defined with 8 vectors intersects frustum planes

    Parameters

    • boundingVectors: Vector3[]

      defines an array of 8 vectors representing a bounding box

    • frustumPlanes: Plane[]

      defines the frustum planes to test

    Returns boolean

    true if there is an intersection

Generated using TypeDoc