The idea is that CenterEyeAnchor has to be always in the exact world position as the OVRCameraRig. Since you cannot move CenterEyeAnchor gameObject because its position is overridden by the position tracking, we calculate the movement difference and move in the opposite direction the TrackingSpace object.
So I attached the following script to the "TrackingSpace" gameObject.
using UnityEngine;
using System.Collections;
public class CustomCameraPositionFix : MonoBehaviour {
public Transform centerEye;
private Transform parent;
private Transform thisTransform;
private Vector3 movement;
#if UNITY_STANDALONE && USING_OCULUS
void Start () {
parent = gameObject.transform.parent;
thisTransform = gameObject.transform;
}
void LateUpdate () {
if(centerEye.position != parent.position)
{
movement = centerEye.position - parent.position;
movement = -movement;
thisTransform.position = movement + thisTransform.position;
}
}
#endif
}
PROS:
-You can freely move the OVRCameraRig in your environment
-Position tracking is still there, but if the player movement in the real world wont be translated into movement int he virtual world (As GearVR does).
-It works fine with touch controllers, since the relative positions between hand anchors and head anchors are the same.
CONS:
- UGLY SOLUTION...
-With low frame rate your head can "jump" --> hello motion sickness!
I hope this is helpful!