Browse Source

Fix linalg.euler_angles_from_quaternion

vassvik 5 years ago
parent
commit
dd13cf637e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/math/linalg/specific.odin

+ 1 - 1
core/math/linalg/specific.odin

@@ -212,7 +212,7 @@ euler_angles_from_quaternion :: proc(q: Quaternion) -> (roll, pitch, yaw: Float)
     if abs(sinp) >= 1 {
     if abs(sinp) >= 1 {
         pitch = math.copy_sign(math.TAU * 0.25, sinp);
         pitch = math.copy_sign(math.TAU * 0.25, sinp);
     } else {
     } else {
-        pitch = math.asin(sinp);
+        pitch = 2 * math.asin(sinp);
     }
     }
 
 
     // yaw, z-axis rotation
     // yaw, z-axis rotation