|
template<class T > |
bool | celeritas::is_infinite (BoundingBox< T > const &bbox) |
| Check if a bounding box spans (-inf, inf) in every direction.
|
|
template<class T > |
bool | celeritas::is_finite (BoundingBox< T > const &bbox) |
| Check if a bounding box has no infinities. More...
|
|
template<class T > |
bool | celeritas::is_degenerate (BoundingBox< T > const &bbox) |
| Check if a bounding box has zero length in any direction. More...
|
|
template<class T > |
Array< T, 3 > | celeritas::calc_center (BoundingBox< T > const &bbox) |
| Calculate the center of a bounding box. More...
|
|
template<class T > |
Array< T, 3 > | celeritas::calc_half_widths (BoundingBox< T > const &bbox) |
| Calculate the half widths of the bounding box. More...
|
|
template<class T > |
T | celeritas::calc_surface_area (BoundingBox< T > const &bbox) |
| Calculate the surface area of a bounding box. More...
|
|
template<class T > |
T | celeritas::calc_volume (BoundingBox< T > const &bbox) |
| Calculate the volume of a bounding box. More...
|
|
template<class T > |
constexpr BoundingBox< T > | celeritas::calc_union (BoundingBox< T > const &a, BoundingBox< T > const &b) |
| Calculate the smallest bounding box enclosing two bounding boxes.
|
|
template<class T > |
constexpr BoundingBox< T > | celeritas::calc_intersection (BoundingBox< T > const &a, BoundingBox< T > const &b) |
| Calculate the intersection of two bounding boxes. More...
|
|
template<class T > |
bool | celeritas::encloses (BoundingBox< T > const &big, BoundingBox< T > const &small) |
| Check if all points inside the small bbox are in the big bbox. More...
|
|
template<class T , class U > |
U | celeritas::calc_dist_to_inside (BoundingBox< T > const &bbox, Array< U, 3 > const &pos, Array< U, 3 > const &dir) |
| Calculate the distance to the inside of the bbox from a pos and dir. More...
|
|
BBox | celeritas::calc_transform (Translation const &tr, BBox const &a) |
| Calculate the bounding box of a translated box.
|
|
BBox | celeritas::calc_transform (Transformation const &tr, BBox const &a) |
| Calculate the axis-aligned bounding box of a transformed box. More...
|
|
template<class T > |
std::ostream & | celeritas::operator<< (std::ostream &os, BoundingBox< T > const &bbox) |
| Write a bounding box to a stream.
|
|
Host-only utilities for bounding boxes.
Calculate the axis-aligned bounding box of a transformed box.
Transforming a box usually results in an oriented bounding box, but sometimes that OBB is also an AABB. This function implicitly creates the transformed bounding box and creates an AABB that encompasses that box.
The result returns an exactly transformed bounding box for axis-aligned rotations. To achieve exactness for semi-infinite bounding boxes, this method has a custom implementation of GEMV for applying exact rotations if the matrix representation simply switches vector entries or flips their sign. Without the complication, floating point arithmetic results in NaN from multiplying zeroes (in the matrix) by the infinite values.