template<typename
Node>
struct bvh::v2::Bvh< Node >
Definition at line 17 of file bvh.h.
|
| Bvh ()=default |
|
| Bvh (Bvh &&)=default |
|
Bvh | extract_bvh (size_t root_id) const |
| Extracts the BVH rooted at the given node index.
|
|
BVH_ALWAYS_INLINE const Node & | get_root () const |
| Returns the root node of this BVH.
|
|
template<bool IsAnyHit, bool IsRobust, typename Stack , typename LeafFn , typename InnerFn = IgnoreArgs> |
void | intersect (const Ray &ray, Index start, Stack &, LeafFn &&, InnerFn &&={}) const |
| Intersects the BVH with a single ray, using the given function to intersect the contents of a leaf.
|
|
bool | operator!= (const Bvh &other) const |
|
Bvh & | operator= (Bvh &&)=default |
|
bool | operator== (const Bvh &other) const |
|
template<typename LeafFn = IgnoreArgs> |
void | refit (LeafFn &&={}) |
| Refits the BVH, using the given function object to recompute the bounding box of the leaves.
|
|
void | serialize (OutputStream &) const |
|
template<typename LeafFn = IgnoreArgs, typename InnerFn = IgnoreArgs> |
void | traverse_bottom_up (LeafFn &&={}, InnerFn &&={}) |
| Traverses this BVH from the bottom to the top, using the given function objects to process leaves and inner nodes.
|
|
template<bool IsAnyHit, typename Stack , typename LeafFn , typename InnerFn > |
void | traverse_top_down (Index start, Stack &, LeafFn &&, InnerFn &&) const |
| Traverses the BVH from the given index in start using the provided stack.
|
|
template<
bool IsAnyHit,
bool IsRobust, typename Stack , typename LeafFn , typename InnerFn >
void bvh::v2::Bvh< Node >::intersect |
( |
const Ray & |
ray, |
|
|
Index |
start, |
|
|
Stack & |
stack, |
|
|
LeafFn && |
leaf_fn, |
|
|
InnerFn && |
inner_fn = {} |
|
) |
| const |
|
inline |
Intersects the BVH with a single ray, using the given function to intersect the contents of a leaf.
The algorithm starts at the node index start
and uses the given stack object. When IsAnyHit
is true, the function stops at the first intersection (useful for shadow rays), otherwise it finds the closest intersection. When IsRobust
is true, a slower but numerically robust ray-box test is used, otherwise a fast, but less precise test is used.
Definition at line 166 of file bvh.h.
template<
bool IsAnyHit, typename Stack , typename LeafFn , typename InnerFn >
void bvh::v2::Bvh< Node >::traverse_top_down |
( |
Index |
start, |
|
|
Stack & |
stack, |
|
|
LeafFn && |
leaf_fn, |
|
|
InnerFn && |
inner_fn |
|
) |
| const |
|
inline |
Traverses the BVH from the given index in start
using the provided stack.
Every leaf encountered on the way is processed using the given LeafFn
function, and every pair of nodes is processed with the function in HitFn
, which returns a triplet of booleans indicating whether the first child should be processed, whether the second child should be processed, and whether to traverse the second child first instead of the other way around.
Definition at line 129 of file bvh.h.