Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Jerware's avatar
Jerware
Explorer
13 years ago

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?...

4 Replies

Replies have been turned off for this discussion
  • drash's avatar
    drash
    Heroic Explorer
    "Jerware" wrote:
    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?...


    That was going to be my suggestion too, but maybe reading camera roll would lag behind the headtracking a frame. Now I'm curious too!
  • 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.
  • Marbas's avatar
    Marbas
    Honored Guest
    If the camera's parent gameobject is centered between both camera's, it may make most sense reading roll values from that. But if the parent object is offset for simulating the head-neck model, you could add a new empty game object between both camera's and read roll values from that.
  • Hey guys,

    I haven't had the chance to add some of the features you have been asking for. Adding the ability to query the rotation from OVRCameraController is high on the list. From ChristopherRoe's message, it makes sense to add query functions to find the actual x,y, and z rotation values. Expect these in the next release of the integration (0.1.6), along with a few other fixes and optimizations.

    If you have any comments on what you would like to see and / or change in the integration, feel free to post it on the forum and I will be looking at these and getting them into the next versions of the integration as soon as I can.

    Thanks!
    Peter