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));
        }
コード例 #3
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());
        }
コード例 #4
0
 void ConfirmARAnchorPointBack()
 {
     Dispatcher.Dispatch(SetInstructionMode.From(true));
     Dispatcher.Dispatch(SetActiveToolBarAction.From(SetActiveToolBarAction.ToolbarType.ARInstructionSidebar));
     m_Raycaster.RestoreModel(m_BoundinBoxRootSelector.GetValue(), m_RootSelector.GetValue());
     Dispatcher.Dispatch(ShowModelAction.From(false));
     Dispatcher.Dispatch(ShowBoundingBoxModelAction.From(false));
     ConfirmARAnchorPoint();
 }
コード例 #5
0
        void ConfirmPlacement()
        {
            var modelPlaneContext = m_FirstSelectedPlaneSelector.GetValue().GetComponent <PlaneSelectionContext>().SelectionContextList[0];
            var arPlaneNormal     = m_FirstARSelectedPlaneSelector.GetValue().transform.up;

            m_Raycaster.AlignModelWithAnchor(m_BoundinBoxRootSelector.GetValue(), modelPlaneContext.SelectedPlane.normal,
                                             arPlaneNormal, m_ModelPlacementLocationSelector.GetValue(),
                                             m_ARPlacementLocationSelector.GetValue());

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

            Dispatcher.Dispatch(SetStatusMessageWithType.From(
                                    new StatusMessageData()
            {
                text = m_InstructionConfirmPlacementText, 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));
        }
コード例 #8
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());
        }