BoundingBox

Generic Axis-Aligned Bounding Box.

May be stored as the starting and ending corners, or as starting point and size.

Members

Aliases

ElementType
alias ElementType = T
Undocumented in source.
Point
alias Point = Vector!(T, Dim)

Point type, a Vector with the same type and dimension.

Size
alias Size = Vector!(T, Dim)

Size type, a Vector with the same type and dimension.

area
alias area = volume

2D area is the same as generic box volume.

Functions

abs
BoundingBox abs()

Returns a copy of BoundingBox with sorted corners, so that size only presents non-negative values.

contains
bool contains(T[N] point)

Returns true if Point is contained within BoundingBox.

contains
bool contains(BoundingBox!(T, Args) box)

Returns true if box is completely contained within this BoundingBox.

inset
BoundingBox inset(SizeArg delta)
BoundingBox inset(T delta)

Returns a new BoundingBox by insetting this one by delta.

intersection
auto intersection(BoundingBox!(T, Args) box)

Returns the intersection between two BoundingBoxes.

intersects
auto intersects(BoundingBox!(T, Args) box)

Returns true if box intersects this.

opCast
auto opCast()

Cast BoundingBox to another storage type.

opCast
auto opCast()

Cast BoundingBox to another storage type.

Manifest constants

dimension
enum dimension;

Bounding Box dimension.

Properties

center
Point center [@property getter]

Get the central point of BoundingBox.

center
PointArg center [@property setter]
T center [@property setter]

Set the central point of BoundingBox.

depth
T depth [@property getter]

Get the depth of a BoundingBox, may be negative.

depth
T depth [@property setter]

Set the depth of a BoundingBox, using origin as the pivot.

empty
bool empty [@property getter]

Returns whether BoundingBox have any non-positive size values.

end
Point end [@property getter]

Get the end corner of a BoundingBox.

end
PointArg end [@property setter]

Set the end corner of a BoundingBox.

height
T height [@property getter]

Get the height of a BoundingBox, may be negative.

height
T height [@property setter]

Set the height of a BoundingBox, using origin as the pivot.

size
Size size [@property getter]

Get the size of a BoundingBox, may be negative.

size
SizeArg size [@property setter]

Set the size of a BoundingBox, using origin as the pivot.

surfaceArea
T surfaceArea [@property getter]

Get the surface area of a 3D BoundingBox.

volume
T volume [@property getter]

Get the volume of the BoundingBox.

width
T width [@property getter]

Get the width of a BoundingBox, may be negative.

width
T width [@property setter]

Set the width of a BoundingBox, using origin as the pivot.

Variables

end
Point end;

Ending BoundingBox corner.

origin
Point origin;

Starting BoundingBox corner.

size
Size size;

Size of a BoundingBox, may be negative.

Parameters

T

Element type

options

Additional options, like storage meaning

Meta