Issues with Input on desktop

So I'm primarily developing for Google Cardboard, but I'm also making it cross compatible with Steam VR.  I've written some umbrella code that uses both APIs, but on Android it defaults to Nolo CV1 VR.

Anyway, when I'm testing on desktop (with Android set to the build target), it works for the most part except for two things:
GetAxis() seems to return the trackpad on y, and the rotation of the controller on x.  (And it only uses y in the editor as the editor isn't VR)
The left controller doesn't register the grip button


Code to get the joystick:
Vector2 j = NoloVR_Controller.devices[i].GetAxis();
j.x = Mathf.Round(j.x * 2f) / 2f;
j.y = Mathf.Round(j.y * 2f) / 2f;
hands[i].joystick = j;

And code using the joystick:

Vector2 axis = CrossVR.hands[CrossVR.Right].joystick;
Debug.Log("Axis: " + axis);
if(axis != Vector2.zero)
{
Vector3 rotVec = transform.eulerAngles;
rotVec.y = rotVec.y + (ROTATE_SPEED * axis.x * Time.deltaTime);
if(axis.y < 0f)
rotVec.x = Mathf.MoveTowardsAngle(rotVec.x, 80f, ROTATE_SPEED * Time.deltaTime);
if(axis.y > 0f)
rotVec.x = Mathf.MoveTowardsAngle(rotVec.x, -80f, ROTATE_SPEED * Time.deltaTime);
transform.eulerAngles = rotVec;
}



Comments

  • Update:
    Looking in the source code, I fixed the umbrella code with this:
    NoloVR_Controller.NoloDevice info = NoloVR_Controller.GetDevice(NoloDeviceType.LeftController);
                if(i == Right)
                    info = NoloVR_Controller.GetDevice(NoloDeviceType.RightController);

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!