15 void build(
const float3* verts,
const uint32_t* indices,
size_t num_tris);
26 friend struct BvhBuilder;
41 std::unique_ptr<Node[]> nodes;
42 std::unique_ptr<uint32_t[]> prim_ids;
43 std::unique_ptr<PrecomputedTri[]> tris;
void build(const float3 *verts, const uint32_t *indices, size_t num_tris)
Builds a BVH given a list of vertices and a list of indices.
Bounding box represented by its two extreme points.
Definition: bbox.h:9
Bounding Volume Hierarchy.
Definition: bvh.h:12
size_t node_count() const
Returns the number of nodes in the BVH.
Definition: bvh.h:21
Ray-triangle hit information.
Definition: intersect.h:28
void traverse(const Ray &ray, Hit &hit, bool any=false) const
Traverses the BVH in order to find the closest intersection, or any intersection if 'any' is set...
Ray defined as org + t * dir, with t in [tmin, tmax].
Definition: intersect.h:11