Forum Discussion
yasdawasda
11 years agoExplorer
Getting head orientation
Feels like this should be a simple one, but I can't find it anywhere.
How do I get access to the rotation values for the head tracking? I want to use the head tracking values to control the pitch/yaw/roll on a simple airplane.
Thanks!
How do I get access to the rotation values for the head tracking? I want to use the head tracking values to control the pitch/yaw/roll on a simple airplane.
Thanks!
8 Replies
Replies have been turned off for this discussion
- yasdawasdaExplorerFinally got it...
Quaternion hmdOrientation = new Quaternion();
Vector3 hmdPos = new Vector3 ();
OVRDevice.GetCameraPositionOrientation (ref hmdPos, ref hmdOrientation, 0);
Is there an official reference or documentation to find this sort of stuff out quickly? - yasdawasdaExplorerOk... so I've just got 0.4.3 and OVRDevice doesn't exist any more....
There must be a reference manual for all this stuff?? - kerskMeta EmployeeHere you go -- this should work for you in the 0.4.3 SDK:
OVRPose hmdPose = OVRManager.display.GetHeadPose();
Quaternion hmdOrientation = hmdPose.orientation;
Vector3 hmdPos = hmdPose.position;
And you can find the full documentation here:
https://developer.oculusvr.com/doc/?package=unity
Hope this helps! - standtall007ProtegeHi kersk, does this also work if i want to get a character to turn in the direction the player is looking at?
- jkafkarisExplorerSorry to rehash an old post, but I'm trying to do the same now but I don't see GetHeadPose anymore. And the link to the docs does not work.
Thanks. - palii90ProtegeIn Unity you can get the head orientation from the camera transform.
https://docs.unity3d.com/Manual/VROverview.html#UnderstandingTheCamera - jkafkarisExplorerThanks palii90. Started using the transform of the CenterEyeAnchor in the OVRCameraRig.
- himmelmaxHonored Guest
// Doesn't look like this will work for Oculus Go ... :/
Vector3 PlayerHeadPos = Vector3.zero;
OVRNodeStateProperties.GetNodeStatePropertyVector3( UnityEngine.XR.XRNode.Head,
NodeStatePropertyType.Position,
OVRPlugin.Node.Head,
OVRPlugin.Step.Render,
out PlayerHeadPos );
// Edit: jkafkaris's suggestion worked for me
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
- 3 years ago
- 6 months ago