diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2020-10-31 23:46:11 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2020-10-31 23:46:11 +0300 |
commit | 30826a5e49c7429d330fa47d0a6bfb2b13a698d1 (patch) | |
tree | 05b3c58aeec0979ae44d24e589ac345724e52836 | |
parent | 9af6c041e8fc2f32d9db53b7821111ca724ead17 (diff) |
Fix new boolean performance bug.
The code that decided to use a faster double version of plane
side testing forgot to take an absolute value, so half the time
the exact code was being used when it was unnecessary.
-rw-r--r-- | source/blender/blenlib/intern/mesh_intersect.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index c36dfa80be7..a777833dff4 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -1550,7 +1550,7 @@ static int filter_plane_side(const double3 &p, } double supremum = double3::dot(abs_p + abs_plane_p, abs_plane_no); double err_bound = supremum * index_plane_side * DBL_EPSILON; - if (d > err_bound) { + if (fabs(d) > err_bound) { return d > 0 ? 1 : -1; } return 0; |