diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2017-02-06 20:59:31 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2017-02-06 20:59:31 +0300 |
commit | 0170c682feb63bedc139e25099ec9cc5c7098101 (patch) | |
tree | dafeb0e682a6746a0fbe84b16833496730575a76 | |
parent | e3f99329d8be2acf2ffef0796d4af35bf0d0f229 (diff) |
Specify the correct size of the BVHTree of edges
~edge_num~ edges_num_active
Not always all the edges enter in the build
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 0bf0e6ad49a..23b730c93cb 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)) { |