diff --git a/Assets/ZED/SDK/Helpers/Scripts/ZEDManager.cs b/Assets/ZED/SDK/Helpers/Scripts/ZEDManager.cs index 816739c..05f60a3 100644 --- a/Assets/ZED/SDK/Helpers/Scripts/ZEDManager.cs +++ b/Assets/ZED/SDK/Helpers/Scripts/ZEDManager.cs @@ -225,9 +225,8 @@ public class ZEDManager : MonoBehaviour [HideInInspector] public bool estimateInitialPosition = true; - //public bool headfree = false; - public bool zLockZED = false; - public bool ZLockCam = true; + + @@ -1850,6 +1849,16 @@ public class ZEDManager : MonoBehaviour /// private void UpdateTracking() { + + bool enableFixed = false; //simple video goggle mode + bool zLockZED = true; // rotation of zed camera does not rotate image plane in hmd + bool ZLockCam = false; // do not rotate image plane if hmd rotates + if (enableFixed) + { + zLockZED = false; + ZLockCam = false; + } + if (!zedReady) return; @@ -1884,10 +1893,18 @@ public class ZEDManager : MonoBehaviour //Rotate Image plane with zed rotation r = zedOrientation; - zedRigDisplayer.transform.localRotation = r; //(Mod) zedRigDisplayer should move/rotate the image plane - //zedRigDisplayer.transform.localEulerAngles = new Vector3(r.x,r.y,0); - + if (enableFixed) + { + zedRigDisplayer.transform.localRotation = camLeft.transform.rotation; + } + else + { + zedRigDisplayer.transform.localRotation = r; //(Mod) zedRigDisplayer should move/rotate the image plane + //zedRigDisplayer.transform.localEulerAngles = new Vector3(r.x,r.y,0); + } + //Fixed + //camLeft.transform.SetParent(zedRigDisplayer.transform); //(Mod) @@ -1947,7 +1964,7 @@ public class ZEDManager : MonoBehaviour //rotationTransformhelper.transform.localEulerAngles = new Vector3(-zedRigDisplayer.transform.eulerAngles.x, -zedRigDisplayer.transform.eulerAngles.y, 0); - camRigDisplayer.transform.localRotation = Quaternion.identity; + //camRigDisplayer.transform.localRotation = Quaternion.identity; //asdf /*if (Input.GetKeyDown("space")) { //Restoring position does currently not work Debug.Log("fix"); @@ -1976,15 +1993,13 @@ public class ZEDManager : MonoBehaviour } - //if (zLockZED) - if (true) + if (zLockZED) { Vector3 zedDirection = new Vector3(0, 0, 1); //Create Vector towars Z+ zedDirection = zedRigDisplayer.transform.rotation * zedDirection; //rotate vector by zedRigRotation (vector should point towards +Z of zedRigDisplayer) camRigDisplayer.transform.localRotation = Quaternion.AngleAxis(zedRigDisplayer.transform.localEulerAngles.z, zedDirection); //rotate only around zedDirection.z with respect to original coordinate system } - //if (ZLockCam) - if (false) + if (ZLockCam) { //same for camera Z rotation compensation Vector3 hmdDirection = new Vector3(0, 0, 1); //Create Vector towars Z+