Forum Discussion

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

how to track headset rotation/tilt?

i am trying to track the rotation/tilt of the vr headset, and preform an action depending on the distance of the tilt after pushing in a button on the controller.

lets say you press in a button on the controller and then tilt your head forward. i need to track the difference of the head tilt along the x axis from 0 to however far they tilt from the time they press in the button to when they release.

so i am thinking something like this:

get default/even/non-tilted rotation and set a value of 0
bool triggerPressed = OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger);

if (triggerPressed){
   then track the tilt/rotation difference on x axis and the same for y axis
   if (the x > 0){
       do something
   }
   if (the x < 0){
       do something else
   }
}

i probably messed up the syntax there but you get what i mean. anyone have any idea how to track that tilt? 

3 Replies

Replies have been turned off for this discussion
  • jolaya's avatar
    jolaya
    Honored Guest
    Hi @imperativity

    I am trying to track the rotation/orientation on the Oculus Go, is there any documentation on how to do this?
  • Anonymous's avatar
    Anonymous

    jolaya said:

    Hi @imperativity

    I am trying to track the rotation/orientation on the Oculus Go, is there any documentation on how to do this?


    i was overthinking it and now i feel dumb. you dont need to find the "headset" rotation. the main camera is the same rotation as the headset. and that transform accessible 
  • Walke1r's avatar
    Walke1r
    Honored Guest
    You can look up or down, to either side, or tilt your head.