aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-04-10 09:06:00 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-04-10 09:06:00 -0600
commit42462d9253229835800814519593d6af0b5fbfc4 (patch)
treee044d12f084f0717c4b78571cb161347170aa58d
parent7f4385538d6b19ea5dd3f00c4a0eb49385798031 (diff)
downloadlibsurvive-42462d9253229835800814519593d6af0b5fbfc4.tar.gz
libsurvive-42462d9253229835800814519593d6af0b5fbfc4.tar.bz2
Added utility function to linmath
-rw-r--r--redist/linmath.c7
-rw-r--r--redist/linmath.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/redist/linmath.c b/redist/linmath.c
index 50baeab..f4c3635 100644
--- a/redist/linmath.c
+++ b/redist/linmath.c
@@ -173,6 +173,13 @@ inline void axisanglefromquat(FLT *angle, FLT *axis, FLT *q) {
// Originally from Mercury (Copyright (C) 2009 by Joshua Allen, Charles Lohr, Adam Lowman)
// Under the mit/X11 license.
+inline void quatset(LinmathQuat q, FLT w, FLT x, FLT y, FLT z) {
+ q[0] = w;
+ q[1] = x;
+ q[2] = y;
+ q[3] = z;
+}
+
inline void quatsetnone(LinmathQuat q) {
q[0] = 1;
q[1] = 0;
diff --git a/redist/linmath.h b/redist/linmath.h
index 60cc9d6..29db5a9 100644
--- a/redist/linmath.h
+++ b/redist/linmath.h
@@ -99,6 +99,7 @@ LINMATH_EXPORT void axisanglefromquat(FLT *angle, FLT *axis, LinmathQuat quat);
typedef FLT LinmathEulerAngle[3];
+LINMATH_EXPORT void quatset(LinmathQuat q, FLT w, FLT x, FLT y, FLT z);
LINMATH_EXPORT void quatsetnone(LinmathQuat q);
LINMATH_EXPORT void quatcopy(LinmathQuat q, const LinmathQuat qin);
LINMATH_EXPORT void quatfromeuler(LinmathQuat q, const LinmathEulerAngle euler);