Add missing base cases

This commit is contained in:
Philipp Möller 2015-10-27 12:56:40 +01:00 committed by Sébastien Loriot
parent 33bc6f125f
commit 5aef4c4ca5
1 changed files with 3 additions and 4 deletions

View File

@ -163,11 +163,10 @@ boost::optional< typename AABB_tree<AABBTraits>::template Intersection_and_primi
AABB_tree<AABBTraits>::ray_intersection(const Ray& query) const {
switch(size()) // copy-paste from AABB_tree::traversal
{
case 0: // Tree empty
break;
case 1: // Tree has 1 node
/// TODO
case 0: // Tree empty, nothing to intersect
break;
case 1: // Tree has 1 node, intersect directly
return traits().intersection_object()(query, singleton_data());
default: // Tree has >= 2 nodes
if(traits().do_intersect_object()(query, root_node()->bbox())) {
AABB_ray_intersection< AABB_tree<AABBTraits> > ri(*this);