Skip to content

Commit

Permalink
Adjust Focus touchpad scroll range to be the same with Oculus VR.
Browse files Browse the repository at this point in the history
  • Loading branch information
daoshengmu authored and philip-lamb committed May 14, 2019
1 parent d6d0fac commit 7f38c54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/wavevr/cpp/DeviceDelegateWaveVR.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 7f38c54

Please sign in to comment.