From 5aef4c4ca54d8d1b39d10c7e2a345a54b0a958fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20M=C3=B6ller?= Date: Tue, 27 Oct 2015 12:56:40 +0100 Subject: [PATCH] Add missing base cases --- .../CGAL/internal/AABB_tree/AABB_ray_intersection.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h index a8c18388636..2affb0feb7b 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h @@ -163,11 +163,10 @@ boost::optional< typename AABB_tree::template Intersection_and_primi AABB_tree::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 > ri(*this);