Forum Discussion
Jerware
13 years agoExplorer
How best to acquire roll values?
I was just going to grab the Z rotation value of one of the cameras, unless there's a more efficient way to go about it?...
Porkhe_Pigatov
13 years agoHonored Guest
The way Oculus did the Unity integration is a bit contrary to what I was expecting--to me, a controller is something that needs to play nice with other controllers, not affect any transforms directly, and generally just sit down and shut up until I actually ask it for input using methods that approximate or match the ones Unity offers (GetAxis, GetButton, etc).
Anyway, I was briefly thrown for a loop at first when I couldn't find any GetAxis() style methods or any immediately apparent way to poll the HMD for values I could use to generate IK hints for the avatar's neck and head bones. I ended up adding those methods to our input manager in order to make the Rift play nice with everything else in our logic scripts.
For the HMD's getAxis() method in our input manager, I currently just grab the rotation of one of the stereo cameras and use that to return the rotational values. The IK hint only really has to ensure that the avatar's head physically turns to look in the same direction as the player's head after the OVRCameras have set their own orientation, so being only one or two frames behind doesn't really throw anything off for us in a noticeable way.
Anyway, I was briefly thrown for a loop at first when I couldn't find any GetAxis() style methods or any immediately apparent way to poll the HMD for values I could use to generate IK hints for the avatar's neck and head bones. I ended up adding those methods to our input manager in order to make the Rift play nice with everything else in our logic scripts.
For the HMD's getAxis() method in our input manager, I currently just grab the rotation of one of the stereo cameras and use that to return the rotational values. The IK hint only really has to ensure that the avatar's head physically turns to look in the same direction as the player's head after the OVRCameras have set their own orientation, so being only one or two frames behind doesn't really throw anything off for us in a noticeable way.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 8 months ago