Correct own error in recent BVH nearest ray
authorCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jan 2016 20:36:32 +0000 (07:36 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jan 2016 20:40:21 +0000 (07:40 +1100)
source/blender/blenlib/intern/BLI_kdopbvh.c

index c26c3995ce8920839e77c21819dbe80309bfef35..bac6a4599c2ce323238041fcec0d9d1acdd5c054 100644 (file)
@@ -1855,7 +1855,7 @@ static void dfs_find_nearest_to_ray_dfs(BVHNearestRayData *data, BVHNode *node)
                        }
                }
                else {
-                       for (i = node->totnode - 1; i != 0; i--) {
+                       for (i = node->totnode - 1; i >= 0; i--) {
                                if (calc_dist_sq_to_ray(data, node->children[i]) >= data->nearest.dist_sq) {
                                        continue;
                                }