diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2020-11-21 21:45:14 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2021-10-20 12:58:19 +0300 |
commit | 16eafdadf6040fb84bacf657ac0bf16a78e1057e (patch) | |
tree | f4f89df1993cc18a60775f2a1a21bc6fd67878ea /source/blender/editors/include | |
parent | df445cc571bd1cf7fab4c5c8474f5e185a757fe2 (diff) |
Fix precision issues and a bug in vec_roll_to_mat3_normalized.
When the input vector gets close to -Y, y and theta becomes totally
unreliable. It is thus necessary to compute the result in a different
way based on x and z. The code already had a special case, but:
- The threshold for using the special case was way too low.
- The special case was not precise enough to extend the threshold.
- The special case math had a sign error, resulting in a jump.
This adds tests for the computation precision and fixes the issues
by adjusting the threshold, and replacing the special case with one
based on a quadratic Taylor expansion of sqrt instead of linear.
Replacing the special case fixes the bug and results in a compatibility
break, requiring versioning for the roll of affected bones.
Differential Revision: https://developer.blender.org/D9551
Diffstat (limited to 'source/blender/editors/include')
0 files changed, 0 insertions, 0 deletions