Public Member Functions | |
Box () | |
Box (const glm::vec3 p1, const glm::vec3 p2) | |
glm::vec3 | Size () const |
glm::vec3 | Center () const |
float | Scale () const |
bool | Contains (const glm::vec3 &p) const |
bool | Contains (const Box &box) const |
void | Union (const glm::vec3 p) |
Box | Union (const Box &box) const |
Box | Transform (const glm::mat4x3 &transform) const |
Box | operator+ (glm::vec3 shift) const |
Box & | operator+= (glm::vec3 shift) |
Box | operator* (glm::vec3 scale) const |
Box & | operator*= (glm::vec3 scale) |
bool | DoesOverlap (const Box &box) const |
bool | DoesOverlap (glm::vec3 p) const |
bool | IsFinite () const |
Public Attributes | |
glm::vec3 | min = glm::vec3(std::numeric_limits<float>::infinity()) |
glm::vec3 | max = glm::vec3(-std::numeric_limits<float>::infinity()) |
|
inline |
Default constructor is an infinite box that contains all space.
Creates a box that contains the two given points.
|
inline |
Returns the dimensions of the Box.
|
inline |
Returns the center point of the Box.
|
inline |
Returns the absolute-largest coordinate value of any contained point.
Does this box contain (includes equal) 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.
Does this box overlap the one given (including equality)?
|
inline |
Does the given point project within the XY extent of this box (including equality)?
|
inline |
Does this box have finite bounds?