Forum Discussion

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

How to get angular velocity and acceleration of headset

Is there a way to get the angular velocity and acceleration of the VR user (the headset itself) in unity? I am only looking for angular velocity and acceleration because the user will be stationary while only moving around their head.
In the oculus developers documentation there is page titled 'get raw sensor data' but doesn't actually show how. 

Thanks!

1 Reply

  • I haven't tried myself, but this might work:
    OVRPlugin.Vector3f angularVel = OVRPlugin.GetNodeAngularVelocity(OVRPlugin.Node.Head, OVRPlugin.Step.Physics); OVRPlugin.Vector3f angularAcc = OVRPlugin.GetNodeAngularAcceleration(OVRPlugin.Node.Head, OVRPlugin.Step.Physics);
    I'm not sure if the last parameter should be Physics or Render. I've seen Render used by someone on here in another thread.

    Edit: I don't like posting things I haven't tried myself... so I just tested it.
    The angular velocity part looks like it works correctly. The numbers seem reasonable.
    The angular acceleration doesn't seem to work though, even with the headset sitting on a stable surface it has random values (positive and negative) on every axis.