diff options
-rw-r--r-- | facetracknoir/tracker.cpp | 15 |
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;
}
|