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:
authorLukas Toenne <lukas.toenne@googlemail.com>2011-06-11 18:08:46 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2011-06-11 18:08:46 +0400
commitfbd5b4eb535c06cc298b8f5ea98be9da087527a3 (patch)
tree3024c697af660a5f0876f215758764e817e4b807 /source/blender/blenkernel/intern/bvhutils.c
parente0dee9b41d2ecc6ef6062becd7ba84a1d3d3163e (diff)
Fix for edge mesh BVH: The edge distance callback for leaf nodes was calculating actual sqrt'ed distance, while needing squared distance to be compatible with bounding box checks. This also solves previous concerns about performance when using sqrt in the comparison callback.
Diffstat (limited to 'source/blender/blenkernel/intern/bvhutils.c')
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 5520e4d1d41..cc45abb5998 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -493,7 +493,7 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co,
// NOTE: casts to "float*" here are due to co being "const float*"
closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1);
- dist = len_v3v3(nearest_tmp, (float*)co);
+ dist = len_squared_v3v3(nearest_tmp, (float*)co);
if(dist < nearest->dist)
{