aboutsummaryrefslogtreecommitdiff
path: root/redist/lintest.c
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2017-03-11 16:36:28 -0500
committercnlohr <lohr85@gmail.com>2017-03-11 16:36:28 -0500
commit0d286eef9634116828ead278f9534f04ecbb6ecd (patch)
tree0ef5b705a6fa273fb261d46f6d59baa7d9c51fcc /redist/lintest.c
parentcdc60d110a9cd69c5bd8c0ac4e67db1ce7cecc93 (diff)
downloadlibsurvive-0d286eef9634116828ead278f9534f04ecbb6ecd.tar.gz
libsurvive-0d286eef9634116828ead278f9534f04ecbb6ecd.tar.bz2
Update a few files... need to get working with linmath. But first switching accounts.
Diffstat (limited to 'redist/lintest.c')
-rw-r--r--redist/lintest.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/redist/lintest.c b/redist/lintest.c
new file mode 100644
index 0000000..0a268ff
--- /dev/null
+++ b/redist/lintest.c
@@ -0,0 +1,41 @@
+#include "linmath.h"
+#include <stdio.h>
+
+int main()
+{
+
+ FLT e[3] = { 1,1,3.14 };
+ FLT q[4];
+ FLT m[16];
+
+ quatfromeuler( q, e );
+ printf( "%f %f %f %f\n\n", PFFOUR( q ) );
+ quattomatrix(m,q);
+ printf( "%f %f %f %f\n", PFFOUR( &m[0] ) );
+ printf( "%f %f %f %f\n", PFFOUR( &m[4] ) );
+ printf( "%f %f %f %f\n", PFFOUR( &m[8] ) );
+ printf( "%f %f %f %f\n\n", PFFOUR( &m[12] ) );
+ quatfrommatrix(q,m );
+ printf( "%f %f %f %f\n\n", PFFOUR( q ) );
+ quattoeuler( e,q );
+ printf( "E: %f %f %f\n", e[0], e[1], e[2] );
+
+
+ FLT p[3] = { 0, 0, 1 };
+ printf( "%f %f %f\n", PFTHREE( p ) );
+ quatrotatevector( p, q, p );
+ printf( "%f %f %f\n", PFTHREE( p ) );
+ printf( "Flipping rotation\n" );
+ q[0] *= -1; //Wow that was easy.
+ quatrotatevector( p, q, p );
+ printf( "%f %f %f\n", PFTHREE( p ) );
+
+
+ //Try setting up a pose.
+ FLT mypose[7] = { 0, 0, 10, q[0], q[1], q[2], q[3] );
+ ApplyPoseToPoint( FLT * pout, const FLT * pin, const FLT * pose );
+void InvertPose( FLT * poseout, const FLT * pose );
+
+
+}
+