diff options
Diffstat (limited to 'source/blender/blenkernel/intern/bvhutils.c')
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 1d7ae76d1f9..b5409584f58 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -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. */ |