summaryrefslogtreecommitdiffhomepage
path: root/proto-ft/ftnoir_protocol_ft.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-18 10:29:34 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-18 10:29:34 +0200
commit9fc8ebfd8ab54b9fe1caaf60147dd43a573d67ef (patch)
tree16ce8640a875e9381e11f6a8587cb060685084e2 /proto-ft/ftnoir_protocol_ft.cpp
parent181770b1e169b9c7c75eacdc969102cce18a8be7 (diff)
proto/ft: cleanup deg->rad conversionopentrack-2.3-rc49p9
Diffstat (limited to 'proto-ft/ftnoir_protocol_ft.cpp')
-rw-r--r--proto-ft/ftnoir_protocol_ft.cpp18
1 files changed, 13 insertions, 5 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);