diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-04-01 12:08:47 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-04-01 12:08:47 +0200 |
commit | b91e83401d2c27831ab7d93c05edec70d32b03a4 (patch) | |
tree | 0b2c2a2e5cb548668afaa2a148638767b6a89e64 | |
parent | 4d8291d9129c2f22e8ab62403b0ee803d4ac8cb2 (diff) |
hatire: convert angles degree to radian
-rw-r--r-- | ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp index 78535d01..6bacd5f9 100644 --- a/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp +++ b/ftnoir_tracker_hatire/ftnoir_tracker_hat.cpp @@ -402,19 +402,22 @@ bool FTNoIR_Tracker::GiveHeadPoseData(THeadPoseData *data) } if (new_frame) { #ifdef OPENTRACK_API + + static constexpr double pi = 3.14159265359; + static constexpr double d2r = pi / 180.; if (bEnableYaw) { - if (bInvertYaw ) data[Yaw] = HAT.Rot[iYawAxe] * -1.0f; + if (bInvertYaw ) data[Yaw] = HAT.Rot[iYawAxe] * -1.0f * d2r; else data[Yaw] = HAT.Rot[iYawAxe]; } else data[Yaw] =0; if (bEnablePitch) { - if (bInvertPitch) data[Pitch] = HAT.Rot[iPitchAxe] * -1.0f; + if (bInvertPitch) data[Pitch] = HAT.Rot[iPitchAxe] * -1.0f * d2r; else data[Pitch] = HAT.Rot[iPitchAxe]; } else data[Pitch] = 0; if (bEnableRoll) { - if (bInvertRoll) data[Roll] = HAT.Rot[iRollAxe] * -1.0f; + if (bInvertRoll) data[Roll] = HAT.Rot[iRollAxe] * -1.0f * d2r; else data[Roll] = HAT.Rot[iRollAxe]; } else data[Roll] =0; |