Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AABB

The 'AABB' is the class for manipulating AABBs(axis-aligned bounding boxes)

Hierarchy

  • AABB

Index

Constructors

constructor

  • new AABB(minX?: number, minY?: number, maxX?: number, maxY?: number): AABB
  • Parameters

    • minX: number = 0
    • minY: number = 0
    • maxX: number = 0
    • maxY: number = 0

    Returns AABB

Properties

maxX

maxX: number

maxY

maxY: number

minX

minX: number

minY

minY: number

Static temp

temp: AABB[] = ...

Methods

center

clone

  • Returns a new aabb copied from 'this'.

    Parameters

    • output: AABB = ...

    Returns AABB

    A clonned aabb

contains

  • contains(point: Vector): boolean
  • Returns true if the aabb contains the given point, otherwise false.

    Parameters

    Returns boolean

    True if the aabb contains the given point, otherwise false

fromVertices

  • Computes the aabb of the given set of vertices.

    Parameters

    Returns AABB

    The aabb

getHeight

  • getHeight(): number
  • Returns the height of the aabb.

    Returns number

    The height of the aabb

getWidth

  • getWidth(): number
  • Returns the width of the aabb.

    Returns number

    The width of the aabb

overlaps

  • overlaps(aabbB: AABB): boolean
  • Returns true if the aabb intersects with the given one, otherwise false.

    Parameters

    Returns boolean

    True if the aabb intersects with the given one, otherwise false

perimeter

  • perimeter(): number
  • Returns perimeter of AABB.

    Returns number

    Perimeter of AABB

raycast

  • Returns the intersection fraction between aabb and line segment.

    Parameters

    • start: Vector

      The start of line segment

    • delta: Vector

      Vector from start of line segment to end of line segment

    Returns number

    The intersection fraction between aabb and line segment.

set

setNum

  • setNum(minX: number, minY: number, maxX: number, maxY: number): AABB
  • Sets the coords of the aabb to the given.

    Parameters

    • minX: number
    • minY: number
    • maxX: number
    • maxY: number

    Returns AABB

    The aabb

translate

  • translate(vector: Vector): void
  • Translates the aabb by the given vector

    Parameters

    Returns void

Static isInside

  • isInside(aabbA: AABB, aabbB: AABB): boolean
  • Returns true if aabbA is completely inside aabbB.

    Parameters

    Returns boolean

    True if aabbA is completely inside aabbB.

Static union

Generated using TypeDoc