BKE: BVHtree: Replace all external references of `bvhtree_from_mesh_looptri` with...
authorGermano <germano.costa@ig.com.br>
Fri, 4 May 2018 12:21:42 +0000 (09:21 -0300)
committerGermano <germano.costa@ig.com.br>
Fri, 4 May 2018 12:21:42 +0000 (09:21 -0300)
source/blender/blenkernel/BKE_bvhutils.h
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/mesh_remap.c
source/blender/makesrna/intern/rna_object_api.c

index b9f07e07f12a1509ceaf09fa6218faa0bab83ec3..57a6c413ce04acb52f5e87c40e156aaa2e4826ea 100644 (file)
@@ -148,8 +148,6 @@ BVHTree *bvhtree_from_editmesh_looptri_ex(
         const BLI_bitmap *mask, int looptri_num_active,
         float epsilon, int tree_type, int axis, BVHCache **bvhCache);
 
-BVHTree *bvhtree_from_mesh_looptri(
-        struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, float epsilon, int tree_type, int axis);
 BVHTree *bvhtree_from_mesh_looptri_ex(
         struct BVHTreeFromMesh *data,
         const struct MVert *vert, const bool vert_allocated,
index 416ac3cbaa02a40dea274ec15c5038ccd5d3efb9..440db9112989339db5ee6e125af7b1f1c82b0059 100644 (file)
@@ -1127,7 +1127,7 @@ BVHTree *bvhtree_from_editmesh_looptri(
  *
  * \note for editmesh this is currently a duplicate of bvhtree_from_mesh_faces
  */
-BVHTree *bvhtree_from_mesh_looptri(
+static BVHTree *bvhtree_from_mesh_looptri(
         BVHTreeFromMesh *data, DerivedMesh *dm,
         float epsilon, int tree_type, int axis)
 {
index cf4c70c4aaa39af7179f94a6dbdb9276c2183cff..1b05745550dd95c2f6547bd2e87d7b9f260febfe 100644 (file)
@@ -1409,7 +1409,7 @@ void BKE_mesh_remap_calc_loops_from_dm(
                        }
                        else {
                                BLI_assert(num_trees == 1);
-                               bvhtree_from_mesh_looptri(&treedata[0], dm_src, 0.0, 2, 6);
+                               bvhtree_from_mesh_get(&treedata[0], dm_src, BVHTREE_FROM_LOOPTRI, 2);
                        }
                }
 
index be63fc4abc8dc918b0ed714bd21dd7a3bef25048..9b8a98a8831245dea0ed6c747eab5d094d3c972c 100644 (file)
@@ -336,7 +336,7 @@ static void rna_Object_ray_cast(
                BVHTreeFromMesh treeData = {NULL};
 
                /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
-               bvhtree_from_mesh_looptri(&treeData, ob->derivedFinal, 0.0f, 4, 6);
+               bvhtree_from_mesh_get(&treeData, ob->derivedFinal, BVHTREE_FROM_LOOPTRI, 4);
 
                /* may fail if the mesh has no faces, in that case the ray-cast misses */
                if (treeData.tree != NULL) {
@@ -385,7 +385,7 @@ static void rna_Object_closest_point_on_mesh(
        }
 
        /* no need to managing allocation or freeing of the BVH data. this is generated and freed as needed */
-       bvhtree_from_mesh_looptri(&treeData, ob->derivedFinal, 0.0f, 4, 6);
+       bvhtree_from_mesh_get(&treeData, ob->derivedFinal, BVHTREE_FROM_LOOPTRI, 4);
 
        if (treeData.tree == NULL) {
                BKE_reportf(reports, RPT_ERROR, "Object '%s' could not create internal data for finding nearest point",