Remove unused function: `BKE_bvhtree_from_mesh_looptri`.
authorGermano <germano.costa@ig.com.br>
Sat, 12 May 2018 15:05:54 +0000 (12:05 -0300)
committerGermano <germano.costa@ig.com.br>
Sat, 12 May 2018 15:05:54 +0000 (12:05 -0300)
source/blender/blenkernel/BKE_bvhutils.h
source/blender/blenkernel/intern/bvhutils.c

index 1fcb5be127b6f597234b99210ee8665a1ff28508..09248bc2342472a9a0573316bc181826a93000d2 100644 (file)
@@ -143,8 +143,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 *BKE_bvhtree_from_mesh_looptri(
-        struct BVHTreeFromMesh *data, struct Mesh *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 1d7ae76d1f9fb4aee0b71fcf8114b6eaeef1d359..b5409584f5840010d06de2c2a06364387133e7f4 100644 (file)
@@ -1257,70 +1257,6 @@ BVHTree *bvhtree_from_mesh_get(
        return tree;
 }
 
-/* This is a Mesh-specific copy of bvhtree_from_mesh_looptri() */
-/**
- * Builds a bvh tree where nodes are the looptri faces of the given mesh.
- *
- * \note for editmesh this is currently a duplicate of bvhtree_from_mesh_faces
- */
-BVHTree *BKE_bvhtree_from_mesh_looptri(
-        BVHTreeFromMesh *data, Mesh *mesh,
-        float epsilon, int tree_type, int axis)
-{
-       BVHTree *tree;
-       MVert *mvert = NULL;
-       MLoop *mloop = NULL;
-       const MLoopTri *looptri = NULL;
-
-       BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_READ);
-       tree = bvhcache_find(mesh->runtime.bvh_cache, BVHTREE_FROM_LOOPTRI);
-       BLI_rw_mutex_unlock(&cache_rwlock);
-
-       mvert = mesh->mvert;
-       mloop = mesh->mloop;
-       looptri = BKE_mesh_runtime_looptri_ensure(mesh);
-
-       /* Not in cache */
-       if (tree == NULL) {
-               BLI_rw_mutex_lock(&cache_rwlock, THREAD_LOCK_WRITE);
-               tree = bvhcache_find(mesh->runtime.bvh_cache, BVHTREE_FROM_LOOPTRI);
-               if (tree == NULL) {
-                       int looptri_num = BKE_mesh_runtime_looptri_len(mesh);
-
-                       /* this assert checks we have looptris,
-                        * if not caller should use DM_ensure_looptri() */
-                       BLI_assert(!(looptri_num == 0 && mesh->totpoly != 0));
-
-                       tree = bvhtree_from_mesh_looptri_create_tree(
-                               epsilon, tree_type, axis,
-                               mvert, mloop, looptri, looptri_num, NULL, -1);
-                       if (tree) {
-                               /* Save on cache for later use */
-                               /* printf("BVHTree built and saved on cache\n"); */
-                               bvhcache_insert(&mesh->runtime.bvh_cache, tree, BVHTREE_FROM_LOOPTRI);
-                       }
-               }
-               BLI_rw_mutex_unlock(&cache_rwlock);
-       }
-       else {
-               /* printf("BVHTree is already build, using cached tree\n"); */
-       }
-
-       if (tree) {
-               /* Setup BVHTreeFromMesh */
-               bvhtree_from_mesh_looptri_setup_data(
-                       data, tree, true,
-                       mvert, false,
-                       mloop, false,
-                       looptri, false);
-       }
-       else {
-               memset(data, 0, sizeof(*data));
-       }
-
-       return tree;
-}
-
 /**
  * Builds or queries a bvhcache for the cache bvhtree of the request type.
  */