示例#1
0
        void Scan()
        {
            bool allowScan = !ViveSR_RigidReconstruction.IsScanning &&
                             !ViveSR_RigidReconstruction.IsExportingMesh &&
                             !StaticMeshScript.SemanticMeshIsExporting &&
                             !StaticMeshScript.ModelIsLoading &&
                             !StaticMeshScript.SemanticMeshIsLoading;

            if (!allowScan)
            {
                return;
            }

            HintText.text = "";

            // Clear
            StaticMeshScript.LoadMesh(false);
            StaticMeshScript.ActivateSemanticMesh(false);
            StaticMeshScript.ClearHintLocators();
            npcGenerator.ClearScene();
            NavFloor.SetActive(false);

            RigidReconstruction.SRWork_Rigid_Reconstruciton.RegisterDataErrorHandler((int)Error.GPU_MEMORY_FULL, GPUMemoryFull);
            StaticMeshScript.EnableDepthProcessingAndScanning(true);
            StaticMeshScript.SetSegmentation(true);

            ViveSR_SceneUnderstanding.SetCustomSceneUnderstandingConfig(SceneUnderstandingObjectType.CHAIR, 10, true);

            SetColor(Color_Dark, ScanText, StopText, PlayText);
            SetColor(Color_Bright, SaveText, StopText);
        }
        public override void ActionToDo()
        {
            ViveSR_Experience_Demo.instance.realWorldFloor.SetActive(isOn);
            if (isOn)
            {
                //wait for tutorial segmentation handler to reaction on UI before turning it off
                this.DelayOneFrame(() =>
                {
                    ViveSR_Experience_Demo.instance.Rotator.RenderButtons(false);
                    ViveSR_Experience_Demo.instance.Tutorial.ToggleTutorial(false);
                });

                ActionSequence = ViveSR_Experience_ActionSequence.CreateActionSequence(gameObject);

                ActionSequence.AddAction(() => StaticMeshScript.LoadMesh(true, false,
                                                                         () => ViveSR_Experience_HintMessage.instance.SetHintMessage(hintType.onHeadSet, "Loading Mesh...", false),
                                                                         () =>
                {
                    ViveSR_Experience_HintMessage.instance.SetHintMessage(hintType.onHeadSet, "Mesh Loaded!", true, 0.5f);
                    ActionSequence.ActionFinished();
                }
                                                                         ));

                ActionSequence.AddAction(() =>
                {
                    ViveSR_Experience_Demo.instance.Rotator.RenderButtons(true);
                    ViveSR_Experience_Demo.instance.Tutorial.ToggleTutorial(true);
                    SegResults = StaticMeshScript.GetSegmentationInfo(SceneUnderstandingObjectType.CHAIR);

                    StaticMeshScript.GenerateHintLocators(SegResults);
                    LoadChair();
                    ViveSR_Experience_ControllerDelegate.touchpadDelegate += handleTouchpad_Play;
                    ActionSequence.ActionFinished();
                });
                ActionSequence.StartSequence();
            }
            else
            {
                ActionSequence.StopSequence();
                StaticMeshScript.LoadMesh(false);

                ViveSR_Experience_ControllerDelegate.touchpadDelegate -= handleTouchpad_Play;

                ViveSR_DualCameraRig.Instance.VirtualCamera.cullingMask |= (1 << LayerMask.NameToLayer("UI"));
                PortalScript.PortalManager.TurnOffCamera();

                PortalScript.PortalManager.gameObject.SetActive(false);

                StaticMeshScript.ClearHintLocators();
                npcGenerator.ClearScene();

                portalCamerasDisabledEvent.Invoke();
            }
        }
示例#3
0
        void ExportModel_done()
        {
            if (OnMeshSaved != null)
            {
                OnMeshSaved.Invoke();
            }
            ViveSR_Experience_Demo.instance.Rotator.RenderButtons(true);
            SubMenu.RenderSubBtns(true);

            isOn = false;

            //Disable the [Save] button.
            SubMenu.subBtnScripts[ThisButtonTypeNum].isOn = false;
            SubMenu.subBtnScripts[ThisButtonTypeNum].EnableButton(false);

            //Enable the [Scan] button.
            ViveSR_Experience_Demo.instance.SubButtonScripts[SubMenuButton._3DPreview_Scan].ForceExcute(false);
            ViveSR_Experience_Demo.instance.SubButtonScripts[SubMenuButton._3DPreview_Scan].EnableButton(true);

            ViveSR_Experience_HintMessage.instance.SetHintMessage(hintType.onController, "", false);

            ViveSR_Experience_HintMessage.instance.SetHintMessage(hintType.onHeadSet, "Mesh & Chair Data Saved!", true);

            //[Enable Mesh] is available.
            if (StaticMeshScript.CheckModelFileExist())
            {
                ViveSR_Experience_Demo.instance.SubButtonScripts[SubMenuButton.EnableMesh_StaticMR].EnableButton(true);
                ViveSR_Experience_Demo.instance.SubButtonScripts[SubMenuButton.EnableMesh_StaticVR].EnableButton(true);
            }

            StaticMeshScript.ClearHintLocators();
        }
示例#4
0
 void StartScanning()
 {
     RigidReconstruction.SRWork_Rigid_Reconstruciton.RegisterDataErrorHandler((int)Error.GPU_MEMORY_FULL, GPUMemoryFull);
     ViveSR_Experience_Demo.instance.StaticMeshScript.EnableDepthProcessingAndScanning(true);
     ViveSR_Experience_Demo.instance.StaticMeshScript.SetSegmentation(true);
     ViveSR_Experience_Demo.instance.SubButtonScripts[SubMenuButton._3DPreview_Save].EnableButton(true);
     StaticMeshScript.ClearHintLocators();
 }