Options
All
  • Public
  • Public/Protected
  • All
Menu

Axis aligned bounding box.

Hierarchy

  • b2AABB

Index

Constructors

constructor

Properties

lowerBound

lowerBound: b2Vec2

Lower bound.

upperBound

upperBound: b2Vec2

Upper bound.

Methods

Combine

  • Combines two AABBs into one with max values for upper bound and min values for lower bound. The result is stored in this AABB.

    Parameters

    • aabb1: b2AABB

      First AABB to combine.

    • aabb2: b2AABB

      Second AABB to combine.

    Returns void

Contains

  • Contains(aabb: b2AABB): boolean
  • Determines if an AABB is contained within this one.

    Parameters

    • aabb: b2AABB

      AABB to see if it is contained.

    Returns boolean

    True if aabb is contained, otherwise false.

GetCenter

  • Gets the center of the AABB.

    Returns b2Vec2

    Center of this AABB.

GetExtents

  • Gets the extents of the AABB (half-widths).

    Returns b2Vec2

    Extents of this AABB.

IsValid

  • IsValid(): boolean
  • Verify that the bounds are sorted.

    Returns boolean

    True if the bounds are sorted, otherwise false.

RayCast

  • Perform a precise raycast against this AABB.

    Parameters

    Returns boolean

    True if the ray cast hits this AABB, otherwise false.

TestOverlap

  • TestOverlap(other: b2AABB): boolean
  • Tests if another AABB overlaps this AABB.

    Parameters

    • other: b2AABB

      Other AABB to test for overlap.

    Returns boolean

    True if other overlaps this AABB, otherwise false.

Static Combine

  • Combines two AABBs into one with max values for upper bound and min values for lower bound.

    Parameters

    • aabb1: b2AABB

      First AABB to combine.

    • aabb2: b2AABB

      Second AABB to combine.

    Returns b2AABB

    New AABB with max values from aabb1 and aabb2.

Generated using TypeDoc