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:
-rw-r--r--source/blender/blenlib/BLI_kdopbvh.h2
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c18
-rw-r--r--source/blender/editors/transform/transform_snap.c2
3 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h
index d7ff55eda7a..f1ef1d9f9b9 100644
--- a/source/blender/blenlib/BLI_kdopbvh.h
+++ b/source/blender/blenlib/BLI_kdopbvh.h
@@ -141,7 +141,7 @@ int BLI_bvhtree_find_nearest(
BVHTree_NearestPointCallback callback, void *userdata);
int BLI_bvhtree_find_nearest_to_ray(
- BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeNearest *nearest,
+ BVHTree *tree, const float co[3], const float dir[3], BVHTreeNearest *nearest,
BVHTree_NearestToRayCallback callback, void *userdata);
int BLI_bvhtree_ray_cast_ex(
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index caf89efd4c4..b7a46085bc3 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -1512,8 +1512,9 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
#endif
-int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest,
- BVHTree_NearestPointCallback callback, void *userdata)
+int BLI_bvhtree_find_nearest(
+ BVHTree *tree, const float co[3], BVHTreeNearest *nearest,
+ BVHTree_NearestPointCallback callback, void *userdata)
{
axis_t axis_iter;
@@ -1870,6 +1871,13 @@ int BLI_bvhtree_ray_cast_all(
return BLI_bvhtree_ray_cast_all_ex(tree, co, dir, radius, callback, userdata, BVH_RAYCAST_DEFAULT);
}
+
+/* -------------------------------------------------------------------- */
+
+/** \name BLI_bvhtree_find_nearest_to_ray
+ *
+ * \{ */
+
static float calc_dist_sq_to_ray(BVHNearestRayData *data, BVHNode *node)
{
const float *bv = node->bv;
@@ -1926,8 +1934,8 @@ static void dfs_find_nearest_to_ray_begin(BVHNearestRayData *data, BVHNode *node
}
int BLI_bvhtree_find_nearest_to_ray(
- BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeNearest *nearest,
- BVHTree_NearestToRayCallback callback, void *userdata)
+ BVHTree *tree, const float co[3], const float dir[3], BVHTreeNearest *nearest,
+ BVHTree_NearestToRayCallback callback, void *userdata)
{
BVHNearestRayData data;
BVHNode *root = tree->nodes[tree->totleaf];
@@ -1941,7 +1949,7 @@ int BLI_bvhtree_find_nearest_to_ray(
copy_v3_v3(data.ray.origin, co);
copy_v3_v3(data.ray.direction, dir);
- data.ray.radius = radius;
+ data.ray.radius = 0.0f; /* unused here */
dist_squared_ray_to_aabb_v3_precalc(&data.nearest_precalc, co, dir);
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 89bb63dd906..3622012c2c8 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -1673,7 +1673,7 @@ static bool snapDerivedMesh(
nearest.dist_sq = local_depth * local_depth;
if (treedata.tree &&
BLI_bvhtree_find_nearest_to_ray(
- treedata.tree, ray_start_local, ray_normal_local, 0.0f,
+ treedata.tree, ray_start_local, ray_normal_local,
&nearest, NULL, NULL) != -1)
{
const MVert *v = &treedata.vert[nearest.index];