Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano <germano.costa@ig.com.br>2018-05-03 20:33:52 +0300
committerGermano <germano.costa@ig.com.br>2018-05-03 20:33:52 +0300
commita9d264f5ca1d631e1151bff55fd8cb3c87193bce (patch)
tree9c70cb490d8056f7f54a117eac4bdcba7a2c3237 /source/blender/blenkernel/intern/bvhutils.c
parent20185a8681f15f3e4e129e064fbe9a150dc4c963 (diff)
parentac19483e632bd3e2388a6a0de2db753efe33a860 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/bvhutils.c')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 90a75b8d3cc..7f50fcfcb2b 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -1229,19 +1229,30 @@ BVHTree *bvhtree_from_mesh_looptri_ex(
* Builds or queries a bvhcache for the cache bvhtree of the request type.
*/
BVHTree *bvhtree_from_mesh_get(
- struct BVHTreeFromMesh *data, struct DerivedMesh *mesh, int type)
+ struct BVHTreeFromMesh *data, struct DerivedMesh *mesh,
+ const int type, const int tree_type)
{
+ BVHTree *tree = NULL;
switch (type) {
case BVHTREE_FROM_VERTS:
- return bvhtree_from_mesh_verts(data, mesh, 0.0f, 2, 6);
+ tree = bvhtree_from_mesh_verts(data, mesh, 0.0f, tree_type, 6);
+ break;
case BVHTREE_FROM_EDGES:
- return bvhtree_from_mesh_edges(data, mesh, 0.0f, 2, 6);
+ tree = bvhtree_from_mesh_edges(data, mesh, 0.0f, tree_type, 6);
+ break;
case BVHTREE_FROM_FACES:
- return bvhtree_from_mesh_faces(data, mesh, 0.0f, 2, 6);
+ tree = bvhtree_from_mesh_faces(data, mesh, 0.0f, tree_type, 6);
+ break;
case BVHTREE_FROM_LOOPTRI:
- return bvhtree_from_mesh_looptri(data, mesh, 0.0f, 2, 6);
+ tree = bvhtree_from_mesh_looptri(data, mesh, 0.0f, tree_type, 6);
+ break;
}
- return NULL;
+#ifdef DEBUG
+ if (BLI_bvhtree_get_tree_type(tree) != tree_type) {
+ printf("tree_type %d obtained instead of %d\n", BLI_bvhtree_get_tree_type(tree), tree_type);
+ }
+#endif
+ return tree;
}
/** \} */