Oriented Box.

Constructors

  • Create a new OrientedBox instance.

    Parameters

    • Optional worldTransform: Mat4 = ...

      Transform that has the orientation and position of the box. Scale is assumed to be one.

    • Optional halfExtents: Vec3 = ...

      Half the distance across the box in each local axis. The constructor takes a reference of this parameter.

    Returns OrientedBox

Properties

_modelTransform: Mat4
_worldTransform: Mat4

Accessors

Methods

  • Test if a Bounding Sphere is overlapping, enveloping, or inside this OBB.

    Parameters

    Returns boolean

    True if the Bounding Sphere is overlapping, enveloping or inside this OBB and false otherwise.

  • Test if a ray intersects with the OBB.

    Parameters

    • ray: Ray

      Ray to test against (direction must be normalized).

    • Optional point: Vec3

      If there is an intersection, the intersection point will be copied into here.

    Returns boolean

    True if there is an intersection.