From c8548534c6d4dc3049128c87c6f2332d94c66e43 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 31 Mar 2017 09:54:38 +0200 Subject: tracker/steamvr: use atan2 rather than asin Compute roll without a period of 90 deg. Submitted-by: @subnet- --- tracker-steamvr/steamvr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp index 303efd06..e40d51a1 100644 --- a/tracker-steamvr/steamvr.cpp +++ b/tracker-steamvr/steamvr.cpp @@ -133,7 +133,7 @@ void steamvr::data(double* data) { data[Yaw] = -atan2(-result.m[2][0], result.m[0][0]); data[Pitch] = atan2(-result.m[1][2], result.m[1][1]); - data[Roll] = asin(result.m[1][0]); + data[Roll] = atan2(result.m[1][1], result.m[0][1]); } static constexpr double r2d = 180 / M_PI; -- cgit v1.2.3