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));
        }
예제 #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();
        }
예제 #3
0
        void ConfirmARAnchorPoint()
        {
            m_PlacementRuleGameObjectSelector.GetValue().SetActive(false);
            m_Raycaster.ActiveScanning = false;
            m_Raycaster.DisableCursor();

            var firstARSelectedPlane  = m_FirstARSelectedPlaneSelector.GetValue();
            var secondARSelectedPlane = m_SecondARSelectedPlaneSelector.GetValue();
            var ARFloor = m_ARFloorSelector.GetValue();

            // calculate AR anchor point
            SetARAnchorPointAction.SetARAnchorPointData data;
            PlanePlaneIntersection(out var unusedPoint, out var lineVec, firstARSelectedPlane.transform.up, firstARSelectedPlane.transform.position,
                                   secondARSelectedPlane.transform.up, secondARSelectedPlane.transform.position);

            // calculate intersect with bottom floor for now
            LinePlaneIntersection(out data.arPlacementLocation, unusedPoint, lineVec, ARFloor.transform.up, ARFloor.transform.position);

            // calculate beam height
            data.beamHeight = Math.Max(firstARSelectedPlane.GetComponent <Renderer>().bounds.size.y, secondARSelectedPlane.GetComponent <Renderer>().bounds.size.y);
            Dispatcher.Dispatch(SetARAnchorPointAction.From(data));
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.navigationEnabled       = false;
            toolState.okEnabled               = true;
            toolState.previousStepEnabled     = true;
            toolState.arWallIndicatorsEnabled = true;
            toolState.arAnchorPointsEnabled   = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionConfirmARAnchorPoint, type = StatusMessageType.Instruction
            }));
        }
예제 #4
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));
        }
예제 #5
0
        void AlignmentView()
        {
            // Stop image tracker
            m_MarkerController.ImageTracker.Stop();

            // Show model
            Dispatcher.Dispatch(ShowBoundingBoxModelAction.From(true));
            Dispatcher.Dispatch(ShowModelAction.From(false));
            Dispatcher.Dispatch(SetModelScaleAction.From(SetModelScaleAction.ArchitectureScale.OneToOne));
            // Show tool for making minor adjustments
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okButtonValidator = this;

            // Show complete button
            toolState.okEnabled           = true;
            toolState.scaleEnabled        = false;
            toolState.rotateEnabled       = false;
            toolState.previousStepEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));

            // Show button for Re-anchoring to updated image tracker position.
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = k_Alignment, type = StatusMessageType.Instruction
            }));

            m_ARModeUIController.StartCoroutine(VisualizeWhenLoaded());
        }
예제 #6
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));
        }
        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));
        }
예제 #8
0
        void AlignModelView()
        {
            m_Raycaster.Reset();
            m_Raycaster.ActiveScanning = false;
            m_Raycaster.DisableCursor();

            Dispatcher.Dispatch(SetActiveToolAction.From(SetActiveToolAction.ToolType.OrbitTool));
            var arToolStateData = SetARToolStateAction.SetARToolStateData.defaultData;

            arToolStateData.navigationEnabled  = true;
            arToolStateData.okEnabled          = true;
            arToolStateData.okButtonValidator  = this;
            arToolStateData.scaleEnabled       = false;
            arToolStateData.rotateEnabled      = false;
            arToolStateData.selectionEnabled   = false;
            arToolStateData.measureToolEnabled = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(arToolStateData));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionAlignModelView, type = StatusMessageType.Instruction
            }));

            Dispatcher.Dispatch(EnableAllNavigationAction.From(true));
            Dispatcher.Dispatch(SetShowScaleReferenceAction.From(false));
        }
예제 #9
0
        void FindSecondARWallBack()
        {
            DestroyImmediate(m_SecondARSelectedPlaneSelector.GetValue());
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.arWallIndicatorsEnabled = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            FindSecondARWall();
        }
예제 #10
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));
        }
예제 #11
0
        void ConfirmPlacementNext()
        {
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.navigationEnabled       = false;
            toolState.okEnabled               = true;
            toolState.previousStepEnabled     = true;
            toolState.arWallIndicatorsEnabled = false;
            toolState.arAnchorPointsEnabled   = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            ConfirmPlacement();
        }
예제 #12
0
        void FindFirstWallBack()
        {
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.navigationEnabled     = false;
            toolState.previousStepEnabled   = true;
            toolState.okButtonValidator     = this;
            toolState.wallIndicatorsEnabled = true;
            toolState.anchorPointsEnabled   = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            DestroyImmediate(m_FirstSelectedPlaneSelector.GetValue());
            FindFirstWall();
        }
예제 #13
0
        void ConfirmAnchorPoint()
        {
            Dispatcher.Dispatch(SelectObjectAction.From(new ObjectSelectionInfo()));
            var arToolStateData = SetARToolStateAction.SetARToolStateData.defaultData;

            arToolStateData.navigationEnabled     = false;
            arToolStateData.previousStepEnabled   = true;
            arToolStateData.okButtonValidator     = this;
            arToolStateData.wallIndicatorsEnabled = true;
            arToolStateData.anchorPointsEnabled   = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(arToolStateData));
            Dispatcher.Dispatch(SetActiveToolAction.From(SetActiveToolAction.ToolType.None));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionConfirmAnchorPoint, type = StatusMessageType.Instruction
            }));
        }
예제 #14
0
        void FindSecondWall()
        {
            Dispatcher.Dispatch(SelectObjectAction.From(new ObjectSelectionInfo()));
            var arToolState = SetARToolStateAction.SetARToolStateData.defaultData;

            arToolState.navigationEnabled     = false;
            arToolState.selectionEnabled      = true;
            arToolState.previousStepEnabled   = true;
            arToolState.okButtonValidator     = this;
            arToolState.wallIndicatorsEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(arToolState));
            Dispatcher.Dispatch(SetActiveToolAction.From(SetActiveToolAction.ToolType.SelectTool));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionFindSecondWall, type = StatusMessageType.Instruction
            }));
        }
예제 #15
0
        void FindSecondARWall()
        {
            m_Raycaster.Reset();
            m_Raycaster.ActiveScanning = true;
            m_ARModeUIController.ActivePlacementRules(SetModelFloorAction.PlacementRule.WallPlacementRule);
            Dispatcher.Dispatch(SetARPlacementRuleAction.From(SetModelFloorAction.PlacementRule.WallPlacementRule));
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.navigationEnabled       = false;
            toolState.okButtonValidator       = this;
            toolState.previousStepEnabled     = true;
            toolState.arWallIndicatorsEnabled = true;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionFindSecondARWall, type = StatusMessageType.Instruction
            }));
        }
예제 #16
0
        void FindModelFloor()
        {
            m_PlaneSelector.Orientation = MarsPlaneAlignment.HorizontalUp;
            Dispatcher.Dispatch(SelectObjectAction.From(new ObjectSelectionInfo()));
            Dispatcher.Dispatch(SetSpatialSelectorAction.From(m_PlaneSelector));
            var arToolState = SetARToolStateAction.SetARToolStateData.defaultData;

            arToolState.navigationEnabled   = false;
            arToolState.selectionEnabled    = true;
            arToolState.previousStepEnabled = true;
            arToolState.okButtonValidator   = this;
            Dispatcher.Dispatch(SetARToolStateAction.From(arToolState));
            Dispatcher.Dispatch(SetActiveToolAction.From(SetActiveToolAction.ToolType.SelectTool));
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionFindModelFloor, type = StatusMessageType.Instruction
            }));
        }
        void FindTheFloor()
        {
            m_PlacementRuleGameObjectSelector.GetValue().SetActive(true);
            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionFindAPlaneText, type = StatusMessageType.Instruction
            }));
            m_Raycaster.ActiveScanning = true;
            Dispatcher.Dispatch(ShowBoundingBoxModelAction.From(false));
            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okEnabled          = false;
            toolState.okButtonValidator  = this;
            toolState.scaleEnabled       = false;
            toolState.rotateEnabled      = false;
            toolState.selectionEnabled   = false;
            toolState.measureToolEnabled = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
        }
        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));
        }
예제 #19
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();
        }
        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));
        }
예제 #21
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();
        }
예제 #23
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));
        }
예제 #24
0
        void HandleTrackableFound(Pose pose, string trackableId)
        {
            if (m_MarkerController.MarkerStorage.Markers == null || m_MarkerController.MarkerStorage.Markers.Count == 0)
            {
                Debug.LogError("No Markers");
                return;
            }

            if (m_MarkerController.ActiveMarker == null)
            {
                Debug.LogError("No Marker available!");
                return;
            }

            m_MarkerController.CurrentMarkerPose = pose;

            var toolState = SetARToolStateAction.SetARToolStateData.defaultData;

            toolState.okButtonValidator = this;
            toolState.okEnabled         = true;
            toolState.scaleEnabled      = false;
            toolState.rotateEnabled     = false;
            Dispatcher.Dispatch(SetARToolStateAction.From(toolState));
        }