[Bf-blender-cvs] [0170c682fe] master: Specify the correct size of the BVHTree of edges

Germano Cavalcante noreply at git.blender.org
Mon Feb 6 19:00:32 CET 2017


Commit: 0170c682feb63bedc139e25099ec9cc5c7098101
Author: Germano Cavalcante
Date:   Mon Feb 6 14:59:31 2017 -0300
Branches: master
https://developer.blender.org/rB0170c682feb63bedc139e25099ec9cc5c7098101

Specify the correct size of the BVHTree of edges

~edge_num~ edges_num_active
Not always all the edges enter in the build

===================================================================

M	source/blender/blenkernel/intern/bvhutils.c

===================================================================

diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 0bf0e6ad49..23b730c93c 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -382,7 +382,7 @@ static void mesh_edges_spherecast(void *userdata, int index, const BVHTreeRay *r
 	(a)[2] * (b)[2]
 
 /* Callback to bvh tree nearest edge to ray.
- * The tree must have been built using bvhtree_from_mesh_edges or bvhtree_from_loose_edges.
+ * The tree must have been built using bvhtree_from_mesh_edges.
  * userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree. */
 static void mesh_edges_nearest_to_ray(
         void *userdata, const float ray_co[3], const float ray_dir[3],
@@ -675,7 +675,7 @@ static BVHTree *bvhtree_from_mesh_edges_create_tree(
 	BLI_assert(edge != NULL);
 
 	/* Create a bvh-tree of the given target */
-	BVHTree *tree = BLI_bvhtree_new(edge_num, epsilon, tree_type, axis);
+	BVHTree *tree = BLI_bvhtree_new(edges_num_active, epsilon, tree_type, axis);
 	if (tree) {
 		for (int i = 0; i < edge_num; i++) {
 			if (edges_mask && !BLI_BITMAP_TEST_BOOL(edges_mask, i)) {




More information about the Bf-blender-cvs mailing list