예제 #1
0
    private void _RefreshVirtualHandMenuName()
    {
        vrInteraction interaction = MiddleVR.VRInteractionMgr.GetActiveInteractionByTag("VirtualHand");

        if (interaction != null)
        {
            switch (interaction.GetName())
            {
            case "InteractionVirtualHandGogo":
            {
                m_VirtualHandOptions.SetLabel("Virtual Hand (Gogo)");
                break;
            }

            default:
            {
                m_VirtualHandOptions.SetLabel("Virtual Hand (" + interaction.GetName() + ")");
                break;
            }
            }
        }
        else
        {
            m_VirtualHandOptions.SetLabel("Virtual Hand");
        }
    }
예제 #2
0
파일: VRMenu.cs 프로젝트: nhurman/avalon
 private void _RefreshNavigationMenuName()
 {
     vrInteraction interaction = MiddleVR.VRInteractionMgr.GetActiveInteractionByTag("ContinuousNavigation");
     if (interaction != null)
     {
         switch (interaction.GetName())
         {
             case "InteractionNavigationWandJoystick":
                 {
                     m_NavigationOptions.SetLabel("Navigation (Joystick)");
                     break;
                 }
             case "InteractionNavigationElastic":
                 {
                     m_NavigationOptions.SetLabel("Navigation (Elastic)");
                     break;
                 }
             case "InteractionNavigationGrabWorld":
                 {
                     m_NavigationOptions.SetLabel("Navigation (Grab The World)");
                     break;
                 }
             default:
                 {
                     m_NavigationOptions.SetLabel("Navigation (" + interaction.GetName() + ")");
                     break;
                 }
         }
     }
     else
     {
         m_NavigationOptions.SetLabel("Navigation");
     }
 }
예제 #3
0
    private void _RefreshManipulationMenuName()
    {
        vrInteraction interaction = MiddleVR.VRInteractionMgr.GetActiveInteractionByTag("ContinuousManipulation");

        if (interaction != null)
        {
            switch (interaction.GetName())
            {
            case "InteractionManipulationRay":
            {
                m_ManipulationOptions.SetLabel("Manipulation (Ray)");
                break;
            }

            case "InteractionManipulationHomer":
            {
                m_ManipulationOptions.SetLabel("Manipulation (Homer)");
                break;
            }

            default:
            {
                m_ManipulationOptions.SetLabel("Manipulation (" + interaction.GetName() + ")");
                break;
            }
            }
        }
        else
        {
            m_ManipulationOptions.SetLabel("Manipulation");
        }
    }
예제 #4
0
    private bool EventListener(vrEvent iEvent)
    {
        // Catch interaction events
        vrInteractionEvent interactionEvt = vrInteractionEvent.Cast(iEvent);

        if (interactionEvt != null)
        {
            vrInteraction interaction = interactionEvt.GetInteraction();

            bool needLabelRefresh = false;

            // Identify interaction
            // If existing in the Menu, update the menu
            if (interactionEvt.GetEventType() == (int)VRInteractionEventEnum.VRInteractionEvent_Activated)
            {
                vrWidgetToggleButton interactionButton;

                if (m_Buttons.TryGetValue(interaction.GetName(), out interactionButton))
                {
                    interactionButton.SetChecked(true);
                }

                needLabelRefresh = true;
            }
            else if (interactionEvt.GetEventType() == (int)VRInteractionEventEnum.VRInteractionEvent_Deactivated)
            {
                vrWidgetToggleButton interactionButton;

                if (m_Buttons.TryGetValue(interaction.GetName(), out interactionButton))
                {
                    interactionButton.SetChecked(false);
                }

                needLabelRefresh = true;
            }

            // Refresh interaction menu label if activated or deactivated
            if (needLabelRefresh)
            {
                if (interaction.TagsContain("ContinuousNavigation"))
                {
                    _RefreshNavigationMenuName();
                }
                else if (interaction.TagsContain("ContinuousManipulation"))
                {
                    _RefreshManipulationMenuName();
                }
                else if (interaction.TagsContain("VirtualHand"))
                {
                    _RefreshVirtualHandMenuName();
                }
            }
        }

        return(true);
    }
예제 #5
0
    public void CreateInteractionToggleButton(vrInteraction iInteraction, string iButtonName, vrWidgetMenu iParentMenu, string iButtonHandlerName)
    {
        string itName = iInteraction.GetName();

        vrWidgetToggleButton button = new vrWidgetToggleButton("VRMenu." + itName + "ToggleButton", iParentMenu, iButtonName, MVRTools.GetCommand(iButtonHandlerName), iInteraction.IsActive());

        m_Buttons.Add(itName, button);
        MVRTools.RegisterObject(this, button);
    }
예제 #6
0
파일: VRMenu.cs 프로젝트: nhurman/avalon
    public void CreateInteractionToggleButton(vrInteraction iInteraction, string iButtonName, vrWidgetMenu iParentMenu, vrCommand.Delegate iButtonHandler)
    {
        string itName = iInteraction.GetName();

        vrCommand newCommand = new vrCommand("VRMenu." + itName + "ToggleCommand", iButtonHandler);
        m_Commands.Add(itName, newCommand);

        vrWidgetToggleButton button = new vrWidgetToggleButton("VRMenu." + itName + "ToggleButton", iParentMenu, iButtonName, newCommand, iInteraction.IsActive());
        m_Buttons.Add(itName, button);
    }
예제 #7
0
파일: VRMenu.cs 프로젝트: nhurman/avalon
    private bool EventListener(vrEvent iEvent)
    {
        // Catch interaction events
        vrInteractionEvent interactionEvt = vrInteractionEvent.Cast(iEvent);

        if (interactionEvt != null)
        {
            vrInteraction interaction = interactionEvt.GetInteraction();

            bool needLabelRefresh = false;

            // Identify interaction
            // If existing in the Menu, update the menu
            if (interactionEvt.GetEventType() == (int)VRInteractionEventEnum.VRInteractionEvent_Activated)
            {
                vrWidgetToggleButton interactionButton;

                if (m_Buttons.TryGetValue(interaction.GetName(), out interactionButton))
                {
                    interactionButton.SetChecked(true);
                }

                needLabelRefresh = true;
            }
            else if (interactionEvt.GetEventType() == (int)VRInteractionEventEnum.VRInteractionEvent_Deactivated)
            {
                vrWidgetToggleButton interactionButton;

                if (m_Buttons.TryGetValue(interaction.GetName(), out interactionButton))
                {
                    interactionButton.SetChecked(false);
                }

                needLabelRefresh = true;
            }
        }
        return(true);
    }
예제 #8
0
파일: VRMenu.cs 프로젝트: fbav/locomotion
    public void CreateInteractionToggleButton(vrInteraction iInteraction, string iButtonName, vrWidgetMenu iParentMenu, vrCommand.Delegate iButtonHandler)
    {
        string itName = iInteraction.GetName();

        vrCommand newCommand = new vrCommand("VRMenu." + itName + "ToggleCommand", iButtonHandler);
        m_Commands.Add(itName, newCommand);

        vrWidgetToggleButton button = new vrWidgetToggleButton("VRMenu." + itName + "ToggleButton", iParentMenu, iButtonName, newCommand, iInteraction.IsActive());
        m_Buttons.Add(itName, button);
    }
예제 #9
0
 protected virtual void OnActivate()
 {
     MVRTools.Log(3, "[ ] VRInteraction: Activating '" + m_Interaction.GetName() + "'.");
 }