示例#1
0
        private void OnApplicationQuit()
        {
            ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
            ViveSR_DualCameraImageRenderer.UpdateDepthMaterial = false;

            DepthControlScript.LoadDefaultValue();
        }
示例#2
0
        private IEnumerator _ExportSemanticMesh(System.Action <int> UpdatePercentage = null, System.Action done = null)
        {
            int percentage     = 0;
            int lastPercentage = 0;

            while (percentage < 100)
            {
                percentage = ViveSR_SceneUnderstanding.GetSceneUnderstandingProgress();

                // wait until saving is really processing then we disable depth
                if (lastPercentage == 0 && percentage > 0)
                {
                    ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
                }
                if (UpdatePercentage != null)
                {
                    UpdatePercentage(percentage);
                }
                yield return(new WaitForEndOfFrame());
            }

            _semanticMeshIsExporting = false;
            ViveSR_RigidReconstruction.StopScanning();
            if (done != null)
            {
                done();
            }
        }
    public void SetScanning(bool isOn)
    {
        if (isOn)
        {
            if (!ViveSR_RigidReconstruction.IsScanning && !viveSR_Experience_StaticMesh.ModelIsLoading)
            {
                ViveSR_RigidReconstructionRenderer.LiveMeshDisplayMode = ReconstructionDisplayMode.ADAPTIVE_MESH;
                ViveSR_DualCameraImageCapture.EnableDepthProcess(true);
                ViveSR_RigidReconstruction.StartScanning();

                if (viveSR_Experience_StaticMesh.CheckModelLoaded())
                {
                    viveSR_Experience_StaticMesh.LoadMesh(false);
                }
            }
        }
        else
        {
            if (ViveSR_RigidReconstruction.IsScanning)
            {
                ViveSR_RigidReconstruction.StopScanning();
                ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
            }
        }
    }
        public void SetDynamicMesh(bool isOn)
        {
            ViveSR_DualCameraImageCapture.EnableDepthProcess(isOn);
            ViveSR_DualCameraDepthCollider.UpdateDepthCollider = isOn;
            ViveSR_DualCameraDepthCollider.SetColliderEnable(isOn);

            ViveSR_DualCameraDepthCollider.ColliderMeshVisibility = isOn ? ShowDynamicCollision : false;
        }
 private void EnableDepthOcclusion(bool enable)
 {
     ViveSR_DualCameraImageCapture.ChangeDepthCase(enable ? DepthCase.CLOSE_RANGE : DepthCase.DEFAULT);
     ViveSR_DualCameraImageCapture.EnableDepthProcess(enable);
     ViveSR_DualCameraImageCapture.EnableDepthRefinement(enable);
     ViveSR_DualCameraImageRenderer.UpdateDepthMaterial   = enable;
     ViveSR_DualCameraImageRenderer.DepthImageOcclusion   = enable;
     ViveSR_DualCameraImageRenderer.OcclusionNearDistance = 0.05f;
     occlusionEnabled = enable;
 }
示例#6
0
        public void ExportModel(System.Action <int> UpdatePercentage = null, System.Action done = null)
        {
            ViveSR_RigidReconstruction.StopScanning();

            if (!ViveSR_DualCameraImageCapture.DepthProcessing)
            {
                ViveSR_DualCameraImageCapture.EnableDepthProcess(true); // in case depth has been turned off by other process
            }
            StartCoroutine(_ExportModel(UpdatePercentage, done));
        }
示例#7
0
        private void OnEnable()
        {
            MatchUIWithSRWorksSetting();

            Transform PlayerHeand = ViveSR_Experience.instance.PlayerHeadCollision.transform;

            transform.position = PlayerHeand.position + new Vector3(0, -0.25f, 0) + PlayerHeand.forward * 0.8f;
            transform.forward  = PlayerHeand.forward;
            ViveSR_DualCameraImageCapture.EnableDepthProcess(true);
            ViveSR_DualCameraImageRenderer.UpdateDepthMaterial = true;
        }
示例#8
0
        public void ExportSemanticMesh(System.Action <int> UpdatePercentage = null, System.Action done = null)
        {
            _semanticMeshIsExporting = true;

            if (!ViveSR_DualCameraImageCapture.DepthProcessing)
            {
                ViveSR_DualCameraImageCapture.EnableDepthProcess(true); // in case depth has been turned off by other process
            }
            ViveSR_SceneUnderstanding.ExportSceneUnderstandingInfo(ViveSR_SceneUnderstanding.SemanticObjDir);
            StartCoroutine(_ExportSemanticMesh(UpdatePercentage, done));
        }
示例#9
0
 public void SetScanning(bool On)
 {
     if (On)
     {
         ViveSR_DualCameraImageCapture.EnableDepthProcess(true);
         ViveSR_RigidReconstruction.StartScanning();
     }
     else
     {
         ViveSR_RigidReconstruction.StopScanning();
         ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
     }
 }
示例#10
0
 public static void CloseDynamicHandCollider()
 {
     if (!isEnableDepth)
     {
         return;
     }
     isEnableDepth = false;
     ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
     ViveSR_DualCameraDepthCollider.UpdateDepthCollider      = false;
     ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange = false;
     _dynamicHandMesh = null;
     SRWorksHand.GetDynamicHandMesh().Clear();
     Debug.LogWarning("CloseDynamicHandCollider");
 }
示例#11
0
    public static void CloseDynamicHandCollider()
    {
        if (!isEnableDepth)
        {
            return;
        }
        isEnableDepth = false;

        ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
        ViveSR_DualCameraDepthCollider.UpdateDepthCollider        = false;
        ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange   = false;
        ViveSR_DualCameraDepthCollider.UpdateColliderNearDistance = Near;
        ViveSR_DualCameraDepthCollider.UpdateColliderFarDistance  = Far;
        _dynamicScanMesh = null;
        _getDynamicScanMesh().Clear();
        Debug.Log("[SRWorkHand] CloseDynamicHandCollider");
    }
示例#12
0
 public static void OpenDynamicHandCollider()
 {
     if (isEnableDepth)
     {
         return;
     }
     isEnableDepth = true;
     ViveSR_DualCameraImageCapture.EnableDepthProcess(true);
     ViveSR_DualCameraDepthCollider.UpdateDepthCollider = true;
     //ViveSR_DualCameraDepthCollider.SetColliderEnable(isOn);
     ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange   = true;
     ViveSR_DualCameraDepthCollider.UpdateColliderNearDistance = Near;
     ViveSR_DualCameraDepthCollider.UpdateColliderFarDistance  = Far;
     _dynamicScanMesh = null;
     ViveSR_DualCameraDepthCollider.ColliderMeshVisibility = true;
     Debug.Log("[SRWorkHand] OpenDynamicHandCollider");
 }
示例#13
0
 // Update is called once per frame
 void Update()
 {
     if (DepthOcclusionEnabled)
     {
         ViveSR_DualCameraImageCapture.EnableDepthProcess(true);
         ViveSR_DualCameraRig.Instance.TrackedCameraLeft.DepthImageOccluder.gameObject.SetActive(true);
         ViveSR_DualCameraRig.Instance.TrackedCameraRight.DepthImageOccluder.gameObject.SetActive(true);
         ViveSR_DualCameraImageRenderer.UpdateDepthMaterial = true;
     }
     else
     {
         ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
         ViveSR_DualCameraRig.Instance.TrackedCameraLeft.DepthImageOccluder.gameObject.SetActive(false);
         ViveSR_DualCameraRig.Instance.TrackedCameraRight.DepthImageOccluder.gameObject.SetActive(false);
         ViveSR_DualCameraImageRenderer.UpdateDepthMaterial = false;
     }
 }
示例#14
0
    public static void OpenDynamicHandCollider()
    {
        Debug.LogWarning("OpenDynamicHandCollider");
        //     if (isEnableDepth)
        //         return;
        isEnableDepth = true;
        ViveSR_DualCameraImageCapture.EnableDepthProcess(true);
        ViveSR_DualCameraDepthCollider.UpdateDepthCollider = true;
        ViveSR_DualCameraImageCapture.ChangeDepthCase(DepthCase.CLOSE_RANGE);
        ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange   = true;
        ViveSR_DualCameraDepthCollider.UpdateColliderNearDistance = Near;
        ViveSR_DualCameraDepthCollider.UpdateColliderFarDistance  = Far;

        ViveSR_DualCameraImageCapture.DepthRefinement  = true;
        ViveSR_DualCameraImageCapture.DepthEdgeEnhance = true;

        _dynamicHandMesh = null;
        Debug.LogWarning("OpenDynamicHandCollider");
    }
示例#15
0
        private IEnumerator _ExportModel(System.Action <int> UpdatePercentage = null, System.Action done = null)
        {
            ViveSR_RigidReconstruction.ExportAdaptiveMesh = true;
            ViveSR_RigidReconstruction.ExportModel(MeshName);

            int percentage = 0;

            if (CheckModelLoaded())
            {
                Destroy(collisionMesh);
                Destroy(texturedMesh);
                collisionMesh = null;
                texturedMesh  = null;
            }
            ViveSR_RigidReconstruction.GetExportProgress(ref percentage);

            while (percentage < 100)
            {
                int error = ViveSR_RigidReconstruction.GetExportProgress(ref percentage);

                if (error != (int)Error.WORK)
                {
                    GPUMemoryFull();
                    break;
                }

                if (UpdatePercentage != null)
                {
                    UpdatePercentage(percentage);
                }

                yield return(new WaitForEndOfFrame());
            }

            ViveSR_DualCameraImageCapture.EnableDepthProcess(false);

            if (done != null)
            {
                done();
            }
        }
示例#16
0
        private IEnumerator _ExportModel(System.Action <int> UpdatePercentage = null, System.Action done = null)
        {
            ViveSR_RigidReconstruction.ExportAdaptiveMesh = true;
            ViveSR_RigidReconstruction.ExportModel(MeshName);

            int percentage     = 0;
            int lastPercentage = 0;

            if (CheckModelLoaded())
            {
                Destroy(collisionMesh);
                Destroy(texturedMesh);
                collisionMesh = null;
                texturedMesh  = null;
            }

            while (percentage < 100)
            {
                ViveSR_RigidReconstruction.GetExportProgress(ref percentage);

                if (UpdatePercentage != null)
                {
                    UpdatePercentage(percentage);
                }

                // wait until saving is really processing then we disable depth
                if (lastPercentage == 0 && percentage > 0)
                {
                    ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
                }
                lastPercentage = percentage;
                yield return(new WaitForEndOfFrame());
            }

            if (done != null)
            {
                done();
            }
        }
示例#17
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (!Application.isPlaying)
        {
            return;
        }

        GUIStyle style = new GUIStyle();

        style.fontStyle = FontStyle.Bold;

        GUILayout.BeginHorizontal();
        GUILayout.Label("Undistort Method:");
        int curMode = (int)ViveSR_DualCameraImageRenderer.UndistortMethod;

        curMode = EditorGUILayout.Popup(curMode, undistortMethod);
        GUILayout.EndHorizontal();
        if (curMode != (int)ViveSR_DualCameraImageRenderer.UndistortMethod)
        {
            ViveSR_DualCameraImageRenderer.UndistortMethod = (UndistortionMethod)curMode;
        }

        ViveSR_DualCameraImageRenderer.UpdateDistortedMaterial   = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.UpdateDistortedMaterial, "Update Camera Material");
        ViveSR_DualCameraImageRenderer.UpdateUndistortedMaterial = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.UpdateUndistortedMaterial, "Update Undistorted Material");
        ViveSR_DualCameraImageRenderer.UpdateDepthMaterial       = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.UpdateDepthMaterial, "Update Depth Material");
        ViveSR_DualCameraImageRenderer.CallbackMode = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.CallbackMode, "Callback Mode");

        GUILayout.Label(new GUIContent("[FPS Setting]"), style);
        SetSeethroughFPS = GUILayout.Toggle(SetSeethroughFPS, "Set seethrough FPS");
        if (SetSeethroughFPS)
        {
            GUILayout.Box("Value: " + (int)Mathf.Round(SeethroughFPS));
            float NewSeethroughFPS = GUILayout.HorizontalSlider(SeethroughFPS, 1.0f, 60.0f);
            if (NewSeethroughFPS != SeethroughFPS)
            {
                SRWorkModule_API.SetSeeThroughMaxFps((int)Mathf.Round(NewSeethroughFPS));
                SeethroughFPS = NewSeethroughFPS;
            }
        }

        GUILayout.Label(new GUIContent("[Depth Setting]"), style);
        string btnStrEnableDepthProcess = ViveSR_DualCameraImageCapture.DepthProcessing ? "Disable Depth Processing" : "Enable Depth Processing";

        if (GUILayout.Button(btnStrEnableDepthProcess))
        {
            ViveSR_DualCameraImageCapture.EnableDepthProcess(!ViveSR_DualCameraImageCapture.DepthProcessing);
        }

        if (ViveSR_DualCameraImageCapture.DepthProcessing)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Depth Case     :");
            int curDepthCase = (int)ViveSR_DualCameraImageCapture.DepthCase;
            curDepthCase = EditorGUILayout.Popup(curDepthCase, depthCauseMode);
            GUILayout.EndHorizontal();
            if (curDepthCase != (int)ViveSR_DualCameraImageCapture.DepthCase)
            {
                ViveSR_DualCameraImageCapture.ChangeDepthCase((DepthCase)curDepthCase);
            }
            EditorGUILayout.Separator();
            ViveSR_DualCameraImageCapture.DepthRefinement  = GUILayout.Toggle(ViveSR_DualCameraImageCapture.DepthRefinement, "Enable Depth Refinement");
            ViveSR_DualCameraImageCapture.DepthEdgeEnhance = GUILayout.Toggle(ViveSR_DualCameraImageCapture.DepthEdgeEnhance, "Enable Depth Edge Enhance");

            EditorGUILayout.Separator();
            ViveSR_DualCameraImageRenderer.DepthImageOcclusion     = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.DepthImageOcclusion, "Enable Depth Image Occlusion");
            ViveSR_DualCameraImageRenderer.VisualizeDepthOcclusion = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.VisualizeDepthOcclusion, "Visualize Depth Occlusion");
            {
                GUILayout.Label("Near Occlusion Distance:");
                GUILayout.BeginHorizontal();
                NearOcclusionDistThres = ViveSR_DualCameraImageRenderer.OcclusionNearDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraImageRenderer.OcclusionNearDistance, 0.05f, 10.0f);
                GUILayout.Label("" + NearOcclusionDistThres.ToString("0.00") + "m");
                GUILayout.EndHorizontal();

                GUILayout.Label("Far Occlusion Distance:");
                GUILayout.BeginHorizontal();
                FarOcclusionDistThres = ViveSR_DualCameraImageRenderer.OcclusionFarDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraImageRenderer.OcclusionFarDistance, 0.05f, 10.0f);
                GUILayout.Label("" + FarOcclusionDistThres.ToString("0.00") + "m");
                GUILayout.EndHorizontal();
            }

            EditorGUILayout.Separator();
            ViveSR_DualCameraDepthCollider.UpdateDepthCollider = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.UpdateDepthCollider, "Run Depth Mesh Collider");
            if (ViveSR_DualCameraDepthCollider.UpdateDepthCollider)
            {
                ViveSR_DualCameraDepthCollider.ColliderMeshVisibility = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.ColliderMeshVisibility, "Show Depth Mesh Collider");

                ViveSR_DualCameraDepthCollider.UpdateDepthColliderHoleFilling = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.UpdateDepthColliderHoleFilling, "Enable Depth Mesh Hole Filling");

                ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange, "Adjust Depth Distance");


                if (ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange)
                {
                    GUILayout.Label("Mesh Collider Distance - Near:");
                    GUILayout.BeginHorizontal();
                    NearColliderDistThres = ViveSR_DualCameraDepthCollider.UpdateColliderNearDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraDepthCollider.UpdateColliderNearDistance, 0.0f, 10.0f);
                    GUILayout.Label("" + NearColliderDistThres.ToString("0.00") + "m");
                    GUILayout.EndHorizontal();

                    GUILayout.Label("Mesh Collider Distance - Far:");
                    GUILayout.BeginHorizontal();
                    FarColliderDistThres = ViveSR_DualCameraDepthCollider.UpdateColliderFarDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraDepthCollider.UpdateColliderFarDistance, 0.0f, 10.0f);
                    GUILayout.Label("" + FarColliderDistThres.ToString("0.00") + "m");
                    GUILayout.EndHorizontal();
                }
            }
            GUILayout.Label(new GUIContent("[FPS Setting]"), style);
            SetDepthFPS = GUILayout.Toggle(SetDepthFPS, "Set depth FPS");
            if (SetDepthFPS)
            {
                GUILayout.Box("Value: " + (int)Mathf.Round(DepthFPS));
                float NewDepthFPS = GUILayout.HorizontalSlider(DepthFPS, 1.0f, 60.0f);
                if (NewDepthFPS != DepthFPS)
                {
                    SRWorkModule_API.SetDepthMaxFps((int)Mathf.Round(NewDepthFPS));
                    DepthFPS = NewDepthFPS;
                }
            }
        }
    }
示例#18
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (!Application.isPlaying)
        {
            return;
        }

        GUIStyle style = new GUIStyle();

        style.fontStyle = FontStyle.Bold;

        GUILayout.BeginHorizontal();
        GUILayout.Label("Undistort Method:");
        int cur_mode = (int)ViveSR_DualCameraImageRenderer.UndistortMethod;

        cur_mode = EditorGUILayout.Popup(cur_mode, undistort_method);
        GUILayout.EndHorizontal();
        if (cur_mode != (int)ViveSR_DualCameraImageRenderer.UndistortMethod)
        {
            ViveSR_DualCameraImageRenderer.UndistortMethod = (UndistortionMethod)cur_mode;
        }

        ViveSR_DualCameraImageRenderer.UpdateDistortedMaterial   = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.UpdateDistortedMaterial, "Update Camera Material");
        ViveSR_DualCameraImageRenderer.UpdateUndistortedMaterial = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.UpdateUndistortedMaterial, "Update Undistorted Material");
        ViveSR_DualCameraImageRenderer.UpdateDepthMaterial       = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.UpdateDepthMaterial, "Update Depth Material");

        GUILayout.Label(new GUIContent("[FPS Setting]"), style);
        set_seethrough_fps = GUILayout.Toggle(set_seethrough_fps, "Set See-through FPS");
        if (set_seethrough_fps)
        {
            GUILayout.Box("Value: " + (int)Mathf.Round(seethrough_fps));
            float NewSeethroughFPS = GUILayout.HorizontalSlider(seethrough_fps, 1.0f, 60.0f);
            if (NewSeethroughFPS != seethrough_fps)
            {
                SRWorkModule_API.SetPassThroughMaxFps((int)Mathf.Round(NewSeethroughFPS));
                seethrough_fps = NewSeethroughFPS;
            }
        }

        GUILayout.Label(new GUIContent("[Depth Setting]"), style);
        string btn_str_enable_depth_process = ViveSR_DualCameraImageCapture.IsDepthProcessing ? "Disable Depth Processing" : "Enable Depth Processing";

        if (GUILayout.Button(btn_str_enable_depth_process))
        {
            ViveSR_DualCameraImageCapture.SetDepthCase(DepthCase.CLOSE_RANGE);
            ViveSR_DualCameraImageCapture.EnableDepthProcess(!ViveSR_DualCameraImageCapture.IsDepthProcessing);
        }

        if (ViveSR_DualCameraImageCapture.IsDepthProcessing)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label("Depth Case     :");
            int curDepthCase = (int)ViveSR_DualCameraImageCapture.DepthCase;
            curDepthCase = EditorGUILayout.Popup(curDepthCase, depth_cause_mode);
            GUILayout.EndHorizontal();
            if (curDepthCase != (int)ViveSR_DualCameraImageCapture.DepthCase)
            {
                ViveSR_DualCameraImageCapture.SetDepthCase((DepthCase)curDepthCase);
            }
            EditorGUILayout.Separator();
            ViveSR_DualCameraImageCapture.IsDepthRefinementEnabled  = GUILayout.Toggle(ViveSR_DualCameraImageCapture.IsDepthRefinementEnabled, "Enable Depth Refinement");
            ViveSR_DualCameraImageCapture.IsDepthEdgeEnhanceEnabled = GUILayout.Toggle(ViveSR_DualCameraImageCapture.IsDepthEdgeEnhanceEnabled, "Enable Depth Edge Enhance");

            EditorGUILayout.Separator();
            ViveSR_DualCameraImageRenderer.DepthImageOcclusion     = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.DepthImageOcclusion, "Enable Depth Occlusion");
            ViveSR_DualCameraImageRenderer.VisualizeDepthOcclusion = GUILayout.Toggle(ViveSR_DualCameraImageRenderer.VisualizeDepthOcclusion, "Visualize Depth Occlusion");
            {
                GUILayout.Label("Near Occlusion Distance:");
                GUILayout.BeginHorizontal();
                near_occlusion_distThres = ViveSR_DualCameraImageRenderer.OcclusionNearDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraImageRenderer.OcclusionNearDistance, 0.05f, 10.0f);
                GUILayout.Label("" + near_occlusion_distThres.ToString("0.00") + "m");
                GUILayout.EndHorizontal();

                GUILayout.Label("Far Occlusion Distance:");
                GUILayout.BeginHorizontal();
                far_occlusion_dist_thres = ViveSR_DualCameraImageRenderer.OcclusionFarDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraImageRenderer.OcclusionFarDistance, 0.05f, 10.0f);
                GUILayout.Label("" + far_occlusion_dist_thres.ToString("0.00") + "m");
                GUILayout.EndHorizontal();
            }

            EditorGUILayout.Separator();
            ViveSR_DualCameraDepthCollider.UpdateDepthCollider = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.UpdateDepthCollider, "Update Depth Collider");
            if (ViveSR_DualCameraDepthCollider.UpdateDepthCollider)
            {
                ViveSR_DualCameraDepthCollider.DepthColliderVisibility = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.DepthColliderVisibility, "Show Depth Collider");

                ViveSR_DualCameraDepthCollider.UpdateDepthColliderHoleFilling = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.UpdateDepthColliderHoleFilling, "Enable Depth Hole Filling");

                ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange = GUILayout.Toggle(ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange, "Adjust Depth Collider Clip Distance");


                if (ViveSR_DualCameraDepthCollider.UpdateDepthColliderRange)
                {
                    GUILayout.Label("Depth Collider Clip Distance - Near:");
                    GUILayout.BeginHorizontal();
                    near_collider_dist_thres = ViveSR_DualCameraDepthCollider.UpdateColliderNearDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraDepthCollider.UpdateColliderNearDistance, 0.0f, 10.0f);
                    GUILayout.Label("" + near_collider_dist_thres.ToString("0.00") + "m");
                    GUILayout.EndHorizontal();

                    GUILayout.Label("Depth Collider Clip Distance - Far:");
                    GUILayout.BeginHorizontal();
                    far_collider_dist_thres = ViveSR_DualCameraDepthCollider.UpdateColliderFarDistance = GUILayout.HorizontalSlider(ViveSR_DualCameraDepthCollider.UpdateColliderFarDistance, 0.0f, 10.0f);
                    GUILayout.Label("" + far_collider_dist_thres.ToString("0.00") + "m");
                    GUILayout.EndHorizontal();
                }
            }
            GUILayout.Label(new GUIContent("[FPS Setting]"), style);
            set_depth_fps = GUILayout.Toggle(set_depth_fps, "Set Depth FPS");
            if (set_depth_fps)
            {
                GUILayout.Box("Value: " + (int)Mathf.Round(depth_fps));
                float NewDepthFPS = GUILayout.HorizontalSlider(depth_fps, 1.0f, 60.0f);
                if (NewDepthFPS != depth_fps)
                {
                    SRWorkModule_API.SetDepthMaxFps((int)Mathf.Round(NewDepthFPS));
                    depth_fps = NewDepthFPS;
                }
            }
            EditorGUILayout.Separator();
            ViveSR_DualCameraImageCapture.IsRecordingDatasetEnabled = GUILayout.Toggle(ViveSR_DualCameraImageCapture.IsRecordingDatasetEnabled, "Start Recording Dataset");
            if (ViveSR_DualCameraImageCapture.IsRecordingDatasetEnabled)
            {
                GUILayout.Label(new GUIContent("Recording Dataset..."), style);
            }
        }
    }
示例#19
0
 private void OnDisable()
 {
     ViveSR_DualCameraImageRenderer.UpdateDepthMaterial = false;
     ViveSR_DualCameraImageCapture.EnableDepthProcess(false);
 }