Esempio n. 1
0
    protected void InitializeFromActiveNavigation()
    {
        // Search for navigation interaction parameters
        uint interactionNb = MiddleVR.VRInteractionMgr.GetInteractionsNb();

        if (interactionNb == 0)
        {
            MVRTools.Log(4, "[~] VRHeadCollision: no interaction found in Interaction Manager.");
            return;
        }

        bool     fly        = true;
        vrNode3D navNodeMVR = null;

        for (uint i = 0; i < interactionNb; ++i)
        {
            vrInteraction interaction = MiddleVR.VRInteractionMgr.GetInteractionByIndex(i);
            if (interaction.IsActive() && interaction.TagsContain("Navigation"))
            {
                // Get fly mode
                vrProperty flyProp = interaction.GetProperty("Fly");
                if (flyProp != null)
                {
                    fly = flyProp.GetBool();
                }

                // Get navigation node
                vrProperty navNodeProp = interaction.GetProperty("NavigationNode");
                if (navNodeProp != null)
                {
                    navNodeMVR = MiddleVR.VRDisplayMgr.GetNode(navNodeProp.GetObject().GetName());
                }

                break;
            }
        }

        if (navNodeMVR == null)
        {
            MVRTools.Log(2, "[X] VRNavigationCollision: impossible to retrieve navigation node.");
            return;
        }

        // Initialize parameters from found ones
        SetCollisionNode(GameObject.Find(CollisionNodeName));
        SetNavigationNode(navNodeMVR);
        SetFly(fly);

        // Try to start the collisions
        Initialize();
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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);
    }
Esempio n. 4
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);
    }