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.
This commit is contained in:
Howard Trickey 2020-10-31 16:46:11 -04:00
parent 9af6c041e8
commit 30826a5e49
Notes: blender-bot 2023-02-14 02:45:41 +01:00
Referenced by issue #82549, Broken broken parent system from console or hotkey
Referenced by issue #82042, Crash when rendering huge images on CPU 2.92.0 alpha
1 changed files with 1 additions and 1 deletions

View File

@ -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;