Fermat
BVH Module
This module implements data-structures and functions to store, build and manipulate BVHs.
As an example, consider the following code to create an LBVH tree over a set of points, in parallel, on the device:
thrust::device_vector<Vector3f> points;
... // code to fill the input vector of points
thrust::device_vector<Bvh_node> bvh_nodes;
thrust::device_vector<uint32> bvh_index;
cugar::cuda::LBVH_builder<uint64> builder( &bvh_nodes, &bvh_index );
builder.build(
Bbox3f( Vector3f(0.0f), Vector3f(1.0f) ), // suppose all bboxes are in [0,1]^3
points.begin(), // begin iterator
points.end(), // end iterator
4 ); // target 4 objects per leaf