diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-24 14:24:29 +0200 | 
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-24 14:24:29 +0200 | 
| commit | 15ca247adc52ba0d7fdb86482f2f541025800be0 (patch) | |
| tree | 251725fb00c62f1c8032956072ba4d04616dbea9 /logic | |
| parent | 398bb31956cee88cbbdc88a5040532309e4acc1d (diff) | |
logic/tracker: use a second enum to make errors stand out more
Diffstat (limited to 'logic')
| -rw-r--r-- | logic/tracker.cpp | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/logic/tracker.cpp b/logic/tracker.cpp index d7f75e38..f0826a5f 100644 --- a/logic/tracker.cpp +++ b/logic/tracker.cpp @@ -65,23 +65,26 @@ double Tracker::map(double pos, Map& axis)  void Tracker::t_compensate(const rmat& rmat, const euler_t& xyz, euler_t& output,                             bool disable_tx, bool disable_ty, bool disable_tz)  { +    enum { tb_Z, tb_X, tb_Y }; +      // TY is really yaw axis. need swapping accordingly. +    // sign changes are due to right-vs-left handedness of coordinate system used      const euler_t ret = rmat * euler_t(xyz(TZ), -xyz(TX), -xyz(TY));      if (disable_tz)          output(TZ) = xyz(TZ);      else -        output(TZ) = ret(0); +        output(TZ) = ret(tb_Z);      if (disable_ty)          output(TY) = xyz(TY);      else -        output(TY) = -ret(2); +        output(TY) = -ret(tb_Y);      if (disable_tx)          output(TX) = xyz(TX);      else -        output(TX) = -ret(1); +        output(TX) = -ret(tb_X);  }  #include "compat/nan.hpp" | 
