[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37410] trunk/blender/source/blender/ blenkernel/intern/bvhutils.c: 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.

Lukas Toenne lukas.toenne at googlemail.com
Sat Jun 11 16:08:46 CEST 2011


Revision: 37410
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37410
Author:   lukastoenne
Date:     2011-06-11 14:08:46 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/bvhutils.c

Modified: trunk/blender/source/blender/blenkernel/intern/bvhutils.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/bvhutils.c	2011-06-11 13:12:57 UTC (rev 37409)
+++ trunk/blender/source/blender/blenkernel/intern/bvhutils.c	2011-06-11 14:08:46 UTC (rev 37410)
@@ -493,7 +493,7 @@
 	
 	// 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)
 	{




More information about the Bf-blender-cvs mailing list