HDK
|
#include <UT_BVH.h>
Classes | |
struct | Node |
Public Types | |
using | INT_TYPE = uint |
Public Member Functions | |
SYS_FORCE_INLINE | BVH () noexcept |
template<BVH_Heuristic H, typename T , uint NAXES, typename BOX_TYPE , typename SRC_INT_TYPE = INT_TYPE> | |
void | init (const BOX_TYPE *boxes, const INT_TYPE nboxes, SRC_INT_TYPE *indices=nullptr, bool reorder_indices=false, INT_TYPE max_items_per_leaf=1) noexcept |
template<BVH_Heuristic H, typename T , uint NAXES, typename BOX_TYPE , typename SRC_INT_TYPE = INT_TYPE> | |
void | init (Box< T, NAXES > axes_minmax, const BOX_TYPE *boxes, INT_TYPE nboxes, SRC_INT_TYPE *indices=nullptr, bool reorder_indices=false, INT_TYPE max_items_per_leaf=1) noexcept |
SYS_FORCE_INLINE INT_TYPE | getNumNodes () const noexcept |
SYS_FORCE_INLINE const Node * | getNodes () const noexcept |
int | getMaxDepth () const noexcept |
Returns the maximum depth of any leaf. More... | |
int | getPureInternalDepth () const noexcept |
Returns the minimum depth of the first non-internal node. More... | |
SYS_FORCE_INLINE void | clear () noexcept |
template<typename LOCAL_DATA , typename FUNCTORS > | |
void | traverse (FUNCTORS &functors, LOCAL_DATA *data_for_parent=nullptr) const noexcept |
template<typename LOCAL_DATA , typename FUNCTORS > | |
void | traverseParallel (INT_TYPE parallel_threshold, FUNCTORS &functors, LOCAL_DATA *data_for_parent=nullptr) const noexcept |
template<typename LOCAL_DATA , typename FUNCTORS > | |
void | traverseVector (FUNCTORS &functors, LOCAL_DATA *data_for_parent=nullptr) const noexcept |
void | debugDump () const |
Prints a text representation of the tree to stdout. More... | |
Static Public Member Functions | |
template<typename SRC_INT_TYPE > | |
static void | createTrivialIndices (SRC_INT_TYPE *indices, const INT_TYPE n) noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
staticnoexcept |
Definition at line 642 of file UT_BVHImpl.h.
Prints a text representation of the tree to stdout.
Returns the maximum depth of any leaf.
Definition at line 362 of file UT_BVHImpl.h.
|
inlinenoexcept |
|
inlinenoexcept |
Returns the minimum depth of the first non-internal node.
Definition at line 418 of file UT_BVHImpl.h.
|
noexcept |
Definition at line 274 of file UT_BVHImpl.h.
|
noexcept |
Definition at line 283 of file UT_BVHImpl.h.
|
noexcept |
For each node, this effectively does: LOCAL_DATA local_data[MAX_ORDER]; bool descend = functors.pre(nodei, parent_data); if (!descend) return; for each child { if (isitem(child)) functors.item(getitemi(child), nodei, local_data[child]); else if (isnode(child)) recurse(getnodei(child), local_data); } functors.post(nodei, parent_nodei, data_for_parent, num_children, local_data);
Definition at line 428 of file UT_BVHImpl.h.
|
noexcept |
This acts like the traverse function, except if the number of nodes in two subtrees of a node contain at least parallel_threshold nodes, they may be executed in parallel. If parallel_threshold is 0, even item_functor may be executed on items in parallel. NOTE: Make sure that your functors don't depend on the order that they're executed in, e.g. don't add values from sibling nodes together except in post functor, else they might have nondeterministic roundoff or miss some values entirely.
Definition at line 471 of file UT_BVHImpl.h.
|
noexcept |
For each node, this effectively does: LOCAL_DATA local_data[MAX_ORDER]; uint descend = functors.pre(nodei, parent_data); if (!descend) return; for each child { if (!(descend & (1<<child))) continue; if (isitem(child)) functors.item(getitemi(child), nodei, local_data[child]); else if (isnode(child)) recurse(getnodei(child), local_data); } functors.post(nodei, parent_nodei, data_for_parent, num_children, local_data);
Definition at line 596 of file UT_BVHImpl.h.