diff options
author | Michael Turvey <mwturvey@users.noreply.github.com> | 2017-05-02 14:50:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 14:50:35 -0700 |
commit | c5463fb50eaa91aebe824235c973a287b8edc3c5 (patch) | |
tree | b24c5c73d68fda56f1e53e2f9a87cfb03ba62fd7 /redist | |
parent | 9fa8d49071b86ce64ea330d3d28b1ea8bcf4c4be (diff) | |
parent | 72669fd63a9dc68ffe52887bb24ed7baef9975bf (diff) | |
download | libsurvive-c5463fb50eaa91aebe824235c973a287b8edc3c5.tar.gz libsurvive-c5463fb50eaa91aebe824235c973a287b8edc3c5.tar.bz2 |
Merge pull request #63 from mwturvey/Fix_quatfrom2vectors
Fixing quatfrom2vectors
Diffstat (limited to 'redist')
-rw-r--r-- | redist/linmath.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/redist/linmath.c b/redist/linmath.c index caff1de..5fefe1e 100644 --- a/redist/linmath.c +++ b/redist/linmath.c @@ -520,17 +520,15 @@ void quatfrom2vectors(FLT *q, const FLT *src, const FLT *dest) FLT invs = 1 / s; FLT c[3]; - //cross3d(c, v0, v1); - cross3d(c, v1, v0); + cross3d(c, v0, v1); - q[0] = c[0] * invs; - q[1] = c[1] * invs; - q[2] = c[2] * invs; - q[3] = s * 0.5f; + q[0] = s * 0.5f; + q[1] = c[0] * invs; + q[2] = c[1] * invs; + q[3] = c[2] * invs; quatnormalize(q, q); } - } void matrix44copy(FLT * mout, const FLT * minm ) |