Jump to content

How can I add rotation to the Quest 2 and Focus 3 controllers?


Recommended Posts

Posted

I am developing Unity VR project using Oculus Quest 2 and Vive Focus 3.

I am not able to find the information for add rotation to the Quest 2 and Focus 3 controllers.

I am using VIU Oculus Android and WaveXR not SteamVR, and OpenXR.

Can anyone point out where I can find the information how to implement rotation? Is there any script I can attach to add rotation to the controller?

I have ViveCameraRig in the Player.

 

I checked these links below ...

VIU Settings · ViveSoftware/ViveInputUtility-Unity Wiki · GitHub

Vive Input Utility - Developer Resources

Community Form

Thank you!

Posted (edited)

Thank you for your quick reply @chengnay!

What I am looking for is to HMD Rotation.

I can rotate HMD with using keyboard IJKL.

I want to same HMD rotation when I put it on the Quest 2 and Focus 3 headsets with the controllers.

 

image.png.c744f2b7d18af79837496dfb3740ed3a.png

Edited by 1099
Posted

Hi @1099,

May I know what is your goal?

In Simulator, we added rotate feature due to user has no actual HMD.

But in Quest 2 or Focus 3, user can rotate HMD by turning the head.

Are you looking for something like snap turn?

Posted (edited)

Yes!! snap turn!!

I am trying to do in the controller like this in the video start at 5:37. snap turn using the controller Joystick.

 

Edited by 1099
Posted

Hi @1099,

Here is a sample code that you can do snap turn.

private float prePadXAxis = 0f;
void update()
{
    var padXAxis = ViveInput.GetAxisEx(ControllerRole.RightHand, ControllerAxis.PadX);
    if (prePadXAxis == 0f && padXAxis < 0f)
    {
        transform.Rotate(0f, -10f, 0f);
        prePadXAxis = padXAxis;
    }
    else if (prePadXAxis == 0f && padXAxis > 0f)
    {
        transform.Rotate(0f, 10f, 0f);
        prePadXAxis = padXAxis;
    }
    else
        prePadXAxis = padXAxis;
}

You need to attach this script to the root(VROrigin) of your ViveCameraRig.

All the children(like pointers) will take effect to the rotation.

image.png.51a14dd893f83e51b2fe43fb47726bcc.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...