gl3n.aabb
-
Declaration
struct
AABBT
(type);Base template for all AABB-types.
Parameters
type
all values get stored as this type
-
Declaration
alias
at
= type;Holds the internal type of the AABB.
-
Declaration
alias
vec3
= Vector!(at, 3);Convenience alias to the corresponding vector type.
-
Declaration
vec3
min
;The minimum of the AABB (e.g. vec3(0, 0, 0)).
-
Declaration
vec3
max
;The maximum of the AABB (e.g. vec3(1, 1, 1)).
-
Declaration
this(vec3
min
, vec3max
);Constructs the AABB.
Parameters
vec3
min
minimum of the AABB
vec3
max
maximum of the AABB
-
Declaration
static AABBT
from_points
(vec3[]points
);Constructs the AABB around N
points
(allpoints
will be part of the AABB). -
Declaration
void
expand
(AABBTb
);Expands the AABB by another AABB.
-
Declaration
void
expand
(vec3v
);Expands the AABB, so that
v
is part of the AABB. -
Declaration
const bool
intersects
(AABBTbox
);Returns
true
if the AABBs intersect.Discussion
This also returns
true
if one AABB lies inside another. -
Declaration
const @property vec3
extent
();Returns the
extent
of the AABB (also sometimes called size). -
Declaration
const @property vec3
half_extent
();Returns the half extent.
-
Declaration
const @property at
area
();Returns the
area
of the AABB. -
Declaration
const @property vec3
center
();Returns the
center
of the AABB. -
Declaration
const @property vec3[]
vertices
();Returns all
vertices
of the AABB, basically one vec3 per corner.
-