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:
Diffstat (limited to 'source/blender/blenkernel/intern/bvhutils.c')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index cd2c7194237..90a75b8d3cc 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -501,7 +501,7 @@ BVHTree *bvhtree_from_editmesh_verts(
/* Builds a bvh tree where nodes are the vertices of the given dm
* and stores the BVHTree in dm->bvhCache */
-BVHTree *bvhtree_from_mesh_verts(
+static BVHTree *bvhtree_from_mesh_verts(
BVHTreeFromMesh *data, DerivedMesh *dm,
float epsilon, int tree_type, int axis)
{
@@ -859,7 +859,7 @@ static void bvhtree_from_mesh_faces_setup_data(
}
/* Builds a bvh tree where nodes are the tesselated faces of the given dm */
-BVHTree *bvhtree_from_mesh_faces(
+static BVHTree *bvhtree_from_mesh_faces(
BVHTreeFromMesh *data, DerivedMesh *dm,
float epsilon, int tree_type, int axis)
{
@@ -1225,6 +1225,25 @@ BVHTree *bvhtree_from_mesh_looptri_ex(
return tree;
}
+/**
+ * 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)
+{
+ switch (type) {
+ case BVHTREE_FROM_VERTS:
+ return bvhtree_from_mesh_verts(data, mesh, 0.0f, 2, 6);
+ case BVHTREE_FROM_EDGES:
+ return bvhtree_from_mesh_edges(data, mesh, 0.0f, 2, 6);
+ case BVHTREE_FROM_FACES:
+ return bvhtree_from_mesh_faces(data, mesh, 0.0f, 2, 6);
+ case BVHTREE_FROM_LOOPTRI:
+ return bvhtree_from_mesh_looptri(data, mesh, 0.0f, 2, 6);
+ }
+ return NULL;
+}
+
/** \} */