cancel
Showing results for 
Search instead for 
Did you mean: 

Help understanding how the SDK gets the headset position

Anonymous
Not applicable
Hi all,

I'm trying to understand how OVRCameraRig gets the headset position. I'm doing this out of curiosity, I don't have a particular objective in mind outside of getting a firm understanding of the SDK. It seems the OVRCameraRig scripts gets the position values by calling OVRNodeStateProperties.GetNodeStatePropertyVector3(). The OVRNodeStateProperties class is defined in OVRCommon.cs, and contains the following code to fetch the headset position:
case NodeStatePropertyType.Position:
if (OVRManager.loadedXRDevice == OVRManager.XRDevice.Oculus)
{
retVec = OVRPlugin.GetNodePose(ovrpNodeType, stepType).ToOVRPose().position;
return true;
}
#if UNITY_2017_1_OR_NEWER
if (GetUnityXRNodeStateVector3(nodeType, NodeStatePropertyType.Position, out retVec))
return true;
#endif
break;

My understanding is that depending on the version of unity, the position is either provided by Unity's XR Api, or by Oculus' OVRplugin class. Am I understanding correctly? If yes, can someone explain why this is the case? Is OVRplugin only used for legacy versions of Unity?

Would love if anyone could help me shed light on this. Thank you!




0 REPLIES 0