diff options
-rw-r--r-- | proto-ft/ftnoir_protocol_ft.cpp | 18 | ||||
-rw-r--r-- | proto-ft/ftnoir_protocol_ft.h | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/proto-ft/ftnoir_protocol_ft.cpp b/proto-ft/ftnoir_protocol_ft.cpp index 111af156..d0e89753 100644 --- a/proto-ft/ftnoir_protocol_ft.cpp +++ b/proto-ft/ftnoir_protocol_ft.cpp @@ -37,10 +37,11 @@ FTNoIR_Protocol::~FTNoIR_Protocol() dummyTrackIR.waitForFinished(50); } -void FTNoIR_Protocol::pose(const double* headpose) { - const float yaw = -rads_to_degrees(headpose[Yaw]); - const float pitch = -rads_to_degrees(headpose[Pitch]); - const float roll = rads_to_degrees(headpose[Roll]); +void FTNoIR_Protocol::pose(const double* headpose) +{ + const float yaw = -degrees_to_rads(headpose[Yaw]); + const float pitch = -degrees_to_rads(headpose[Pitch]); + const float roll = degrees_to_rads(headpose[Roll]); const float tx = float(headpose[TX] * 10); const float ty = float(headpose[TY] * 10); const float tz = float(headpose[TZ] * 10); @@ -93,7 +94,14 @@ void FTNoIR_Protocol::pose(const double* headpose) { data->DataID += 1; } -void FTNoIR_Protocol::start_tirviews() { +float FTNoIR_Protocol::degrees_to_rads(double degrees) +{ + static constexpr double pi = 3.14159265358979323846; + return float(degrees*pi/180); +} + +void FTNoIR_Protocol::start_tirviews() +{ QString aFileName = OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH "TIRViews.dll"; if ( QFile::exists( aFileName )) { FTIRViewsLib.setFileName(aFileName); diff --git a/proto-ft/ftnoir_protocol_ft.h b/proto-ft/ftnoir_protocol_ft.h index d2d40449..d90d916e 100644 --- a/proto-ft/ftnoir_protocol_ft.h +++ b/proto-ft/ftnoir_protocol_ft.h @@ -66,9 +66,9 @@ private: QMutex game_name_mutex; static check_for_first_run runonce_check; - static inline float rads_to_degrees(double degrees) { return float(degrees * 0.017453); } void start_tirviews(); void start_dummy(); + static float degrees_to_rads(double degrees); public: static void set_protocols(bool ft, bool npclient); |