rotation axis is undefined for small angles and therefore gets a NaN

This commit is contained in:
Claudio Zambaldi 2010-05-03 18:27:19 +00:00
parent 9a257fb68b
commit adaeb0e1ef
1 changed files with 1 additions and 0 deletions

View File

@ -1391,6 +1391,7 @@ pure function math_transpose3x3(A)
if (sinHalfAngle <= 1.0e-4_pReal) then ! very small rotation angle?
math_QuaternionToAxisAngle = 0.0_pReal
math_QuaternionToAxisAngle(1:3) = NaN
else
math_QuaternionToAxisAngle(1:3) = Q(2:4)/sinHalfAngle
math_QuaternionToAxisAngle(4) = halfAngle*2.0_pReal*inDeg