![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Axis-Aligned bounding box. More...
#include <shammath/include/shammath/AABB.hpp>
Collaboration diagram for shammath::AABB< T >:Public Types | |
| using | T_prop = shambase::VectorProperties< T > |
| Properties of the coordinates type. | |
| using | Tscal = typename T_prop::component_type |
| Scalar type of the coordinates. | |
Public Member Functions | |
| AABB (T lower, T upper) | |
| Construct an AABB from lower and upper bounds. | |
| AABB (std::tuple< T, T > range) | |
| Construct an AABB from a tuple of lower and upper bounds. | |
| AABB (std::pair< T, T > range) | |
| Construct an AABB from a pair of lower and upper bounds. | |
| T | delt () const |
| Returns the delta of the AABB. | |
| Tscal | get_radius () const |
| Tscal | get_volume () |
| Returns the volume of the AABB. | |
| T | get_center () const noexcept |
| Returns the center of the AABB. | |
| T | sum_bounds () const noexcept |
| Returns the sum of the lower and upper bounds of the AABB. | |
| AABB | expand_all (Tscal value) |
| Expand the AABB by a given value on all dimensions. | |
| template<class Tb > | |
| AABB< Tb > | convert () |
| Converts the AABB to a different type. | |
| AABB | get_intersect (AABB other) const noexcept |
| Compute the intersection of two AABB. | |
| bool | contains (AABB other) const noexcept |
| Check if AABB fully contains another AABB. | |
| bool | contains_asymmetric (T point) const noexcept |
| Check if point is in AABB using half-open interval [lower, upper) | |
| bool | is_not_empty () const noexcept |
| Checks if the AABB is non-empty. | |
| bool | is_volume_not_null () const noexcept |
| Checks if the AABB has a non-zero volume. | |
| bool | is_surface () const noexcept |
| Checks if the AABB is a surface. | |
| bool | is_surface_or_volume () const noexcept |
| Checks if the AABB is a surface or a volume. | |
| T | clamp_coord (T coord) const noexcept |
| Clamp a coordinate to the box. | |
| bool | intersect_ray (Ray< T > ray) const noexcept |
| Check if the ray intersect the AABB. | |
| bool | intersect_ring_ray_approx (RingRay< T > ring_ray) const noexcept |
| Check if the ring ray intersect the AABB. | |
| bool | operator== (const AABB< T > &other) const noexcept |
| equal operator | |
| bool | operator!= (const AABB< T > &other) const noexcept |
| not equal operator | |
Public Attributes | |
| T | lower |
| Lower bound of the AABB. | |
| T | upper |
| Upper bound of the AABB. | |
Axis-Aligned bounding box.
This class describe a bounding box aligned on the axis.
This class describe a domain of coordinates defined by a cartesian product of 1d ranges. For example : [ax,bx] x [ay,by] x [az,bz]
| T | Type of the coordinates |
| using shammath::AABB< T >::T_prop = shambase::VectorProperties<T> |
| using shammath::AABB< T >::Tscal = typename T_prop::component_type |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Converts the AABB to a different type.
This function converts the current AABB to a new AABB with a different coordinate type, specified by the template parameter Tb. The conversion is performed for both the lower and upper bounds of the AABB.
| Tb | The target coordinate type for conversion. |
|
inline |
|
inline |
Expand the AABB by a given value on all dimensions.
This function expands the AABB by the given value on all dimensions. The lower bound is shifted down by the given value, and the upper bound is shifted up by the given value.
| value | The value to expand the AABB by. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
Check if the ray intersect the AABB.
This function perform a ray-AABB intersection test. It return true if the ray intersect the AABB and false otherwise.
| [in] | ray | The ray to test |
Definition at line 356 of file AABB.hpp.
Here is the call graph for this function:
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Checks if the AABB is a surface.
This function determines if the axis-aligned bounding box (AABB) is a surface. A surface is an AABB where only one of its dimensions have a non-zero size.
Definition at line 293 of file AABB.hpp.
Here is the call graph for this function:
|
inlinenoexcept |
Checks if the AABB is a surface or a volume.
This function determines if the axis-aligned bounding box (AABB) is a surface or a volume. A surface is an AABB where only one of its dimensions have a non-zero size. A volume is an AABB where all its dimensions have a non-zero size.
Definition at line 307 of file AABB.hpp.
Here is the call graph for this function:
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| T shammath::AABB< T >::lower |
| T shammath::AABB< T >::upper |