Detect Right/left/Up/Down on GearVR/Oculus Go touchpad
Hi,
I'm trying to move an object up/down/left/right using the Gear VR/Oculus Go controller. To do that, I need to detect the orientation of the click of the user on the controller.
I'm using the following code :
if (OVRInput.Get(OVRInput.Button.PrimaryTouchpad))
{
Vector2 coord = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad, OVRInput.Controller.RTrackedRemote);
var absX = Math.Abs(coord.x);
var absY = Math.Abs(coord.y);
if (absX > absY)
{
if (coord.x > 0)
//Right
else
//Left
}
else
{
if (coord.y > 0)
//Up
else
//Down
}
}It's kind of working, but there's sometime a mismatch between the movement. I'm pretty sure that's a math problem here with the coordinates but I can't wrap my head around it.Thanks :)
