8 #ifndef META_OCEAN_MATH_BOX_3_H
9 #define META_OCEAN_MATH_BOX_3_H
21 template <
typename T>
class BoxT3;
326 operator bool()
const;
VectorT3< T > dimension() const
Returns the dimension of this box for all three axis.
bool isInside(const VectorT3< T > &point, const T eps=T(0)) const
Returns whether a given point is inside this bounding box.
bool isValid() const
Returns whether the bounding box is valid.
BoxT3< T > & expand(const VectorT3< T > &offsets)
Expands this box.
BoxT3(const VectorT3< T > *points, const size_t number)
Creates a new bounding box enclosing a given set of 3D points.
T yDimension() const
Returns the dimension in y axis, which could e.g.
BoxT3()=default
Creates an invalid bounding box.
bool isPoint(VectorT3< T > *point=nullptr) const
Returns whether this box defines one single point only.
BoxT3< T > & operator*=(const T factor)
Enlarges the bounding box by a given factor in each dimension.
BoxT3< T > operator*(const HomogenousMatrixT4< T > &world_T_box) const
Returns the (axis-aligned) world bounding box for a given transformation between the box and world.
void clear()
Clears and resets the bounding box to an invalid box.
BoxT3(const VectorsT3< T > &points)
Creates a new bounding box enclosing a given set of 3D points.
BoxT3< T > & operator*=(const HomogenousMatrixT4< T > &world_T_box)
Transforms this bounding box with a given transformation so that the this bounding box is defined in ...
VectorT3< T > higher_
Higher corner of the bounding box.
Definition: Box3.h:334
bool hasIntersection(const LineT3< T > &ray, const HomogenousMatrixT4< T > &box_T_ray) const
Returns whether a given ray has an intersection with this box.
bool isOnSurface(const VectorT3< T > &point, const T epsilon=NumericT< T >::eps()) const
Returns whether a given point lies on the surface of this box.
VectorT3< T > lower_
Lower corner of the bounding box.
Definition: Box3.h:331
BoxT3< T > & operator+=(const BoxT3< T > &right)
Joins to bounding boxes.
T sqrDiagonal() const
Returns the square diagonal of this box.
T diagonal() const
Returns the diagonal of this box.
BoxT3(const VectorT3< T > &lower, const VectorT3< T > &higher)
Creates a new bounding box by two given corners.
T xDimension() const
Returns the dimension in x axis, which could e.g.
bool operator!=(const BoxT3< T > &right) const
Returns whether two boxes are not identical.
BoxT3< T > operator*(const T factor) const
Returns an enlarged bounding box of this one.
BoxT3< T > expanded(const VectorT3< T > &offsets) const
Returns an expanded box of this box.
T zDimension() const
Returns the dimension in z axis, which could e.g.
BoxT3< T > & operator+=(const VectorT3< T > &point)
Adds a new point to this bounding box and updates it's dimension.
BoxT3< T > operator+(const BoxT3< T > &right) const
Returns the union of two bounding boxes.
const VectorT3< T > & lower() const
Returns the lower corner of the box.
bool hasIntersection(const LineT3< T > &ray, const T epsPerDistance) const
Returns whether a given ray has an intersection with this box while applying a distance-dependent eps...
VectorT3< T > center() const
Returns the center of the box.
bool operator==(const BoxT3< T > &right) const
Returns whether two boxes are identical.
bool isEqual(const BoxT3< T > &box, const T epsilon=NumericT< T >::eps()) const
Returns whether two box objects are equal up to an epsilon.
bool hasIntersection(const LineT3< T > &ray) const
Returns whether a given ray has an intersection with this box.
const VectorT3< T > & higher() const
Returns the higher corner of the box.
unsigned int corners(VectorT3< T > *corners) const
Returns the corner positions of this box.
bool isPlanar(PlaneT3< T > &plane) const
Returns whether this box is planar aligned to one axis.
BoxT3(const VectorT3< T > ¢er, const T xSize, const T ySize, const T zSize)
Creates a new bounding box with defined dimensions centered at a given 3D location.
This class implements a 4x4 homogeneous transformation matrix using floating point values with the pr...
Definition: HomogenousMatrix4.h:110
This class implements an infinite line in 3D space.
Definition: Line3.h:70
This class provides basic numeric functionalities.
Definition: Numeric.h:57
This class implements a plane in 3D space.
Definition: Plane3.h:73
This class implements a vector with three elements.
Definition: Vector3.h:97
BoxT3< Scalar > Box3
Definition of the Box3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single or...
Definition: Box3.h:21
std::vector< BoxT3< T > > BoxesT3
Definition of a typename alias for vectors with BoxT3 objects.
Definition: Box3.h:50
std::vector< Box3 > Boxes3
Definition of a vector holding Box3 objects.
Definition: Box3.h:57
BoxT3< float > BoxF3
Instantiation of the BoxT3 template class using a single precision float data type.
Definition: Box3.h:42
std::vector< VectorT3< T > > VectorsT3
Definition of a typename alias for vectors with VectorT3 objects.
Definition: Vector3.h:58
BoxT3< double > BoxD3
Instantiation of the BoxT3 template class using a double precision float data type.
Definition: Box3.h:35
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15