aboutsummaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-12-01 12:31:55 +0000
committerGitHub <noreply@github.com>2025-12-01 12:31:55 +0000
commit6922ab15fb06e5abfee0ce35dd596d619b58fb7e (patch)
tree587fd0eb3f718d0265fa014de5569c4890bebe6b /core/math
parent4fdaa867a7a8c627f8f0899f534e189132aefb5c (diff)
parent9a321befd4fe8dbf6335b09c3277f4ae4d1d5ed3 (diff)
Merge pull request #5864 from Skyress-s/master
fix: linalg.quaternion_from_forward_and_up()
Diffstat (limited to 'core/math')
-rw-r--r--core/math/linalg/specific.odin6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/linalg/specific.odin b/core/math/linalg/specific.odin
index 3c37d4d25..cfb1c2b0d 100644
--- a/core/math/linalg/specific.odin
+++ b/core/math/linalg/specific.odin
@@ -635,7 +635,7 @@ quaternion_from_forward_and_up_f16 :: proc "contextless" (forward, up: Vector3f1
case:
S := 2 * math.sqrt(1 + m[2, 2] - m[0, 0] - m[1, 1])
q.w = (m[0, 1] - m[1, 0]) / S
- q.x = (m[2, 0] - m[0, 2]) / S
+ q.x = (m[2, 0] + m[0, 2]) / S
q.y = (m[2, 1] + m[1, 2]) / S
q.z = 0.25 * S
}
@@ -679,7 +679,7 @@ quaternion_from_forward_and_up_f32 :: proc "contextless" (forward, up: Vector3f3
case:
S := 2 * math.sqrt(1 + m[2, 2] - m[0, 0] - m[1, 1])
q.w = (m[0, 1] - m[1, 0]) / S
- q.x = (m[2, 0] - m[0, 2]) / S
+ q.x = (m[2, 0] + m[0, 2]) / S
q.y = (m[2, 1] + m[1, 2]) / S
q.z = 0.25 * S
}
@@ -723,7 +723,7 @@ quaternion_from_forward_and_up_f64 :: proc "contextless" (forward, up: Vector3f6
case:
S := 2 * math.sqrt(1 + m[2, 2] - m[0, 0] - m[1, 1])
q.w = (m[0, 1] - m[1, 0]) / S
- q.x = (m[2, 0] - m[0, 2]) / S
+ q.x = (m[2, 0] + m[0, 2]) / S
q.y = (m[2, 1] + m[1, 2]) / S
q.z = 0.25 * S
}