diff options
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 45198af0515..ebe73ed1044 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1266,12 +1266,12 @@ static float calc_nearest_point_squared(const float proj[3], BVHNode *node, floa /* nearest on AABB hull */ for (i = 0; i != 3; i++, bv += 2) { - if (bv[0] > proj[i]) - nearest[i] = bv[0]; - else if (bv[1] < proj[i]) - nearest[i] = bv[1]; - else - nearest[i] = proj[i]; + float val = proj[i]; + if (bv[0] > val) + val = bv[0]; + if (bv[1] < val) + val = bv[1]; + nearest[i] = val; } return len_squared_v3v3(proj, nearest); |