11#ifndef EBGEOMETRY_BOUNDINGVOLUMES_HPP
12#define EBGEOMETRY_BOUNDINGVOLUMES_HPP
29namespace BoundingVolumes {
38 static_assert(std::is_floating_point_v<T>,
"AABBT<T>: T must be a floating-point type.");
296#include "EBGeometry_BoundingVolumesImplem.hpp"
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Utility macros for EBGeometry.
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Axis-aligned bounding box (AABB) enclosing a set of 3D points.
Definition EBGeometry_BoundingVolumes.hpp:37
Vec3T< T > & getLowCorner() noexcept
Get a modifiable reference to the low corner of the AABB.
Vec3 getCentroid() const noexcept
Compute the centroid of the AABB.
T getDistance(const Vec3 &a_x0) const noexcept
Compute the unsigned distance from a_x0 to this AABB.
Vec3 m_hiCorner
High corner of the bounding box. Initialized to −∞ (inverted sentinel).
Definition EBGeometry_BoundingVolumes.hpp:263
void define(const std::vector< Vec3T< P > > &a_points) noexcept
Fit this AABB to the smallest box enclosing a_points.
AABBT() noexcept=default
Default constructor. Sets lo = +∞, hi = −∞ (inverted sentinel).
bool intersects(const AABBT &a_other) const noexcept
Test whether this AABB intersects a_other.
Vec3T< T > & getHighCorner() noexcept
Get a modifiable reference to the high corner of the AABB.
AABBT< T > merged(const AABBT< T > &a_other) const noexcept
The smallest AABB enclosing this box and a_other.
Vec3 m_loCorner
Low corner of the bounding box. Initialized to +∞ (inverted sentinel).
Definition EBGeometry_BoundingVolumes.hpp:258
T getArea() const noexcept
Compute the AABB surface area.
T getOverlappingVolume(const AABBT< T > &a_other) const noexcept
Compute the overlapping volume between this AABB and a_other.
T getDistance2(const Vec3 &a_x0) const noexcept
Compute the squared unsigned distance from a_x0 to this AABB.
T getVolume() const noexcept
Compute the AABB volume.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26