diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-18 18:29:02 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-06-18 18:48:42 +0200 |
commit | a6bea3e625aaccc7326d7b2d8c35d3e527b4bedf (patch) | |
tree | 0dcb1639ca8eb9ec19163e420516f40f4ce893dd /logic | |
parent | 04c196eb21879f4db0e55a12ecdf529f9a7e823d (diff) |
logic/tracker: wraparound degrees over 360
Diffstat (limited to 'logic')
-rw-r--r-- | logic/tracker.cpp | 2 |
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); |