Remove quaternion.h from the API. Quaternions are just float[4]s.
authorThibaut Girka <thib@sitedethib.com>
Sun, 25 Aug 2013 13:53:30 +0200
changeset 24 3fb6bcf82cae
parent 23 a460baf2a5c8
child 25 886eb810586c
Remove quaternion.h from the API. Quaternions are just float[4]s.
src/Makefile.am
src/hmd.c
src/hmd.h
src/hmd_private.h
src/test.c
--- a/src/Makefile.am	Mon Aug 19 21:13:32 2013 +0200
+++ b/src/Makefile.am	Sun Aug 25 13:53:30 2013 +0200
@@ -3,6 +3,7 @@
                    quaternion.c \
                    sensor_fusion.c \
                    stereo.c \
+                   quaternion.h \
                    hmd_private.h \
                    sensor_fusion.h \
                    backends/rift.c \
@@ -12,7 +13,7 @@
 libvr_la_LDFLAGS = $(hidapi_LIBS)$ -lm -no-undefined -version-info @LT_VERSION_INFO@
 libvr_la_CFLAGS = $(hidapi_CFLAGS)$
 
-include_HEADERS = hmd.h quaternion.h stereo.h display_info.h
+include_HEADERS = hmd.h stereo.h display_info.h
 
 noinst_PROGRAMS = test
 test_SOURCES = test.c
--- a/src/hmd.c	Mon Aug 19 21:13:32 2013 +0200
+++ b/src/hmd.c	Sun Aug 25 13:53:30 2013 +0200
@@ -64,7 +64,7 @@
 }
 
 
-int hmd_get_rotation(struct hmd *hmd, quaternion quat)
+int hmd_get_rotation(struct hmd *hmd, float quat[4])
 {
   if (hmd->get_rotation != NULL)
     return hmd->get_rotation(hmd->dev, quat);
--- a/src/hmd.h	Mon Aug 19 21:13:32 2013 +0200
+++ b/src/hmd.h	Sun Aug 25 13:53:30 2013 +0200
@@ -28,7 +28,6 @@
 #define __HMD_H__
 
 #include "display_info.h"
-#include "quaternion.h"
 #include "stereo.h"
 
 #define HMD_CAPABILITY_NONE     0
@@ -52,7 +51,8 @@
  The user is responsible for running it frequently enough */
 int hmd_update(struct hmd *hmd, unsigned int *time);
 
-int hmd_get_rotation(struct hmd *hmd, quaternion quat);
+/* quat = {w, x, y, z} */
+int hmd_get_rotation(struct hmd *hmd, float quat[4]);
 int hmd_get_position(struct hmd *hmd, float vec[3]);
 
 #endif
--- a/src/hmd_private.h	Mon Aug 19 21:13:32 2013 +0200
+++ b/src/hmd_private.h	Sun Aug 25 13:53:30 2013 +0200
@@ -35,7 +35,7 @@
   void (*close) (struct device *dev);
   int (*update) (struct device *dev, unsigned int *time);
   int (*get_display_info) (struct device *dev, struct display_info *info);
-  int (*get_rotation) (struct device *dev, quaternion quat);
+  int (*get_rotation) (struct device *dev, float quat[4]);
   int (*get_position) (struct device *dev, float pos[3]);
   /* TODO */
 };
--- a/src/test.c	Mon Aug 19 21:13:32 2013 +0200
+++ b/src/test.c	Sun Aug 25 13:53:30 2013 +0200
@@ -40,7 +40,7 @@
 {
   unsigned int time = 0;
   unsigned int oldtime = 0;
-  quaternion quat;
+  float quat[4];
   int i;
   struct hmd *rift = NULL;
   struct display_info display_info;