diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-03 20:53:30 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-10-03 20:53:30 +0200 |
commit | 3f18a2e9bf16ea1f9eb681d42aefe0d1270612a8 (patch) | |
tree | f6396530f382ae472277b90ab1da3bb3d485266f /facetracknoir | |
parent | feaa7dae8e55b0d5c18868fe298bc8ad2122860f (diff) |
prevent reset to origin on pause hotkey
Issue: #72
Reported-by: @Pretagonist
Diffstat (limited to 'facetracknoir')
-rw-r--r-- | facetracknoir/tracker.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp index 72ad22b4..003324a7 100644 --- a/facetracknoir/tracker.cpp +++ b/facetracknoir/tracker.cpp @@ -40,10 +40,10 @@ Tracker::~Tracker() static void get_curve(double pos, double& out, THeadPoseDOF& axis) { bool altp = (pos < 0) && axis.opts.altp; axis.curve.setTrackingActive( !altp ); - axis.curveAlt.setTrackingActive( altp ); + axis.curveAlt.setTrackingActive( altp ); auto& fc = altp ? axis.curveAlt : axis.curve; out = (axis.opts.invert ? -1 : 1) * fc.getValue(pos); - + out += axis.opts.zero; } @@ -114,13 +114,13 @@ void Tracker::run() { for (int i = 0; i < 6; i++) { raw_6dof.axes[i] = newpose[i]; - + auto& axis = mainApp->axis(i); - + int k = axis.opts.src; if (k < 0 || k >= 6) continue; - + axis.headPos = newpose[k]; } @@ -143,6 +143,8 @@ void Tracker::run() { target_camera2 = target_camera - offset_camera; } + else + target_camera2 = raw_6dof; if (Libraries->pFilter) { Libraries->pFilter->FilterHeadPoseData(target_camera2.axes, new_camera.axes); @@ -158,7 +160,7 @@ void Tracker::run() { t_compensate(output_camera.axes, output_camera.axes, mainApp->s.tcomp_tz); if (Libraries->pProtocol) { - Libraries->pProtocol->sendHeadposeToGame( output_camera.axes ); + Libraries->pProtocol->sendHeadposeToGame(output_camera.axes); } } |