diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-06-27 17:52:20 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-06-27 17:52:20 +0300 |
commit | 14f056144e3e1a94188034eae71bd56c3a1feec9 (patch) | |
tree | 1104556af9935dcaaed78ed8738ecf7b0b7058cf /source/blender/blenlib/intern/math_geom.c | |
parent | 9466d1579df37e108ef52e03984b88c64c926dbe (diff) |
Bendy Bones Instability Fix - Second Attempt
So the error seems to be in cubic_tangent_factor_circle_v3(),
which was introduced with D2001.
I've tweaked the most obvious culprit here - the epsilon factor.
It used to be 10^-7, but I've reduced it down to 10^-5 now,
and it's looking a lot more stable now :)
---------
BTW, about the derivation of the magic 0.390464 factor I briefly subbed back
as a workaround for this bug, see:
http://www.whizkidtech.redprince.net/bezier/circle/
Diffstat (limited to 'source/blender/blenlib/intern/math_geom.c')
-rw-r--r-- | source/blender/blenlib/intern/math_geom.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 124f0c7abb8..82f527942e8 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -5002,7 +5002,9 @@ float cubic_tangent_factor_circle_v3(const float tan_l[3], const float tan_r[3]) BLI_ASSERT_UNIT_V3(tan_l); BLI_ASSERT_UNIT_V3(tan_r); - const float eps = 1e-7f; + /* -7f causes instability/glitches with Bendy Bones + Custom Refs */ + const float eps = 1e-5f; + const float tan_dot = dot_v3v3(tan_l, tan_r); if (tan_dot > 1.0f - eps) { /* no angle difference (use fallback, length wont make any difference) */ |