14#ifndef EBGEOMETRY_AFFINE_HPP
15#define EBGEOMETRY_AFFINE_HPP
38 static_assert(std::is_floating_point_v<T>,
"Affine3T requires a floating-point type T");
85 rotation(const T a_degrees, const
size_t a_axis) noexcept;
123 operator()(const
Vec3T<T>& a_point) const noexcept;
153 inline BoundingVolumes::AABBT<T>
154 transform(const BoundingVolumes::AABBT<T>& a_box) const noexcept;
157static_assert(std::is_trivially_copyable_v<
Affine3T<
float>>, "
Affine3T<
float> must be trivially copyable");
158static_assert(std::is_trivially_copyable_v<
Affine3T<
double>>, "
Affine3T<
double> must be trivially copyable");
162#include "EBGeometry_AffineImplem.hpp"
Declarations of bounding volume types used in bounding volume hierarchies.
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
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
An affine map of 3D space, x -> A x + b, with A stored by rows.
Definition EBGeometry_Affine.hpp:37
BoundingVolumes::AABBT< T > transform(const BoundingVolumes::AABBT< T > &a_box) const noexcept
A box enclosing the image of a box under the map.
static Affine3T translation(const Vec3T< T > &a_shift) noexcept
A translation.
static Affine3T rotation(const T a_degrees, const size_t a_axis) noexcept
A rotation about a coordinate axis, counterclockwise seen from the positive end of the axis.
Vec3T< T > m_row1
Second row of A.
Definition EBGeometry_Affine.hpp:48
static Affine3T scaling(const T a_factor) noexcept
A uniform scaling.
Vec3T< T > m_row0
First row of A.
Definition EBGeometry_Affine.hpp:43
bool isAxisAligned() const noexcept
Whether every row of A has at most one non-zero entry, so that the map sends axis-aligned boxes to ax...
Vec3T< T > m_row2
Third row of A.
Definition EBGeometry_Affine.hpp:53
static Affine3T reflection(const size_t a_axis) noexcept
A reflection in a coordinate plane through the origin.
Vec3T< T > m_shift
The shift b.
Definition EBGeometry_Affine.hpp:58
Affine3T then(const Affine3T &a_next) const noexcept
The map that applies this one and then a_next.
static Affine3T identity() noexcept
The identity map.