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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user