diff options
Diffstat (limited to 'ftnoir_tracker_ht')
-rw-r--r-- | ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index 5785b21a..ffbf1be8 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -220,8 +220,12 @@ bool Tracker::GiveHeadPoseData(THeadPoseData* data) if (shm->result.filled) { if (enableRX) data->yaw = shm->result.rotx; - if (enableRY) + if (enableRY) { data->pitch = shm->result.roty; + double sign = data->pitch >= 0 ? 1 : -1; + if (fabs(fabs(data->pitch) - 180) < fabs(data->pitch)) + data->pitch = fabs(fabs(data->pitch) - 180) * sign; + } if (enableRZ) { data->roll = shm->result.rotz; double sign = data->roll >= 0 ? 1 : -1; |