From 7f38c541df7a816da58da4b37f8e36aad3af28e5 Mon Sep 17 00:00:00 2001 From: Daosheng Mu Date: Fri, 10 May 2019 13:16:52 -0700 Subject: [PATCH] Adjust Focus touchpad scroll range to be the same with Oculus VR. --- app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp b/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp index d4d8b5c6c..098d5fe53 100644 --- a/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp +++ b/app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp @@ -282,7 +282,8 @@ struct DeviceDelegateWaveVR::State { if (touchpadTouched) { WVR_Axis_t axis = WVR_GetInputAnalogAxis(controller.type, WVR_InputId_Alias1_Touchpad); - delegate->SetTouchPosition(controller.index, axis.x, -axis.y); + // We are matching touch pad range from {-1, 1} to the Oculus {0, 1}. + delegate->SetTouchPosition(controller.index, (axis.x + 1) * 0.5, (-axis.y + 1) * 0.5); immersiveAxes[0] = axis.x; immersiveAxes[1] = -axis.y; controller.touched = true;