Generic N-D axis-aligned bounding box class. More...
#include <Core/BoundingBox/BoundingBox.h>
Public Types | |
using | VectorType = Vector< T, N > |
Public Member Functions | |
BoundingBox () | |
Default constructor. More... | |
BoundingBox (const VectorType &point1, const VectorType &point2) | |
Constructs a box that tightly covers two points. More... | |
BoundingBox (const BoundingBox &other) | |
Constructs a box with other box instance. More... | |
bool | Overlaps (const BoundingBox &other) const |
Returns true of this box and other box overlaps. More... | |
bool | Contains (const VectorType &point) const |
Returns true if the input point is inside of this box. More... | |
VectorType | MidPoint () const |
Returns the mid-point of this box. More... | |
T | DiagonalLength () const |
Returns diagonal length of this box. More... | |
T | DiagonalLengthSquared () const |
Returns squared diagonal length of this box. More... | |
void | Reset () |
Resets this box to initial state (min=infinite, max=-infinite). More... | |
void | Merge (const VectorType &point) |
Merges this and other point. More... | |
void | Merge (const BoundingBox &other) |
Merges this and other boxes. More... | |
void | Expand (T delta) |
Public Attributes | |
VectorType | lowerCorner |
Lower corner of the bounding box. More... | |
VectorType | upperCorner |
Upper corner of the bounding box. More... | |
Detailed Description
template<typename T, size_t N>
class CubbyFlow::BoundingBox< T, N >
Generic N-D axis-aligned bounding box class.
- Template Parameters
-
T - Real number type. N - Dimension.
Member Typedef Documentation
◆ VectorType
using CubbyFlow::BoundingBox< T, N >::VectorType = Vector<T, N> |
Constructor & Destructor Documentation
◆ BoundingBox() [1/3]
CubbyFlow::BoundingBox< T, N >::BoundingBox | ( | ) |
Default constructor.
◆ BoundingBox() [2/3]
CubbyFlow::BoundingBox< T, N >::BoundingBox | ( | const VectorType & | point1, |
const VectorType & | point2 | ||
) |
Constructs a box that tightly covers two points.
◆ BoundingBox() [3/3]
CubbyFlow::BoundingBox< T, N >::BoundingBox | ( | const BoundingBox< T, N > & | other | ) |
Constructs a box with other box instance.
Member Function Documentation
◆ Contains()
bool CubbyFlow::BoundingBox< T, N >::Contains | ( | const VectorType & | point | ) | const |
Returns true if the input point is inside of this box.
◆ DiagonalLength()
T CubbyFlow::BoundingBox< T, N >::DiagonalLength | ( | ) | const |
Returns diagonal length of this box.
◆ DiagonalLengthSquared()
T CubbyFlow::BoundingBox< T, N >::DiagonalLengthSquared | ( | ) | const |
Returns squared diagonal length of this box.
◆ Expand()
void CubbyFlow::BoundingBox< T, N >::Expand | ( | T | delta | ) |
Expands this box by given delta to all direction. If the width of the box was x, expand(y) will result a box with x+y+y width.
◆ Merge() [1/2]
void CubbyFlow::BoundingBox< T, N >::Merge | ( | const VectorType & | point | ) |
Merges this and other point.
◆ Merge() [2/2]
void CubbyFlow::BoundingBox< T, N >::Merge | ( | const BoundingBox< T, N > & | other | ) |
Merges this and other boxes.
◆ MidPoint()
Vector< T, N > CubbyFlow::BoundingBox< T, N >::MidPoint | ( | ) | const |
Returns the mid-point of this box.
◆ Overlaps()
bool CubbyFlow::BoundingBox< T, N >::Overlaps | ( | const BoundingBox< T, N > & | other | ) | const |
Returns true of this box and other box overlaps.
◆ Reset()
void CubbyFlow::BoundingBox< T, N >::Reset | ( | ) |
Resets this box to initial state (min=infinite, max=-infinite).
Member Data Documentation
◆ lowerCorner
VectorType CubbyFlow::BoundingBox< T, N >::lowerCorner |
Lower corner of the bounding box.
◆ upperCorner
VectorType CubbyFlow::BoundingBox< T, N >::upperCorner |
Upper corner of the bounding box.
The documentation for this class was generated from the following files:
- Core/BoundingBox/BoundingBox.h
- Core/BoundingBox/BoundingBox-Impl.h