![]() |
VMTK
|
#include <vmath.h>
Public Member Functions | |
Aabb3 () | |
template<typename SrcT > | |
Aabb3 (const Vector3< SrcT > &point) | |
template<typename SrcT > | |
Aabb3 (SrcT x0, SrcT y0, SrcT z0, SrcT x1, SrcT y1, SrcT z1) | |
template<typename SrcT > | |
Aabb3 (SrcT x, SrcT y, SrcT z) | |
template<typename SrcT > | |
Aabb3 (const Aabb3< SrcT > &src) | |
template<typename SrcT > | |
Aabb3< T > & | operator= (const Aabb3< SrcT > &rhs) |
bool | valid () const |
void | invalidate () |
template<typename SrcT > | |
void | extend (const Vector3< SrcT > &point) |
template<typename SrcT > | |
void | extend (const Aabb3< SrcT > &box) |
template<typename SrcT > | |
Aabb3< T > | extended (const Vector3< SrcT > &point) const |
template<typename SrcT > | |
Aabb3< T > | extended (const Aabb3< SrcT > &box) const |
template<typename SrcT > | |
bool | intersects (const Vector3< SrcT > &point) const |
template<typename SrcT > | |
bool | intersects (const Aabb3< SrcT > &box) const |
template<typename SrcT > | |
Aabb3< T > | intersection (const Aabb3< SrcT > &other) const |
Vector3< T > | center () const |
Vector3< T > | extent () const |
Vector3< T > | size () const |
Vector3< T > | point (size_t i) const |
Aabb3< T > | transformed (const Matrix4< T > &t) const |
template<typename RhsT > | |
bool | operator== (const Aabb3< RhsT > &rhs) const |
template<typename RhsT > | |
bool | operator!= (const Aabb3< RhsT > &rhs) const |
Aabb3< T > | operator* (const Matrix4< T > &rhs) const |
Aabb3< T > & | operator*= (const Matrix4< T > &rhs) |
template<typename SrcT > | |
Aabb3< T > & | operator<< (const Vector3< SrcT > &rhs) |
template<typename SrcT > | |
Aabb3< T > & | operator<< (const Aabb3< SrcT > &rhs) |
template<typename RhsT > | |
Aabb3< T > | operator| (const Aabb3< RhsT > &rhs) const |
template<typename RhsT > | |
Aabb3< T > | operator & (const Aabb3< RhsT > &rhs) const |
Public Attributes | |
Vector3< T > | min |
Vector3< T > | max |
Friends | |
std::ostream & | operator<< (std::ostream &lhs, const Aabb3< T > &rhs) |
Axes-aligned bounding-box (aka AABB) class.
This class provides functionality for:
There are also overloaded couple of operators to shorten common operation. For instance you can use operator<<
on AABB to extend it with passed point or other AABB.
|
inline |
|
inline |
|
inline |
Constructs axes-aligned bounding-box form two corner points (x0, y0, z0) and (x1, y1, z1)
x0 | X-coordinate of first point |
y0 | Y-coordinate of first point |
z0 | Z-coordinate of first point |
x1 | X-coordinate of second point |
y1 | Y-coordinate of second point |
z1 | Z-coordinate of second point |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Gets result of intersection of this bounding-box with other bounding-box. In case the boxes don't intersect, the returned bounding-box is invalid.
other | Box to be tested |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Gets all 8 corner-points of bounding box
i | An index of bounding-box corner point. Valid values are 0 .. 7. |
+
denotes max-point and -
min-point):+
+
+
)-
+
+
)+
-
+
)-
-
+
)+
+
-
)-
+
-
)+
-
-
)-
-
-
)
|
inline |
|
inline |
|
inline |
Checks if bounding-box is valid. Valid bounding-box has non-negative size. If an invalid bounding-box is extended by point or another bounding-box, the target bounding box becomes valid and contains solely the source point or bounding-box respectively.
|
friend |
Vector3<T> VMATH_NAMESPACE::Aabb3< T >::max |
Vector3<T> VMATH_NAMESPACE::Aabb3< T >::min |