summaryrefslogtreecommitdiffhomepage
path: root/logic/tracker.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-18 18:29:02 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-18 18:48:42 +0200
commita6bea3e625aaccc7326d7b2d8c35d3e527b4bedf (patch)
tree0dcb1639ca8eb9ec19163e420516f40f4ce893dd /logic/tracker.cpp
parent04c196eb21879f4db0e55a12ecdf529f9a7e823d (diff)
logic/tracker: wraparound degrees over 360
Diffstat (limited to 'logic/tracker.cpp')
-rw-r--r--logic/tracker.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/logic/tracker.cpp b/logic/tracker.cpp
index 533a6f54..57995d37 100644
--- a/logic/tracker.cpp
+++ b/logic/tracker.cpp
@@ -147,6 +147,8 @@ void Tracker::logic()
using std::copysign;
using std::fabs;
+ value(i) = std::fmod(value(i), 360);
+
const double x = value(i);
if (fabs(x) - 1e-2 > 180)
value(i) = fmod(x + copysign(180, x), 360) - copysign(180, x);