From f13152b2b4d5142fc2572d7de0cb298dc83bbe6c Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Sat, 18 Jul 2015 23:04:16 -0700 Subject: [PATCH] Fixing reference to PI/2 --- interface/src/devices/SixenseManager.cpp | 5 +++-- interface/src/ui/ApplicationCompositor.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index c82027cb38..19763ee3bf 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "Application.h" #include "SixenseManager.h" @@ -527,8 +528,8 @@ void SixenseManager::emulateMouse(PalmData* palm, int index) { glm::vec3 direction = glm::inverse(avatar->getOrientation()) * palm->getFingerDirection(); // Get the angles, scaled between (-0.5,0.5) - float xAngle = (atan2(direction.z, direction.x) + M_PI_2); - float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)M_PI_2)); + float xAngle = (atan2(direction.z, direction.x) + PI_OVER_TWO); + float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO)); auto canvasSize = qApp->getCanvasSize(); // Get the pixel range over which the xAngle and yAngle are scaled float cursorRange = canvasSize.x * getCursorPixelRangeMult(); diff --git a/interface/src/ui/ApplicationCompositor.cpp b/interface/src/ui/ApplicationCompositor.cpp index dad626ae44..c7308674fe 100644 --- a/interface/src/ui/ApplicationCompositor.cpp +++ b/interface/src/ui/ApplicationCompositor.cpp @@ -15,6 +15,7 @@ #include #include +#include #include "CursorManager.h" #include "Tooltip.h" @@ -499,8 +500,8 @@ void ApplicationCompositor::renderControllerPointers(gpu::Batch& batch) { glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * palmData->getFingerDirection(); // Get the angles, scaled between (-0.5,0.5) - float xAngle = (atan2(direction.z, direction.x) + M_PI_2); - float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)M_PI_2)); + float xAngle = (atan2(direction.z, direction.x) + PI_OVER_TWO); + float yAngle = 0.5f - ((atan2f(direction.z, direction.y) + (float)PI_OVER_TWO)); // Get the pixel range over which the xAngle and yAngle are scaled float cursorRange = canvasSize.x * SixenseManager::getInstance().getCursorPixelRangeMult();