Axis-aligned 3D box, primarily for bounding. More...
#include <common.h>
Public Member Functions | |
constexpr | Box () |
constexpr | Box (const vec3 p1, const vec3 p2) |
constexpr vec3 | Size () const |
constexpr vec3 | Center () const |
constexpr double | Scale () const |
constexpr bool | Contains (const vec3 &p) const |
constexpr bool | Contains (const Box &box) const |
void | Union (const vec3 p) |
constexpr Box | Union (const Box &box) const |
constexpr Box | Transform (const mat3x4 &transform) const |
constexpr Box | operator+ (vec3 shift) const |
Box & | operator+= (vec3 shift) |
constexpr Box | operator* (vec3 scale) const |
Box & | operator*= (vec3 scale) |
constexpr bool | DoesOverlap (const Box &box) const |
constexpr bool | DoesOverlap (vec3 p) const |
constexpr bool | IsFinite () const |
Public Attributes | |
vec3 | min = vec3(std::numeric_limits<double>::infinity()) |
vec3 | max = vec3(-std::numeric_limits<double>::infinity()) |
Axis-aligned 3D box, primarily for bounding.
|
inlineconstexpr |
Default constructor is an infinite box that contains all space.
Creates a box that contains the two given points.
|
inlineconstexpr |
Returns the absolute-largest coordinate value of any contained point.
|
inlineconstexpr |
Does this box contain (includes equal) the given point?
|
inlineconstexpr |
Does this box contain (includes equal) the given box?
|
inline |
Expand this box to include the given point.
Transform the given box by the given axis-aligned affine transform.
Ensure the transform passed in is axis-aligned (rotations are all multiples of 90 degrees), or else the resulting bounding box will no longer bound properly.
|
inlineconstexpr |
Does this box overlap the one given (including equality)?
|
inlineconstexpr |
Does the given point project within the XY extent of this box (including equality)?
|
inlineconstexpr |
Does this box have finite bounds?