Skip to content
Snippets Groups Projects
Commit 1414c3c6 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Minor] Mark what seems to be a bug in BVH::refitTree_bottomup

parent b5456ce3
No related branches found
No related tags found
No related merge requests found
......@@ -764,8 +764,14 @@ int BVHModel<BV>::refitTree(bool bottomup)
template<typename BV>
int BVHModel<BV>::refitTree_bottomup()
{
// TODO the recomputation of the BV is done manually, without using
// bv_fitter. The manual BV recomputation seems bugged. Using bv_fitter
// seems to correct the bug.
//bv_fitter->set(vertices, tri_indices, getModelType());
int res = recursiveRefitTree_bottomup(0);
//bv_fitter->clear();
return res;
}
......@@ -812,6 +818,9 @@ int BVHModel<BV>::recursiveRefitTree_bottomup(int bv_id)
}
else
{
//TODO use bv_fitter to build BV. See comment in refitTree_bottomup
//unsigned int* cur_primitive_indices = primitive_indices + bvnode->first_primitive;
//bv = bv_fitter->fit(cur_primitive_indices, bvnode->num_primitives);
Vec3f v[3];
for(int i = 0; i < 3; ++i)
{
......@@ -834,6 +843,9 @@ int BVHModel<BV>::recursiveRefitTree_bottomup(int bv_id)
recursiveRefitTree_bottomup(bvnode->leftChild());
recursiveRefitTree_bottomup(bvnode->rightChild());
bvnode->bv = bvs[bvnode->leftChild()].bv + bvs[bvnode->rightChild()].bv;
//TODO use bv_fitter to build BV. See comment in refitTree_bottomup
//unsigned int* cur_primitive_indices = primitive_indices + bvnode->first_primitive;
//bvnode->bv = bv_fitter->fit(cur_primitive_indices, bvnode->num_primitives);
}
return BVH_OK;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment