Class AABB

Axis aligned bounding box class.

Constructors

  • Parameters

    • Optional 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: Vec3

The lower bound of the bounding box

upperBound: Vec3

The upper bound of the bounding box

Methods

  • Returns true if the given AABB is fully contained in this AABB.

    Parameters

    Returns boolean

  • Copy bounds from an AABB to this AABB

    Parameters

    • aabb: AABB

      Source to copy from

    Returns AABB

    The this object, for chainability

  • Extend this AABB so that it covers the given AABB too.

    Parameters

    Returns void

  • Returns true if the given AABB overlaps this AABB.

    Parameters

    Returns boolean

  • Check if the AABB is hit by a ray.

    Parameters

    Returns boolean

  • 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

  • Get the representation of an AABB in another frame.

    Parameters

    Returns AABB

    The "target" AABB object.

  • Get the representation of an AABB in the global frame.

    Parameters

    Returns AABB

    The "target" AABB object.

  • Returns number