Example #1
0
        void FindTheARFloor()
        {
            m_ARModeUIController.ActivePlacementRules(SetModelFloorAction.PlacementRule.FloorPlacementRule);
            Dispatcher.Dispatch(ShowModelAction.From(false));
            Dispatcher.Dispatch(SetARPlacementRuleAction.From(SetModelFloorAction.PlacementRule.FloorPlacementRule));
            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(ClearStatusAction.From(false));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARInstructionSidebar));

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okEnabled           = false;
            toolState.navigationEnabled   = false;
            toolState.okButtonValidator   = this;
            toolState.previousStepEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionFindTheFloor, type = StatusMessageType.Instruction
            }));

            Dispatcher.Dispatch(EnableBimFilterAction.From(false));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
        }
Example #2
0
        void StartInstruction()
        {
            Dispatcher.Dispatch(ShowModelAction.From(true));
            Dispatcher.Dispatch(SetInstructionUIStateAction.From(SetInstructionUIStateAction.InstructionUIState.Init));
            Dispatcher.Dispatch(SetARInstructionUIAction.From(new { currentARInstructionUI = this }));

            Dispatcher.Dispatch(SetAREnabledAction.From(false));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARModelAlignSidebar));
            Dispatcher.Dispatch(SetInstructionMode.From(true));
            Dispatcher.Dispatch(SetModelScaleAction.From(SetModelScaleAction.ArchitectureScale.OneToOne));

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
            Dispatcher.Dispatch(ToggleMeasureToolAction.From(ToggleMeasureToolAction.ToggleMeasureToolData.defaultData));

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.selectionEnabled   = true;
            toolState.measureToolEnabled = true;
            toolState.scaleEnabled       = true;
            toolState.cancelEnabled      = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Next();
        }
Example #3
0
        void ConfirmAnchorPointBack()
        {
            var arToolStateData = SetARToolStateAction.SetARToolStateData.defaultData;

            arToolStateData.navigationEnabled     = true;
            arToolStateData.previousStepEnabled   = true;
            arToolStateData.okButtonValidator     = this;
            arToolStateData.wallIndicatorsEnabled = true;
            arToolStateData.anchorPointsEnabled   = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(arToolStateData));
            Dispatcher.Dispatch(SetActiveToolAction.From(SetActiveToolAction.ToolType.None));

            m_Raycaster.Reset();
            m_Raycaster.ActiveScanning = false;

            Dispatcher.Dispatch(SetAREnabledAction.From(false));
            m_ARModeUIController.ActivePlacementRules(SetModelFloorAction.PlacementRule.None);
            Dispatcher.Dispatch(SetARPlacementRuleAction.From(SetModelFloorAction.PlacementRule.None));
            Dispatcher.Dispatch(EnableAllNavigationAction.From(true));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARModelAlignSidebar));

            ConfirmAnchorPoint();

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
        }
        void ConfirmPlacement()
        {
            m_PlacementRuleGameObjectGetter.GetValue().SetActive(false);

            m_Raycaster.ActiveScanning = false;
            m_Raycaster.SetViewBasedPlaceMode(true);

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okEnabled           = true;
            toolState.previousStepEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARInstructionSidebar));
            Dispatcher.Dispatch(ShowBoundingBoxModelAction.From(true));
            Dispatcher.Dispatch(ShowModelAction.From(false));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionAimToPlaceText, type = StatusMessageType.Instruction
            }));
            Dispatcher.Dispatch(EnableBimFilterAction.From(false));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
        }
        void FindTheFloor()
        {
            Dispatcher.Dispatch(EnableAllNavigationAction.From(false));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(true));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARInstructionSidebar));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionFindAPlaneText, type = StatusMessageType.Instruction
            }));
            Dispatcher.Dispatch(ShowBoundingBoxModelAction.From(false));
            m_PlacementRuleGameObjectGetter.GetValue().SetActive(true);
            m_Raycaster.ActiveScanning = true;
            m_Raycaster.SetViewBasedPlaceMode(false);
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okEnabled           = false;
            toolState.okButtonValidator   = this;
            toolState.previousStepEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(EnableBimFilterAction.From(false));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
        }
Example #6
0
        void OnFlyButtonClicked()
        {
            Dispatcher.Dispatch(CloseAllDialogsAction.From(null));

            var currentNavigationMode = m_NavigationModeSelector.GetValue();

            if (currentNavigationMode == SetNavigationModeAction.NavigationMode.Orbit ||
                currentNavigationMode == SetNavigationModeAction.NavigationMode.Fly)
            {
                return;
            }

            m_WalkButton.button.interactable = true;

            CheckDeviceCapability(m_DeviceCapabilitySelector.GetValue());

            Dispatcher.Dispatch(ShowModelAction.From(true));

            Dispatcher.Dispatch(SetAREnabledAction.From(false));

            Dispatcher.Dispatch(SetVREnableAction.From(false));

            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(ClearStatusAction.From(false));
            Dispatcher.Dispatch(SetInstructionMode.From(false));

            if (currentNavigationMode != SetNavigationModeAction.NavigationMode.Walk)
            {
                Dispatcher.Dispatch(UnloadSceneActions <Project> .From(m_SceneDictionary[currentNavigationMode]));
                Dispatcher.Dispatch(SetCameraViewTypeAction.From(SetCameraViewTypeAction.CameraViewType.Default));
            }

            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.OrbitSidebar));

            Dispatcher.Dispatch(SetThemeAction.From(ThemeController.k_Default));

            Dispatcher.Dispatch(SetWalkEnableAction.From(false));

            Dispatcher.Dispatch(EnableAllNavigationAction.From(true));
            Dispatcher.Dispatch(SetNavigationModeAction.From(SetNavigationModeAction.NavigationMode.Orbit));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(false));

            Dispatcher.Dispatch(LoadSceneActions <Project> .From(m_SceneDictionary[SetNavigationModeAction.NavigationMode.Orbit]));

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(true));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(true));

            var arToolStateData = SetARToolStateAction.SetARToolStateData.defaultData;

            arToolStateData.selectionEnabled   = true;
            arToolStateData.measureToolEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(arToolStateData));
        }
Example #7
0
        void ConfirmPlacementBack()
        {
            Dispatcher.Dispatch(SetInstructionMode.From(true));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARInstructionSidebar));

            Dispatcher.Dispatch(OpenDialogAction.From(OpenDialogAction.DialogType.None));
            Dispatcher.Dispatch(EnableBimFilterAction.From(false));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
            ConfirmPlacement();
        }
Example #8
0
        void ActivateVRmode()
        {
            m_WalkButton.button.interactable = false;
            m_VRButton.button.interactable   = false;
            var currentNavigationMode = m_NavigationModeSelector.GetValue();

            Dispatcher.Dispatch(SetAREnabledAction.From(false));

            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(ClearStatusAction.From(false));

            Dispatcher.Dispatch(SetInstructionMode.From(false));

            if (currentNavigationMode != SetNavigationModeAction.NavigationMode.Walk)
            {
                Dispatcher.Dispatch(UnloadSceneActions <Project> .From(m_SceneDictionary[currentNavigationMode]));
            }

            Dispatcher.Dispatch(CloseAllDialogsAction.From(null));

            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.VRSidebar));

            Dispatcher.Dispatch(SetThemeAction.From(ThemeController.k_VROpaque));

            Dispatcher.Dispatch(SetWalkEnableAction.From(false));

            Dispatcher.Dispatch(SetVREnableAction.From(true));

            Dispatcher.Dispatch(EnableAllNavigationAction.From(true));
            Dispatcher.Dispatch(SetNavigationModeAction.From(SetNavigationModeAction.NavigationMode.VR));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(false));

            Dispatcher.Dispatch(LoadSceneActions <Project> .From(m_SceneDictionary[SetNavigationModeAction.NavigationMode.VR]));

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(true));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(true));

            Dispatcher.Dispatch(ToggleMeasureToolAction.From(ToggleMeasureToolAction.ToggleMeasureToolData.defaultData));
        }
        void OnBoardingCompleteNext()
        {
            m_Raycaster.SetViewBasedPlaceMode(false);

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.previousStepEnabled = true;
            toolState.selectionEnabled    = true;
            toolState.measureToolEnabled  = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(SetInstructionMode.From(false));
            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(ClearStatusAction.From(false));
            Dispatcher.Dispatch(ShowModelAction.From(true));
            Dispatcher.Dispatch(ShowBoundingBoxModelAction.From(false));
            Dispatcher.Dispatch(SetInstructionUIStateAction.From(SetInstructionUIStateAction.InstructionUIState.Completed));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARSidebar));
            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(true));
        }
        void AlignModelView()
        {
            m_Raycaster.Reset();

            if (m_PlacementRuleGameObjectGetter.GetValue() != null)
            {
                m_PlacementRuleGameObjectGetter.GetValue().SetActive(false);
            }
            m_Raycaster.ActiveScanning = false;
            m_Raycaster.DisableCursor();

            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionAlignModelView, type = StatusMessageType.Instruction
            }));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARModelAlignSidebar));
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okEnabled          = false;
            toolState.selectionEnabled   = true;
            toolState.measureToolEnabled = true;
            toolState.cancelEnabled      = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));

            toolState = SetARToolStateAction.SetARToolStateData.defaultData;
            toolState.navigationEnabled = true;
            toolState.okEnabled         = true;
            toolState.scaleEnabled      = false;
            toolState.rotateEnabled     = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(EnableAllNavigationAction.From(true));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(false));
            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
        }
Example #11
0
        void AnchoringView()
        {
            var instruction = $"Locate anchor for {m_MarkerController.ActiveMarker.Name}, then press Ok.";

            Dispatcher.Dispatch(SetStatusMessageWithType.From(new StatusMessageData {
                text = instruction, type = StatusMessageType.Instruction
            }));

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okButtonValidator   = null;
            toolState.okEnabled           = false;
            toolState.scaleEnabled        = false;
            toolState.rotateEnabled       = false;
            toolState.previousStepEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARInstructionSidebar));

            Dispatcher.Dispatch(ShowModelAction.From(false));

            Dispatcher.Dispatch(EnableBimFilterAction.From(false));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(false));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));

            Dispatcher.Dispatch(SetAREnabledAction.From(true));
            Dispatcher.Dispatch(SetARPlacementRuleAction.From(SetModelFloorAction.PlacementRule.MarkerPlacementRule));

            // Run image tracking, watch for a target
            // Show accept button when a target is available.

            m_MarkerController.ImageTracker.OnTrackedFound          += HandleTrackableFound;
            m_MarkerController.ImageTracker.OnTrackedPositionUpdate += HandleTrackableUpdate;

            m_PlacementRuleGameObjectSelector.GetValue().SetActive(false);

            m_MarkerController.ImageTracker.Run();
        }
Example #12
0
        // Finalization State
        void OnBoardingComplete()
        {
            m_MarkerController.ImageTracker.OnTrackedFound          -= HandleTrackableFound;
            m_MarkerController.ImageTracker.OnTrackedPositionUpdate -= HandleTrackableUpdate;
            // Stop image tracker
            m_MarkerController.ImageTracker.Stop();
            Dispatcher.Dispatch(SetInstructionMode.From(false));
            Dispatcher.Dispatch(ClearStatusAction.From(true));
            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARSidebar));

            Dispatcher.Dispatch(ShowModelAction.From(true));
            Dispatcher.Dispatch(ShowBoundingBoxModelAction.From(false));
            Dispatcher.Dispatch(SetInstructionUIStateAction.From(SetInstructionUIStateAction.InstructionUIState.Completed));

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okEnabled               = true;
            toolState.okButtonValidator       = null;
            toolState.previousStepEnabled     = true;
            toolState.cancelEnabled           = true;
            toolState.scaleEnabled            = true;
            toolState.rotateEnabled           = false;
            toolState.selectionEnabled        = true;
            toolState.measureToolEnabled      = true;
            toolState.navigationEnabled       = false;
            toolState.arWallIndicatorsEnabled = false;
            toolState.arAnchorPointsEnabled   = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(true));

            // Finally set the model's transform to the marker
            m_ARModeUIController.StartCoroutine(VisualizeWhenLoaded());
        }
        void StartInstruction()
        {
            Dispatcher.Dispatch(ShowModelAction.From(false));
            Dispatcher.Dispatch(SetInstructionUIStateAction.From(SetInstructionUIStateAction.InstructionUIState.Init));
            Dispatcher.Dispatch(SetARInstructionUIAction.From(new { currentARInstructionUI = this }));
            Dispatcher.Dispatch(SetAREnabledAction.From(true));

            m_Raycaster.Reset();
            m_ARModeUIController.ActivePlacementRules(SetModelFloorAction.PlacementRule.TableTopPlacementRule);
            Dispatcher.Dispatch(SetARPlacementRuleAction.From(SetModelFloorAction.PlacementRule.TableTopPlacementRule));

            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARInstructionSidebar));

            // default scale 1:100
            Dispatcher.Dispatch(SetModelScaleAction.From(SetModelScaleAction.ArchitectureScale.OneToOneHundred));

            Dispatcher.Dispatch(EnableAllNavigationAction.From(false));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(true));
            Dispatcher.Dispatch(SetInstructionMode.From(true));

            Dispatcher.Dispatch(EnableBimFilterAction.From(false));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(false));
            Dispatcher.Dispatch(
                ToggleMeasureToolAction.From(ToggleMeasureToolAction.ToggleMeasureToolData.defaultData));

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.selectionEnabled   = true;
            toolState.measureToolEnabled = true;
            toolState.scaleEnabled       = true;
            toolState.cancelEnabled      = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));

            Next();
        }
Example #14
0
        void OnBoardingCompleteNext()
        {
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.selectionEnabled        = true;
            toolState.navigationEnabled       = false;
            toolState.okEnabled               = true;
            toolState.previousStepEnabled     = true;
            toolState.arWallIndicatorsEnabled = false;
            toolState.arAnchorPointsEnabled   = false;
            toolState.measureToolEnabled      = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));

            var modelPlaneContext = m_FirstSelectedPlaneSelector.GetValue().GetComponent <PlaneSelectionContext>().SelectionContextList[0];

            m_Raycaster.AlignModelWithAnchor(m_RootSelector.GetValue(), modelPlaneContext.SelectedPlane.normal,
                                             m_ARPlacementAlignmentSelector.GetValue(), m_ModelPlacementLocationSelector.GetValue(),
                                             m_ARPlacementLocationSelector.GetValue());

            Dispatcher.Dispatch(ShowModelAction.From(true));

            // only clear the messages if not debugging ARAxis
            if (!m_ARAxisTrackingSelector.GetValue())
            {
                Dispatcher.Dispatch(SetInstructionMode.From(false));
                Dispatcher.Dispatch(ClearStatusAction.From(true));
                Dispatcher.Dispatch(ClearStatusAction.From(false));
            }

            Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARSidebar));

            Dispatcher.Dispatch(EnableBimFilterAction.From(true));
            Dispatcher.Dispatch(EnableSceneSettingsAction.From(true));
            Dispatcher.Dispatch(EnableSunStudyAction.From(false));
            Dispatcher.Dispatch(EnableMarkerSettingsAction.From(true));
        }