|
| 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.
|
| |
| uint32_t | getPrimitivesOffset () const noexcept |
| | Get the primitive offset (leaf nodes only).
|
| |
| uint32_t | getNumPrimitives () const noexcept |
| | Get the primitive count.
|
| |
| const Array< uint32_t, K > & | getChildOffsets () const noexcept |
| | Get the child index table.
|
| |
| uint32_t | getChildBoxRow () const noexcept |
| | Get the row of this interior node's children's boxes in the SIMD box array.
|
| |
| uint32_t | getBoxSlot () const noexcept |
| | Get where this node's own box is stored; see m_boxSlot.
|
| |
| bool | isLeaf () const noexcept |
| | Return true if this is a leaf node.
|
| |
template<class T, class P, size_t K>
struct EBGeometry::BVH::PackedBVH< T, P, K >::Node
Compact BVH node stored in the flat node array.
Each node holds a primitive range (leaves) or child index table (interior nodes). It does not hold its own box: every box is stored once, in its parent's row of the SIMD box array (the root's in the BVH itself), and PackedBVH::getBoundingVolume(const Node&) finds it through the node's box slot. Exposed as a public nested type so that users can write traverse() visit callbacks, or their own walks over getNodes(), that inspect nodes. A node is 32 bytes at K = 4, in either precision.
template<class T , class P , size_t K>
Where this node's own box is stored: row * K + slot in the SIMD box array, the row being its parent's and the slot its position among the parent's children; RootBoxSlot for the root.
Owned by PackedBVH, which assigns it with m_childBoxRow.
template<class T , class P , size_t K>
Row of this interior node's children's boxes in PackedBVH's SIMD box array.
Owned by PackedBVH, which assigns it when the BVH is built or adopted, overwriting whatever the node array held; leaves have no row. Only interior nodes get a row, so the box array has one row per interior node rather than one per node.