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.cpp43
1 files changed, 10 insertions, 33 deletions
diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
index 6345ac57..5770f015 100644
--- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
+++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.cpp
@@ -8,13 +8,10 @@
# define SIXENSE_UTILS_STATIC_LIB
#endif
#include <sixense.h>
-#include <sixense_math.hpp>
+Hydra_Tracker::Hydra_Tracker() : should_quit(false) {}
-Hydra_Tracker::Hydra_Tracker() : should_quit(false)
-{
- for (int i = 0; i < 6; i++)
- newHeadPose[i] = 0;
-}
+#pragma GCC diagnostic ignored "-Wreorder"
+#include <sixense_math.hpp>
Hydra_Tracker::~Hydra_Tracker()
{
@@ -38,33 +35,13 @@ 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;
+ 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()