Skip to content

Commit

Permalink
Fix bug on QBVH.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Mar 15, 2016
1 parent 9883df9 commit 90cd767
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sources/accelerator/qbvh.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,14 @@ bool QBVHAccel::intersect(Ray& ray, SurfaceInteraction* isect) const {
}
} else {
// Leaf
const auto& prim = primitives_[item.node.index];
SurfaceInteraction temp;
if (primitives_[item.node.index]->intersect(ray, &temp)) {
*isect = temp;
isect->setPrimitive(prim.get());
hit = true;
if (item.node.index >= 0) {
const auto& prim = primitives_[item.node.index];
SurfaceInteraction temp;
if (primitives_[item.node.index]->intersect(ray, &temp)) {
*isect = temp;
isect->setPrimitive(prim.get());
hit = true;
}
}
}
}
Expand Down

0 comments on commit 90cd767

Please sign in to comment.