Merge pull request #3642 from 2nafish117/fix-pitch-from-quat

Fix pitch_from_quaternion
This commit is contained in:
gingerBill
2024-05-27 22:24:46 +01:00
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -159,7 +159,7 @@ roll_from_quaternion_f16 :: proc "contextless" (q: Quaternionf16) -> f16 {
@(require_results)
pitch_from_quaternion_f16 :: proc "contextless" (q: Quaternionf16) -> f16 {
y := 2 * (q.y*q.z + q.w*q.w)
y := 2 * (q.y*q.z + q.w*q.x)
x := q.w*q.w - q.x*q.x - q.y*q.y + q.z*q.z
if abs(x) <= F16_EPSILON && abs(y) <= F16_EPSILON {

View File

@@ -159,7 +159,7 @@ roll_from_quaternion_f32 :: proc "contextless" (q: Quaternionf32) -> f32 {
@(require_results)
pitch_from_quaternion_f32 :: proc "contextless" (q: Quaternionf32) -> f32 {
y := 2 * (q.y*q.z + q.w*q.w)
y := 2 * (q.y*q.z + q.w*q.x)
x := q.w*q.w - q.x*q.x - q.y*q.y + q.z*q.z
if abs(x) <= F32_EPSILON && abs(y) <= F32_EPSILON {

View File

@@ -159,7 +159,7 @@ roll_from_quaternion_f64 :: proc "contextless" (q: Quaternionf64) -> f64 {
@(require_results)
pitch_from_quaternion_f64 :: proc "contextless" (q: Quaternionf64) -> f64 {
y := 2 * (q.y*q.z + q.w*q.w)
y := 2 * (q.y*q.z + q.w*q.x)
x := q.w*q.w - q.x*q.x - q.y*q.y + q.z*q.z
if abs(x) <= F64_EPSILON && abs(y) <= F64_EPSILON {