Ejemplo n.º 1
0
    public static DeviceOptions getActivePlatform()
    {
        DeviceOptions detectedDevice = DeviceOptions.NoDevice;

        if (XRSettings.loadedDeviceName.Equals("Oculus"))
        {
            // Based on OVRControllerHelper.cs. See this file for other classes of oculus device.
            OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
            switch (headset)
            {
            case OVRPlugin.SystemHeadset.Oculus_Go:
                detectedDevice = DeviceOptions.OculusGo;
                break;

            case OVRPlugin.SystemHeadset.Oculus_Quest:
                detectedDevice = DeviceOptions.OculusQuest;
                break;
            }
        }
        if (XRSettings.loadedDeviceName.Equals("daydream"))
        {
            detectedDevice = DeviceOptions.Daydream;
        }

        return(detectedDevice);
    }
Ejemplo n.º 2
0
    void Start()
    {
        OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
        switch (headset)
        {
        case OVRPlugin.SystemHeadset.Rift_CV1:
            activeControllerType = ControllerType.Rift;
            break;

        case OVRPlugin.SystemHeadset.Oculus_Quest_2:
            activeControllerType = ControllerType.Quest2;
            break;

        default:
            activeControllerType = ControllerType.QuestAndRiftS;
            break;
        }

        Debug.LogFormat("OVRControllerHelp: Active controller type: {0} for product {1}", activeControllerType, OVRPlugin.productName);

        // Hide all controller models until controller get connected
        m_modelOculusTouchQuestAndRiftSLeftController.SetActive(false);
        m_modelOculusTouchQuestAndRiftSRightController.SetActive(false);
        m_modelOculusTouchRiftLeftController.SetActive(false);
        m_modelOculusTouchRiftRightController.SetActive(false);
        m_modelOculusTouchQuest2LeftController.SetActive(false);
        m_modelOculusTouchQuest2RightController.SetActive(false);
    }
Ejemplo n.º 3
0
    void Start()
    {
        OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
        switch (headset)
        {
        case OVRPlugin.SystemHeadset.Oculus_Quest:
            activeControllerType = ControllerType.QuestAndRiftS;
            break;

        case OVRPlugin.SystemHeadset.Rift_CV1:
            activeControllerType = ControllerType.Rift;
            break;

        case OVRPlugin.SystemHeadset.Rift_S:
            activeControllerType = ControllerType.QuestAndRiftS;
            break;

        default:
#if UNITY_EDITOR || !UNITY_ANDROID
            activeControllerType = ControllerType.Rift;
#else
            activeControllerType = ControllerType.GearVR;
#endif
            break;
        }

        Debug.LogFormat("OVRControllerHelp: Active controller type: {0} for product {1}", activeControllerType, OVRPlugin.productName);

        /*
         * if ((activeControllerType != ControllerType.GearVR) && (activeControllerType != ControllerType.Go))
         * {
         *      if (m_controller == OVRInput.Controller.LTrackedRemote)
         *      {
         *              m_controller = OVRInput.Controller.LTouch;
         *      }
         *      else if (m_controller == OVRInput.Controller.RTrackedRemote)
         *      {
         *              m_controller = OVRInput.Controller.RTouch;
         *      }
         * }
         * else
         * {
         *      if (m_controller == OVRInput.Controller.LTouch)
         *      {
         *              m_controller = OVRInput.Controller.LTrackedRemote;
         *      }
         *      else if (m_controller == OVRInput.Controller.RTouch)
         *      {
         *              m_controller = OVRInput.Controller.RTrackedRemote;
         *      }
         * }
         */
    }
        public OVRPointerPoseSelector(Handedness handedness)
        {
            OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
            switch (headset)
            {
            case OVRPlugin.SystemHeadset.Oculus_Quest_2:
            case OVRPlugin.SystemHeadset.Oculus_Link_Quest_2:
                LocalPointerPose = QUEST2_POINTERS[(int)handedness];
                break;

            default:
                LocalPointerPose = QUEST1_POINTERS[(int)handedness];
                break;
            }
        }
Ejemplo n.º 5
0
    void Start()
    {
        OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
        switch (headset)
        {
        case OVRPlugin.SystemHeadset.Rift_CV1:
            activeControllerType = ControllerType.Rift;
            break;

        default:
            activeControllerType = ControllerType.QuestAndRiftS;
            break;
        }

        Debug.LogFormat("OVRControllerHelp: Active controller type: {0} for product {1}", activeControllerType, OVRPlugin.productName);
    }
Ejemplo n.º 6
0
    public static bool IsRift()
    {
        OVRPlugin.SystemHeadset headsetType = OVRPlugin.GetSystemHeadsetType();
        switch (headsetType)
        {
        case OVRPlugin.SystemHeadset.Rift_DK1:
        case OVRPlugin.SystemHeadset.Rift_DK2:
        case OVRPlugin.SystemHeadset.Rift_CV1:
        case OVRPlugin.SystemHeadset.Rift_CB:
        case OVRPlugin.SystemHeadset.Rift_S:
            return(true);

        default:
            return(false);
        }
    }
Ejemplo n.º 7
0
    public static bool IsGearVRHeadset()
    {
        OVRPlugin.SystemHeadset headsetType = OVRPlugin.GetSystemHeadsetType();
        switch (headsetType)
        {
        case OVRPlugin.SystemHeadset.GearVR_R320:
        case OVRPlugin.SystemHeadset.GearVR_R321:
        case OVRPlugin.SystemHeadset.GearVR_R322:
        case OVRPlugin.SystemHeadset.GearVR_R323:
        case OVRPlugin.SystemHeadset.GearVR_R324:
        case OVRPlugin.SystemHeadset.GearVR_R325:
            return(true);

        default:
            return(false);
        }
    }
Ejemplo n.º 8
0
    void Start()
    {
        OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
        switch (headset)
        {
        case OVRPlugin.SystemHeadset.Oculus_Go:
            activeControllerType = ControllerType.Go;
            break;

        case OVRPlugin.SystemHeadset.Rift_CV1:
            activeControllerType = ControllerType.Rift;
            break;

        default:
            activeControllerType = ControllerType.QuestAndRiftS;
            break;
        }

        Debug.LogFormat("OVRControllerHelp: Active controller type: {0} for product {1}", activeControllerType, OVRPlugin.productName);
        if (activeControllerType != ControllerType.Go)
        {
            if (m_controller == OVRInput.Controller.LTrackedRemote)
            {
                m_controller = OVRInput.Controller.LTouch;
            }
            else if (m_controller == OVRInput.Controller.RTrackedRemote)
            {
                m_controller = OVRInput.Controller.RTouch;
            }
        }
        else
        {
            if (m_controller == OVRInput.Controller.LTouch)
            {
                m_controller = OVRInput.Controller.LTrackedRemote;
            }
            else if (m_controller == OVRInput.Controller.RTouch)
            {
                m_controller = OVRInput.Controller.RTrackedRemote;
            }
        }
    }
Ejemplo n.º 9
0
    void Start()
    {
        OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
        switch (headset)
        {
        case OVRPlugin.SystemHeadset.Oculus_Go:
            activeControllerType = ControllerType.Go;
            break;

        case OVRPlugin.SystemHeadset.Oculus_Quest:
            activeControllerType = ControllerType.QuestAndRiftS;
            break;

        case OVRPlugin.SystemHeadset.Rift_CV1:
            activeControllerType = ControllerType.Rift;
            break;

        case OVRPlugin.SystemHeadset.Rift_S:
        case OVRPlugin.SystemHeadset.Oculus_Link_Quest:
            activeControllerType = ControllerType.QuestAndRiftS;
            break;

        case OVRPlugin.SystemHeadset.GearVR_R320:
        case OVRPlugin.SystemHeadset.GearVR_R321:
        case OVRPlugin.SystemHeadset.GearVR_R322:
        case OVRPlugin.SystemHeadset.GearVR_R323:
        case OVRPlugin.SystemHeadset.GearVR_R324:
        case OVRPlugin.SystemHeadset.GearVR_R325:
            activeControllerType = ControllerType.GearVR;
            break;

        default:
#if UNITY_EDITOR || !UNITY_ANDROID
            activeControllerType = ControllerType.Rift;
#else
            activeControllerType = ControllerType.GearVR;
#endif
            break;
        }

        Debug.LogFormat("OVRControllerHelp: Active controller type: {0} for product {1}", activeControllerType, OVRPlugin.productName);
        if ((activeControllerType != ControllerType.GearVR) && (activeControllerType != ControllerType.Go))
        {
            if (m_controller == OVRInput.Controller.LTrackedRemote)
            {
                m_controller = OVRInput.Controller.LTouch;
            }
            else if (m_controller == OVRInput.Controller.RTrackedRemote)
            {
                m_controller = OVRInput.Controller.RTouch;
            }
        }
        else
        {
            if (m_controller == OVRInput.Controller.LTouch)
            {
                m_controller = OVRInput.Controller.LTrackedRemote;
            }
            else if (m_controller == OVRInput.Controller.RTouch)
            {
                m_controller = OVRInput.Controller.RTrackedRemote;
            }
        }
    }