diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-03-09 15:51:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-09 15:51:53 +0000 |
| commit | 04666746d7d1196d063b4a6c425cae316707c8db (patch) | |
| tree | b88580f0e2269dcb1c7ab4453beaa3d41bd4f35e | |
| parent | f88af59372ae448f19d26c079d01df025002508d (diff) | |
| parent | b2e7eb4db4bc6e1849b5d1b5d903132ca1f2d05e (diff) | |
Merge pull request #3261 from spindlebink/fix-orthonormalize
Properly initialize return matrices in linalg.orthonormalize
| -rw-r--r-- | core/math/linalg/specific.odin | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/math/linalg/specific.odin b/core/math/linalg/specific.odin index d51a034d1..41d0e5344 100644 --- a/core/math/linalg/specific.odin +++ b/core/math/linalg/specific.odin @@ -2711,6 +2711,7 @@ to_quaternion :: proc{ @(require_results) matrix2_orthonormalize_f16 :: proc "contextless" (m: Matrix2f16) -> (r: Matrix2f16) #no_bounds_check { + r = m r[0] = normalize(m[0]) d0 := dot(r[0], r[1]) @@ -2721,6 +2722,7 @@ matrix2_orthonormalize_f16 :: proc "contextless" (m: Matrix2f16) -> (r: Matrix2f } @(require_results) matrix2_orthonormalize_f32 :: proc "contextless" (m: Matrix2f32) -> (r: Matrix2f32) #no_bounds_check { + r = m r[0] = normalize(m[0]) d0 := dot(r[0], r[1]) @@ -2731,6 +2733,7 @@ matrix2_orthonormalize_f32 :: proc "contextless" (m: Matrix2f32) -> (r: Matrix2f } @(require_results) matrix2_orthonormalize_f64 :: proc "contextless" (m: Matrix2f64) -> (r: Matrix2f64) #no_bounds_check { + r = m r[0] = normalize(m[0]) d0 := dot(r[0], r[1]) @@ -2748,6 +2751,7 @@ matrix2_orthonormalize :: proc{ @(require_results) matrix3_orthonormalize_f16 :: proc "contextless" (m: Matrix3f16) -> (r: Matrix3f16) #no_bounds_check { + r = m r[0] = normalize(m[0]) d0 := dot(r[0], r[1]) @@ -2763,6 +2767,7 @@ matrix3_orthonormalize_f16 :: proc "contextless" (m: Matrix3f16) -> (r: Matrix3f } @(require_results) matrix3_orthonormalize_f32 :: proc "contextless" (m: Matrix3f32) -> (r: Matrix3f32) #no_bounds_check { + r = m r[0] = normalize(m[0]) d0 := dot(r[0], r[1]) @@ -2778,6 +2783,7 @@ matrix3_orthonormalize_f32 :: proc "contextless" (m: Matrix3f32) -> (r: Matrix3f } @(require_results) matrix3_orthonormalize_f64 :: proc "contextless" (m: Matrix3f64) -> (r: Matrix3f64) #no_bounds_check { + r = m r[0] = normalize(m[0]) d0 := dot(r[0], r[1]) |