Class AxisAlignedBoundingBox

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

class AxisAlignedBoundingBox(T, uint dimensions) ;

Constructors

NameDescription
this Creates an AABB from the same as the vector constructor, but as a varargs input
this Creates an AABB from the initial point, and how much in each direction the box extends
this Copy constructor for AABBs

Fields

NameTypeDescription
extent Vector!(T,dimensions)The extent in each direction the AABB extends from the initial point (eg.)
initialPoint Vector!(T,dimensions)The initial or starting point of the AABB

Properties

NameTypeDescription
bottomLeft[get] Vector!(T,2)Gives the AABB convenient 2d aliases
bottomRight[get] Vector!(T,2)Gives the AABB convenient 2d aliases
center[get] Vector!(T,dimensions)Gets the point that is the middle or center of the AABB
edges[get] Segment!(T,dimensions)[]Gets all the edges of the AABB
topLeft[get] Vector!(T,2)Gives the AABB convenient 2d aliases
topRight[get] Vector!(T,2)Gives the AABB convenient 2d aliases
vertices[get] Vector!(T,dimensions)[]Gets all the vertices of the AABB

Methods

NameDescription
contains Returns whether the box contains the given point