summaryrefslogtreecommitdiffstats
path: root/src/corelib/compat
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-06-12 15:57:23 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2023-08-18 18:39:14 +0200
commit820eff05f4ea934e11382ab32e318cb1fdd6954c (patch)
treea3095a53b62f9dcb9278024259cb396906807760 /src/corelib/compat
parent132be307fff049e83ba8b93733fc571c0c45469b (diff)
Use atan2() in Quaternion axis-and-angle
It's more numerically robust than acos() - we can't hit a range error if we get strange rounding effects - and we've got the value of the sin of the angle already (it's the length of the x, y, z part), so might as well use it. As length is necessarily positive, atan2() will give an upper-half-plane resolution, matching what acos() gave us. This incidentally means that you no longer need to normalize() your quaternion before you ask for axis and angle. Task-number: QTBUG-114313 Change-Id: If3fa2b371c72991f1f8f151f78ef7f9180aa87cf Reviewed-by: Matthias Rauter <matthias.rauter@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/corelib/compat')
0 files changed, 0 insertions, 0 deletions