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.

This commit is contained in:
Lukas Toenne 2011-06-11 14:08:46 +00:00
parent e0dee9b41d
commit fbd5b4eb53

@ -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)
{