1099 Posted March 1, 2023 Posted March 1, 2023 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!
1099 Posted March 2, 2023 Author Posted March 2, 2023 (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. Edited March 2, 2023 by 1099
VIVE_chengnay Posted March 2, 2023 Posted March 2, 2023 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?
1099 Posted March 2, 2023 Author Posted March 2, 2023 (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 March 2, 2023 by 1099
VIVE_chengnay Posted March 2, 2023 Posted March 2, 2023 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.
1099 Posted March 2, 2023 Author Posted March 2, 2023 Great! It works now!! Thank you so much @chengnay ☺️ 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now