Atoms Crowd
7.0.0
|
#include <ImathBox.h>
Public Member Functions | |
constexpr ATOMSMATH_HOSTDEVICE bool | operator== (const Box< Vec3< T >> &src) const noexcept |
Equality. | |
constexpr ATOMSMATH_HOSTDEVICE bool | operator!= (const Box< Vec3< T >> &src) const noexcept |
Inequality. | |
ATOMSMATH_HOSTDEVICE void | makeEmpty () noexcept |
ATOMSMATH_HOSTDEVICE void | extendBy (const Vec3< T > &point) noexcept |
Extend the Box to include the given point. | |
ATOMSMATH_HOSTDEVICE void | extendBy (const Box< Vec3< T >> &box) noexcept |
Extend the Box to include the given box. | |
ATOMSMATH_HOSTDEVICE void | makeInfinite () noexcept |
Make the box include the entire range of T. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 Vec3< T > | size () const noexcept |
constexpr ATOMSMATH_HOSTDEVICE Vec3< T > | center () const noexcept |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool | intersects (const Vec3< T > &point) const noexcept |
Return true if the given point is inside the box, false otherwise. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool | intersects (const Box< Vec3< T >> &box) const noexcept |
Return true if the given box is inside the box, false otherwise. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 unsigned int | majorAxis () const noexcept |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool | isEmpty () const noexcept |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool | hasVolume () const noexcept |
Return true if the box is larger than a single point, false otherwise. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 bool | isInfinite () const noexcept |
Constructors | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 | Box () noexcept |
Empty by default. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 | Box (const Vec3< T > &point) noexcept |
Construct a bounding box that contains a single point. | |
ATOMSMATH_HOSTDEVICE ATOMSMATH_CONSTEXPR14 | Box (const Vec3< T > &minT, const Vec3< T > &maxT) noexcept |
Construct a bounding box with the given minimum and maximum points. | |
Public Attributes | |
Direct access to bounds | |
Vec3< T > | min |
The minimum value of the box. | |
Vec3< T > | max |
The maximum value of the box. | |
The Box<Vec3> template represents a 3D bounding box defined by minimum and maximum values of type Vec3.
Return the center of the box. The center is defined as (max+min)/2. The center of an empty box is undefined.
Return true if the box is empty, false otherwise. An empty box's minimum is greater than its maximum.
Return true if the box contains all points, false otherwise. An infinite box has a mimimum ofV::baseTypeMin()
and a maximum of V::baseTypeMax()
.
Return the major axis of the box. The major axis is the dimension with the greatest difference between maximum and minimum.
Set the Box to be empty. A Box is empty if the mimimum is greater than the maximum. makeEmpty() sets the mimimum to limits<T>::max()
and the maximum to limits<T>::min()
.
Return the size of the box. The size is of type V
, defined as (max-min). An empty box has a size of V(0), i.e. 0 in each dimension.