I’m building a GearVR app in which I use VRDevice.DisableAutoVRCameraTracking(camera, disabled) to disable the ‘automatic’ built-in unity VR tracking of the camera, and instead set the position and rotation myself using values from InputTracking.GetNodeStates().
When I do this, however, I see a noticeable stutter when turning my head from side-to-side when deployed to GearVR (doesn’t seem to occur on Rift). I’m not sure of the cause.
I’ve tested this in a practically empty scene (so framerate is not an issue) where a button press toggles the camera view between a camera with my tracking and a camera with the ‘builtin’ unity tracking. The ‘builtin’ tracking is noticeably smoother.
I have also tried updating the transform values of my camera in just Update(), just FixedUpdate() and both Update() and FixedUpdate() with no noticeable effect.
I believe this to be a problem with the values reported by InputTracking.GetNodeStates() or the way in which I am using it. Can anyone comment, or tell me what I’m doing wrong?
The code snipped below shows my setup for ‘manually’ setting the camera transform;
private void Awake()
{
VRDevice.DisableAutoVRCameraTracking(centerEyeCam, true);
}
void UpdateNode()
{
InputTracking.GetNodeStates(nodeStates);
for (int i = 0; i < nodeStates.Count; ++i)
{
if (nodeStates[i].nodeType == VRNode.CenterEye)
{
Vector3 position;
if (nodeStates[i].TryGetPosition(out position))
centerEyeCam.transform.localPosition = position;
Quaternion rotation;
if (nodeStates[i].TryGetRotation(out rotation))
centerEyeCam.transform.localRotation = rotation;
}
}
}