Closed Nico8340 closed 1 month ago
Congrats 🎉!
It works for the most part, but the object gets flipped at -90 on Y axis if treshold returns values near -0.5. Probably an oversight, unsure if it's a definite fix.
elseif treshold < -0.499 then
return {math.deg(2 * math.atan2(q1, q0)), -90, 0}
Great job anyways!!
It works for the most part, but the object gets flipped at -90 on Y axis if treshold returns values near -0.5. Probably an oversight, unsure if it's a definite fix.
elseif treshold < -0.499 then return {math.deg(2 * math.atan2(q1, q0)), -90, 0}
Great job anyways!!
It was done this way on purpose, to deal with problems caused by gimbal lock. If you want, you can make a fork of my fork (pun intended) and test it yourself.
Description
This pull request improves the logic of converting from quaternion to Euler, thus eliminating previously discovered rotation issues. Thus fixes #496
Explanation
The issue originates from the logic of the
getEulerFromQuat
function, which was fixed by handling euler singularities. The function has been refactored above for easier readability.