diff options
author | datenwolf <code+github@datenwolf.net> | 2019-04-16 11:42:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-16 11:42:17 +0200 |
commit | 22d1adc070c903d25ac9ff5614e63722b2d575e6 (patch) | |
tree | 1ce26bd0895048efcca8f6e1a43e0ca68f3b4a1d | |
parent | 4af990a5e6dd8eb45426d1af6e25899adbf96d79 (diff) | |
parent | 06449fb862afea9092e33adfda416d5b677ad05a (diff) | |
download | linmath.h-22d1adc070c903d25ac9ff5614e63722b2d575e6.tar.gz linmath.h-22d1adc070c903d25ac9ff5614e63722b2d575e6.tar.bz2 |
Merge pull request #32 from nwn/master
Fix bug in mat4x4_orthonormalize
-rw-r--r-- | linmath.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -321,12 +321,11 @@ LINMATH_H_FUNC void mat4x4_orthonormalize(mat4x4 R, mat4x4 M) s = vec3_mul_inner(R[1], R[2]); vec3_scale(h, R[2], s); vec3_sub(R[1], R[1], h); - vec3_norm(R[2], R[2]); + vec3_norm(R[1], R[1]); - s = vec3_mul_inner(R[1], R[2]); + s = vec3_mul_inner(R[0], R[2]); vec3_scale(h, R[2], s); - vec3_sub(R[1], R[1], h); - vec3_norm(R[1], R[1]); + vec3_sub(R[0], R[0], h); s = vec3_mul_inner(R[0], R[1]); vec3_scale(h, R[1], s); |