diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-05 10:42:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-05 10:44:02 +0300 |
commit | b8e0b2db56b1a6e5dc85640939b8664b2304a01f (patch) | |
tree | 952eb365d0bcdbb99548c71916b4b15556f17c3b /source | |
parent | ba188cf98d8387747a2fc389fc51dd459d061b15 (diff) |
Math Lib: isect_plane_*_v3 avoid negation
Unmeasurable speedup for plane intersection.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 72ae9597777..dad2a2fc288 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -1577,14 +1577,14 @@ bool isect_plane_plane_plane_v3( * plane_c.xyz.cross(plane_a.xyz) * -plane_b[3] + * plane_a.xyz.cross(plane_b.xyz) * -plane_c[3]) / det; */ - cross_v3_v3v3(tmp, plane_b, plane_c); - mul_v3_v3fl(r_isect_co, tmp, -plane_a[3]); + cross_v3_v3v3(tmp, plane_c, plane_b); + mul_v3_v3fl(r_isect_co, tmp, plane_a[3]); - cross_v3_v3v3(tmp, plane_c, plane_a); - madd_v3_v3fl(r_isect_co, tmp, -plane_b[3]); + cross_v3_v3v3(tmp, plane_a, plane_c); + madd_v3_v3fl(r_isect_co, tmp, plane_b[3]); - cross_v3_v3v3(tmp, plane_a, plane_b); - madd_v3_v3fl(r_isect_co, tmp, -plane_c[3]); + cross_v3_v3v3(tmp, plane_b, plane_a); + madd_v3_v3fl(r_isect_co, tmp, plane_c[3]); mul_v3_fl(r_isect_co, 1.0f / det); @@ -1625,11 +1625,11 @@ bool isect_plane_plane_v3( /* (plane_b.xyz.cross(plane_c.xyz) * -plane_a[3] + * plane_c.xyz.cross(plane_a.xyz) * -plane_b[3]) / det; */ - cross_v3_v3v3(tmp, plane_b, plane_c); - mul_v3_v3fl(r_isect_co, tmp, -plane_a[3]); + cross_v3_v3v3(tmp, plane_c, plane_b); + mul_v3_v3fl(r_isect_co, tmp, plane_a[3]); - cross_v3_v3v3(tmp, plane_c, plane_a); - madd_v3_v3fl(r_isect_co, tmp, -plane_b[3]); + cross_v3_v3v3(tmp, plane_a, plane_c); + madd_v3_v3fl(r_isect_co, tmp, plane_b[3]); mul_v3_fl(r_isect_co, 1.0f / det); |