void Awake() { //Position later gets updated every update tracking call positionInit = transform.localPosition; position = positionInit; isThreaded = multithreading; zedCamera = sl.ZEDCamera.GetInstance(); ZedSVOManager = GetComponent <SVOManager>(); if (ZedSVOManager != null) { //Create a camera if ((ZedSVOManager.read || ZedSVOManager.record) && ZedSVOManager.videoFile.Length == 0) { ZedSVOManager.record = false; ZedSVOManager.read = false; } if (ZedSVOManager.read) { ZedSVOManager.record = false; zedCamera.CreateCameraSVO(ZedSVOManager.videoFile); } else { zedCamera.CreateCameraLive(videoMode, FPS); } } else { zedCamera.CreateCameraLive(videoMode, FPS); } Debug.Log("ZED SDK Version " + sl.ZEDCamera.GetSDKVersion()); //Initialize the camera in performance mode, make minimum depth //be minDist meters to avoid inaccurate hand occlusions sl.ERROR_CODE e = zedCamera.Init(depthMode, minDist); if (e != sl.ERROR_CODE.SUCCESS) { throw new Exception("Initialization failed " + e.ToString()); } if (ZedSVOManager != null) { if (ZedSVOManager.record) { if (zedCamera.EnableRecording(ZedSVOManager.videoFile) != sl.ERROR_CODE.SUCCESS) { ZedSVOManager.record = false; } } } }
void Awake() { positionInit = transform.localPosition; rotationInit = transform.localRotation; position = positionInit; orientation = Quaternion.identity; isThreaded = multithreading; zedCamera = sl.ZEDCamera.GetInstance(); ZedSVOManager = GetComponent <SVOManager>(); if (ZedSVOManager != null) { //Create a camera if ((ZedSVOManager.read || ZedSVOManager.record) && ZedSVOManager.videoFile.Length == 0) { ZedSVOManager.record = false; ZedSVOManager.read = false; } if (ZedSVOManager.read) { ZedSVOManager.record = false; zedCamera.CreateCameraSVO(ZedSVOManager.videoFile); } else { zedCamera.CreateCameraLive(videoMode, FPS); } } else { zedCamera.CreateCameraLive(videoMode, FPS); } Debug.Log("ZED SDK Version " + sl.ZEDCamera.GetSDKVersion()); //Initialize the camera in performance mode. sl.ERROR_CODE e = zedCamera.Init(depthMode); if (e != sl.ERROR_CODE.SUCCESS) { throw new Exception("Initialization failed " + e.ToString()); } if (ZedSVOManager != null) { if (ZedSVOManager.record) { if (zedCamera.EnableRecording(ZedSVOManager.videoFile) != sl.ERROR_CODE.SUCCESS) { ZedSVOManager.record = false; } } } }
void Awake() { position = new Vector3(0, 0.0f, 0); orientation = Quaternion.identity; zedCamera = sl.ZEDCamera.GetInstance(); ZedSVOManager = GetComponent <SVOManager>(); if (ZedSVOManager != null) { //Create a camera if ((ZedSVOManager.read || ZedSVOManager.record) && ZedSVOManager.videoFile.Length == 0) { ZedSVOManager.record = false; ZedSVOManager.read = false; } if (ZedSVOManager.read) { ZedSVOManager.record = false; zedCamera.CreateCameraSVO(ZedSVOManager.videoFile); } else { zedCamera.CreateCameraLive(resolution, 0.0f); } } else { zedCamera.CreateCameraLive(resolution, 0.0f); } Debug.Log("ZED SDK Version " + sl.ZEDCamera.GetSDKVersion()); //Initialize the camera in performance mode. sl.ERROR_CODE e = zedCamera.Init(sl.DEPTH_MODE.PERFORMANCE); if (e != sl.ERROR_CODE.SUCCESS) { throw new Exception("Initialization failed " + e.ToString()); } if (ZedSVOManager != null) { if (ZedSVOManager.record) { if (zedCamera.EnableRecording(ZedSVOManager.videoFile) != sl.ERROR_CODE.SUCCESS) { ZedSVOManager.record = false; } } } if (UnityEngine.VR.VRSettings.enabled) { headset = true; UnityEngine.VR.InputTracking.Recenter(); } else { headset = false; cameraHeadOffset.y = 0; cameraHeadOffset.z = 0; Debug.LogWarning("This script needs the VR to work correctly"); } }
void Awake() { isMoving = tracking; positionInit = transform.localPosition; rotationInit = transform.localRotation; position = positionInit; orientation = Quaternion.identity; isThreaded = multithreading; zedCamera = sl.ZEDCamera.GetInstance(); zedSVOManager = GetComponent <SVOManager>(); if (zedSVOManager != null) { //Create a camera if ((zedSVOManager.read || zedSVOManager.record) && zedSVOManager.videoFile.Length == 0) { zedSVOManager.record = false; zedSVOManager.read = false; } if (zedSVOManager.read) { zedSVOManager.record = false; zedCamera.CreateCameraSVO(zedSVOManager.videoFile); } else { zedCamera.CreateCameraLive(resolution, FPS); } } else { zedCamera.CreateCameraLive(resolution, FPS); } Debug.Log("ZED SDK Version " + sl.ZEDCamera.GetSDKVersion()); //Initialize the camera in performance mode. sl.ERROR_CODE e = zedCamera.Init(depthMode); if (e != sl.ERROR_CODE.SUCCESS) { throw new Exception("Initialization failed " + e.ToString()); } if (zedSVOManager != null) { if (zedSVOManager.record) { if (zedCamera.EnableRecording(zedSVOManager.videoFile) != sl.ERROR_CODE.SUCCESS) { zedSVOManager.record = false; } } if (zedSVOManager.read) { zedSVOManager.NumberFrameMax = zedCamera.GetSVONumberOfFrames(); } } Component[] cams = gameObject.transform.GetComponentsInChildren(typeof(Camera)); foreach (Camera cam in cams) { if (cam.stereoTargetEye == StereoTargetEyeMask.None) { cameraLeft = cam.transform; // cam.cullingMask &= ~(1 << sl.ZEDCamera.TagOneObject); } } }