summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp')
-rw-r--r--ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp49
1 files changed, 13 insertions, 36 deletions
diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
index 70af2893..b7d078c2 100644
--- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
+++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
@@ -1,20 +1,17 @@
/* Copyright: "i couldn't care less what anyone does with the 5 lines of code i wrote" - mm0zct */
#include "ftnoir_tracker_hydra.h"
-#include "facetracknoir/global-settings.h"
-#include "facetracknoir/rotation.h"
+#include "facetracknoir/plugin-support.h"
#include <cstdio>
#ifdef _WIN32
# define SIXENSE_STATIC_LIB
# define SIXENSE_UTILS_STATIC_LIB
#endif
#include <sixense.h>
-#include <sixense_math.hpp>
-Hydra_Tracker::Hydra_Tracker() : should_quit(false)
-{
- for (int i = 0; i < 6; i++)
- newHeadPose[i] = 0;
-}
+Hydra_Tracker::Hydra_Tracker() : should_quit(false) {}
+
+#pragma GCC diagnostic ignored "-Wreorder"
+#include <sixense_math.hpp>
Hydra_Tracker::~Hydra_Tracker()
{
@@ -38,36 +35,16 @@ void Hydra_Tracker::GetHeadPoseData(double *data)
float ypr[3];
mat.getEulerAngles().fill(ypr);
- newHeadPose[Yaw] = ypr[0];
- newHeadPose[Pitch] = ypr[1];
- newHeadPose[Roll] = ypr[2];
-
-
- newHeadPose[TX] = acd.controllers[0].pos[0]/50.0f;
- newHeadPose[TY] = acd.controllers[0].pos[1]/50.0f;
- newHeadPose[TZ] = acd.controllers[0].pos[2]/50.0f;
-
- if (s.bEnableX) {
- data[TX] = newHeadPose[TX];
- }
- if (s.bEnableY) {
- data[TY] = newHeadPose[TY];
- }
- if (s.bEnableY) {
- data[TZ] = newHeadPose[TZ];
- }
- if (s.bEnableYaw) {
- data[Yaw] = newHeadPose[Yaw] * 57.295781f;
- }
- if (s.bEnablePitch) {
- data[Pitch] = newHeadPose[Pitch] * 57.295781f;
- }
- if (s.bEnableRoll) {
- data[Roll] = newHeadPose[Roll] * 57.295781f;
- }
+ data[TX] = acd.controllers[0].pos[0]/50.0;
+ data[TY] = acd.controllers[0].pos[1]/50.0;
+ data[TZ] = acd.controllers[0].pos[2]/50.0;
+ static constexpr double r2d = 57.295781;
+ data[Yaw] = ypr[0] * r2d;
+ data[Pitch] = ypr[1] * r2d;
+ data[Roll] = ypr[2] * r2d;
}
-extern "C" FTNOIR_TRACKER_BASE_EXPORT ITracker* CALLING_CONVENTION GetConstructor()
+extern "C" OPENTRACK_EXPORT ITracker* GetConstructor()
{
return new Hydra_Tracker;
}