diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-13 13:51:37 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-13 13:53:02 +0200 |
commit | 848daed37e7bab0eeec0eacc0333d7b7859cf3a6 (patch) | |
tree | b9e41a8c8bbde9d05962a63c7f7d84b44c70c282 /tracker-steamvr | |
parent | cd6f40bd56f81031bb73fae3ae9a501151a42743 (diff) |
tracker/steamvr: use doubles for intermediate computation
Diffstat (limited to 'tracker-steamvr')
-rw-r--r-- | tracker-steamvr/steamvr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp index d6691cfd..fac0346a 100644 --- a/tracker-steamvr/steamvr.cpp +++ b/tracker-steamvr/steamvr.cpp @@ -263,8 +263,9 @@ bool steamvr::center() void steamvr::matrix_to_euler(double& yaw, double& pitch, double& roll, const vr::HmdMatrix34_t& result) { using std::atan2; + using std::sqrt; - yaw = atan2((double)-result.m[2][0], sqrt((double)result.m[2][1] * result.m[2][1] + result.m[2][2] * result.m[2][2])); + yaw = atan2((double)-result.m[2][0], sqrt(double(result.m[2][1]) * result.m[2][1] + result.m[2][2] * result.m[2][2])); pitch = atan2((double)result.m[2][1], (double)result.m[2][2]); roll = atan2((double)result.m[1][0], (double)result.m[0][0]); |