|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Compact BVH node stored in the flat node array. More...
#include <EBGeometry_BVH.hpp>

Public Member Functions | |
| void | setBoundingVolume (const BV &a_bv) noexcept |
| Set the bounding volume for this node. | |
| void | setPrimitivesOffset (uint32_t a_off) noexcept |
| Set the primitive offset for this leaf node. | |
| void | setNumPrimitives (uint32_t a_n) noexcept |
| Set the primitive count for this leaf node. | |
| void | setChildOffset (uint32_t a_off, size_t a_k) noexcept |
| Set the depth-first index of the k-th child. | |
| const BV & | getBoundingVolume () const noexcept |
| Get the bounding volume. | |
| uint32_t | getPrimitivesOffset () const noexcept |
| Get the primitive offset (leaf nodes only). | |
| uint32_t | getNumPrimitives () const noexcept |
| Get the primitive count. | |
| const std::array< uint32_t, K > & | getChildOffsets () const noexcept |
| Get the child index table. | |
| bool | isLeaf () const noexcept |
| Return true if this is a leaf node. | |
| T | getDistanceToBoundingVolume (const Vec3T< T > &a_point) const noexcept |
| Get the distance from a_point to this node's bounding volume. | |
| T | getDistanceToBoundingVolume2 (const Vec3T< T > &a_point) const noexcept |
| Get the squared distance from a_point to this node's bounding volume. | |
Public Attributes | |
| BV | m_bv {} |
| Axis-aligned bounding box for this node's subtree. | |
| uint32_t | m_primOff {} |
| Index of the first primitive in the global primitive list (leaf nodes only). | |
| uint32_t | m_numPrims {} |
| Number of primitives in this leaf (zero for interior nodes). | |
| std::array< uint32_t, K > | m_childOff {} |
| Depth-first indices of the K child nodes (interior nodes only). | |
Compact BVH node stored in the flat node array.
Each node holds a bounding volume, a primitive range (leaves) or child index table (interior nodes). Exposed as a public nested type so that users can write traverse() callbacks (PrunePredicate, NodeKeyFactory) that inspect nodes.
|
inlinenoexcept |
Get the bounding volume.
|
inlinenoexcept |
Get the child index table.
|
inlinenoexcept |
Get the distance from a_point to this node's bounding volume.
| [in] | a_point | Query point. |
|
inlinenoexcept |
Get the squared distance from a_point to this node's bounding volume.
Avoids the sqrt that getDistanceToBoundingVolume() pays. pruneTraverse()'s scalar-fallback branch-and-bound compares against a squared pruning bound, so it uses this directly rather than taking a square root only to square it again.
| [in] | a_point | Query point. |
|
inlinenoexcept |
Get the primitive count.
|
inlinenoexcept |
Get the primitive offset (leaf nodes only).
|
inlinenoexcept |
Return true if this is a leaf node.
|
inlinenoexcept |
Set the bounding volume for this node.
| [in] | a_bv | Bounding volume. |
|
inlinenoexcept |
Set the depth-first index of the k-th child.
| [in] | a_off | Node index of the child. |
| [in] | a_k | Child slot (0 … K-1). |
|
inlinenoexcept |
Set the primitive count for this leaf node.
| [in] | a_n | Number of primitives. |
|
inlinenoexcept |
Set the primitive offset for this leaf node.
| [in] | a_off | Index into the global primitive list. |