I'm looking for the functions to get the position and rotation data of the rift headset itself in Unity.
I have the Oculus integration SDK installed and want to avoid using any pre-fabs.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityI'm looking for the functions to get the position and rotation data of the rift headset itself in Unity.
I have the Oculus integration SDK installed and want to avoid using any pre-fabs.
you have an OVRCameraRig prefab in the scene then you can get the centerEyeAnchor transform as follows:
public OVRCameraRig cameraRig;
Vector3 headsetPosition = cameraRig.centerEyeAnchor.position;
Quaternion headsetRotation = cameraRig.centerEyeAnchor.rotation;
This holds the current position and rotation of the headset, and it always coincides with the average of the left and right eye poses.
If you don't want to use the default OVRCameraRig prefab you are gonna have to manually assign that property to the proper camera.
I hope this will help you!!