summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-17 04:23:54 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-17 04:23:54 +0200
commitb81d4ac044e2e61a69f02ddecd8aedeb780c1a7b (patch)
treef610d3f544518457b798f5db4b53285ac87f5444
parent59d6976ebef702627b2676eecd3ad5c397072074 (diff)
simplify alt axis logic
-rw-r--r--facetracknoir/tracker.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/facetracknoir/tracker.cpp b/facetracknoir/tracker.cpp
index 01fd0b4c..ca505315 100644
--- a/facetracknoir/tracker.cpp
+++ b/facetracknoir/tracker.cpp
@@ -39,16 +39,11 @@ Tracker::~Tracker()
static void get_curve(double pos, double& out, THeadPoseDOF& axis) {
bool altp = (pos < 0) && axis.opts.altp;
- if (altp) {
- out = (axis.opts.invert ? -1 : 1) * axis.curveAlt.getValue(pos);
- axis.curve.setTrackingActive( false );
- axis.curveAlt.setTrackingActive( true );
- }
- else {
- out = (axis.opts.invert ? -1 : 1) * axis.curve.getValue(pos);
- axis.curve.setTrackingActive( true );
- axis.curveAlt.setTrackingActive( false );
- }
+ axis.curve.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;
}