summaryrefslogtreecommitdiffhomepage
path: root/tracker-hydra/ftnoir_tracker_hydra.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-18 12:14:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-19 07:17:22 +0200
commita9b804e18c811c781a099a70b960f5bbde61257d (patch)
tree069a7de35557f4d9ff141d795d287e4ac128f625 /tracker-hydra/ftnoir_tracker_hydra.cpp
parent9fc8ebfd8ab54b9fe1caaf60147dd43a573d67ef (diff)
some: replace hardcoded pi values with the same pi constant
We can't depend on M_PI existing after including cmath.
Diffstat (limited to 'tracker-hydra/ftnoir_tracker_hydra.cpp')
-rw-r--r--tracker-hydra/ftnoir_tracker_hydra.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/tracker-hydra/ftnoir_tracker_hydra.cpp b/tracker-hydra/ftnoir_tracker_hydra.cpp
index 1e3c1189..33156f85 100644
--- a/tracker-hydra/ftnoir_tracker_hydra.cpp
+++ b/tracker-hydra/ftnoir_tracker_hydra.cpp
@@ -1,6 +1,7 @@
/* Copyright: "i couldn't care less what anyone does with the 5 lines of code i wrote" - mm0zct */
#include "ftnoir_tracker_hydra.h"
#include "opentrack/plugin-api.hpp"
+#include "opentrack-compat/pi-constant.hpp"
#include <cstdio>
#include <cmath>
#ifdef _WIN32
@@ -9,10 +10,6 @@
#endif
#include <sixense.h>
-#ifndef M_PI
-# define M_PI 3.14159265358979323846
-#endif
-
Hydra_Tracker::Hydra_Tracker() : should_quit(false) {}
#include <sixense_math.hpp>
@@ -42,7 +39,7 @@ void Hydra_Tracker::data(double *data)
data[TX] = double(acd.controllers[0].pos[0])/50;
data[TY] = double(acd.controllers[0].pos[1])/50;
data[TZ] = double(acd.controllers[0].pos[2])/50;
- static constexpr double r2d = 180/M_PI;
+ static constexpr double r2d = 180/OPENTRACK_PI;
data[Yaw] = double(ypr[0]) * r2d;
data[Pitch] = double(ypr[1]) * r2d;
data[Roll] = double(ypr[2]) * r2d;