Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AABB

Axis aligned bounding box class.

Hierarchy

  • AABB

Index

Constructors

constructor

  • new AABB(options?: { lowerBound?: Vec3; upperBound?: Vec3 }): AABB
  • Parameters

    • options: { lowerBound?: Vec3; upperBound?: Vec3 } = {}
      • Optional lowerBound?: Vec3

        The upper bound of the bounding box

      • Optional upperBound?: Vec3

        The lower bound of the bounding box

    Returns AABB

Properties

lowerBound

lowerBound: Vec3

The lower bound of the bounding box

upperBound

upperBound: Vec3

The upper bound of the bounding box

Methods

clone

contains

  • contains(aabb: AABB): boolean
  • Returns true if the given AABB is fully contained in this AABB.

    Parameters

    Returns boolean

copy

  • Copy bounds from an AABB to this AABB

    Parameters

    • aabb: AABB

      Source to copy from

    Returns AABB

    The this object, for chainability

extend

  • extend(aabb: AABB): void

overlaps

  • overlaps(aabb: AABB): boolean

overlapsRay

  • overlapsRay(ray: Ray): boolean

setFromPoints

  • Set the AABB bounds from a set of points.

    Parameters

    • points: Vec3[]

      An array of Vec3's.

    • Optional position: Vec3
    • Optional quaternion: Quaternion
    • Optional skinSize: number

    Returns AABB

    The self object

toLocalFrame

toWorldFrame