AABB

data class AABB(val lowerBound: Vec2, val upperBound: Vec2)

Axis-Aligned Bounding Box.

An AABB is a rectangle aligned to the coordinate axes that fully contains a shape or set of shapes. It's used for broad-phase collision detection and spatial queries.

Parameters

lowerBound

The lower vertex (minimum x, minimum y)

upperBound

The upper vertex (maximum x, maximum y)

Constructors

Link copied to clipboard
constructor(lowerBound: Vec2, upperBound: Vec2)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The center point of this AABB

Link copied to clipboard

The half-widths (extents) of this AABB

Link copied to clipboard

The height of this AABB

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The width of this AABB

Functions

Link copied to clipboard
fun contains(other: AABB): Boolean

Check if this AABB contains another AABB

fun contains(point: Vec2): Boolean

Check if this AABB contains a point

Link copied to clipboard
fun overlaps(other: AABB): Boolean

Check if this AABB overlaps with another AABB