17#ifndef EBGEOMETRY_BVHQUERY_HPP
18#define EBGEOMETRY_BVHQUERY_HPP
45template <
class T,
size_t K>
59 (((
sizeof(T) * K) & ((
sizeof(T) * K) - 1)) == 0) ? (
sizeof(T) * K) : alignof(T);
108 template <
class... Args>
125template <
class Q,
class =
void>
131 using type =
typename Q::Scalar;
154template <
class Q,
class =
void>
160 static constexpr uint32_t
value = 1;
173 static constexpr uint32_t
value = Q::Lanes;
182template <
class Q,
class =
void>
193 std::void_t<typename Q::Scalar,
194 decltype(std::declval<const Q&>().key(
195 std::declval<const BoundingVolumes::AABBT<typename Q::Scalar>&>()))>> : std::true_type
352 key(const BoundingVolumes::AABBT<T>& a_box) const noexcept;
359#include "EBGeometry_BVHQueryImplem.hpp"
A fixed-size array that compiles for both host and device.
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
Scalar helpers and numeric limits that compile for both host and device.
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
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Fixed-size array with host- and device-callable members.
Definition EBGeometry_Array.hpp:33
Visit the children within the bound in the order they are stored (first slot first),...
Definition EBGeometry_BVHQuery.hpp:93
The boxes of the K children of one interior node, in SoA layout: m_lo[axis][child] and m_hi[axis][chi...
Definition EBGeometry_BVHQuery.hpp:47
T m_lo[3][K]
Lower corners: m_lo[axis][child], axis in {0, 1, 2}, child in {0, ..., K - 1}.
Definition EBGeometry_BVHQuery.hpp:64
static constexpr size_t RowAlignment
Alignment of one axis row, in bytes.
Definition EBGeometry_BVHQuery.hpp:58
T m_hi[3][K]
Upper corners: m_hi[axis][child], axis in {0, 1, 2}, child in {0, ..., K - 1}.
Definition EBGeometry_BVHQuery.hpp:69
The default visit callback of PackedBVH::traverse(): enter every node that passes the bound.
Definition EBGeometry_BVHQuery.hpp:101
constexpr bool operator()(const Args &... a_args) const noexcept
Always descend.
Definition EBGeometry_BVHQuery.hpp:111
Visit the children within the bound farthest first (largest key first).
Definition EBGeometry_BVHQuery.hpp:84
Whether a type is a query type: it names its precision (Scalar) and keys a node's children.
Definition EBGeometry_BVHQuery.hpp:184
Visit the children within the bound nearest first (smallest key first). The default: a nearest-primit...
Definition EBGeometry_BVHQuery.hpp:77
A point tracked through a BVH: the key of a box is the squared distance from the point to it (0 insid...
Definition EBGeometry_BVHQuery.hpp:215
T key(const BoundingVolumes::AABBT< T > &a_box) const noexcept
The squared distance from the point to a box (the root's).
T Key
Key type: a squared distance.
Definition EBGeometry_BVHQuery.hpp:224
T Scalar
Floating-point precision.
Definition EBGeometry_BVHQuery.hpp:219
Vec3T< T > m_point
The point.
Definition EBGeometry_BVHQuery.hpp:229
T key(const ChildBoxes< T, K > &a_row, size_t a_k) const noexcept
The squared distance from the point to one child box, bit for bit what keys() gives it.
Array< T, K > keys(const ChildBoxes< T, K > &a_row) const noexcept
The squared distances from the point to the K child boxes of a node.
typename Q::Key type
The key type.
Definition EBGeometry_BVHQuery.hpp:144
The key type of a query type: Q::Key if it declares one, else Q::Scalar.
Definition EBGeometry_BVHQuery.hpp:127
typename Q::Scalar type
The key type.
Definition EBGeometry_BVHQuery.hpp:131
How many queries a query type carries. 1 unless the type says otherwise.
Definition EBGeometry_BVHQuery.hpp:156
static constexpr uint32_t value
Number of queries.
Definition EBGeometry_BVHQuery.hpp:160
A ray tracked through a BVH: the key of a box is the distance along the ray at which it enters the bo...
Definition EBGeometry_BVHQuery.hpp:286
RayQuery(const Vec3T< T > &a_origin, const Vec3T< T > &a_direction, T a_tMin=T(0)) noexcept
The ray origin + t * direction, t >= tMin.
T m_tMin
Start of the ray: crossings before it are ignored.
Definition EBGeometry_BVHQuery.hpp:310
T Key
Key type: a distance along the ray.
Definition EBGeometry_BVHQuery.hpp:295
T key(const ChildBoxes< T, K > &a_row, size_t a_k) const noexcept
Where the ray enters one child box, bit for bit what keys() gives it.
T Scalar
Floating-point precision.
Definition EBGeometry_BVHQuery.hpp:290
Vec3T< T > m_inverseDirection
1 / direction, per component (+-infinity for a zero component).
Definition EBGeometry_BVHQuery.hpp:305
Array< T, K > keys(const ChildBoxes< T, K > &a_row) const noexcept
Where the ray enters the K child boxes of a node (+infinity where it misses one).
Vec3T< T > m_origin
Ray origin.
Definition EBGeometry_BVHQuery.hpp:300