AxisAlignedBoundingBox

A rectangle is a box in 2d space Because these rectangles are axis aligned, they don't have any rotation

Constructors

this
this(Vector!(T, dimensions) initialPoint, Vector!(T, dimensions) extent)

Creates an AABB from the initial point, and how much in each direction the box extends

this
this(T[] args...)

Creates an AABB from the same as the vector constructor, but as a varargs input

this
this(AxisAlignedBoundingBox!(T, dimensions) toCopy)

Copy constructor for AABBs

Members

Functions

contains
bool contains(Vector!(T, dimensions) point)

Returns whether the box contains the given point

Properties

center
Vector!(T, dimensions) center [@property getter]

Gets the point that is the middle or center of the AABB

edges
Segment!(T, dimensions)[] edges [@property getter]

Gets all the edges of the AABB

topLeft
Vector!(T, 2) topLeft [@property getter]

Gives the AABB convenient 2d aliases

vertices
Vector!(T, dimensions)[] vertices [@property getter]

Gets all the vertices of the AABB

Variables

extent
Vector!(T, dimensions) extent;

The extent in each direction the AABB extends from the initial point (eg.)

initialPoint
Vector!(T, dimensions) initialPoint;

The initial or starting point of the AABB

Meta