void Start()
    {
        var 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:
            ControllerType = ovrAvatarControllerType.Malibu;
            break;

        case OVRPlugin.SystemHeadset.Oculus_Go:
            ControllerType = ovrAvatarControllerType.Go;
            break;

        case OVRPlugin.SystemHeadset.Oculus_Quest:
        case OVRPlugin.SystemHeadset.Rift_S:
            ControllerType = ovrAvatarControllerType.Quest;
            break;

        case OVRPlugin.SystemHeadset.Rift_DK1:
        case OVRPlugin.SystemHeadset.Rift_DK2:
        case OVRPlugin.SystemHeadset.Rift_CV1:
        default:
            ControllerType = ovrAvatarControllerType.Touch;
            break;
        }
    }
Exemplo n.º 2
0
        public static void ovrAvatarPose_UpdateSDK3DofHands(
            IntPtr avatar,
            ovrAvatarHandInputState inputStateLeft,
            ovrAvatarHandInputState inputStateRight,
            ovrAvatarControllerType type)
        {
            System.IntPtr leftPtr  = Marshal.AllocHGlobal(Marshal.SizeOf(inputStateLeft));
            System.IntPtr rightPtr = Marshal.AllocHGlobal(Marshal.SizeOf(inputStateRight));
            Marshal.StructureToPtr(inputStateLeft, leftPtr, false);
            Marshal.StructureToPtr(inputStateRight, rightPtr, false);

            ovrAvatar_SetLeftControllerVisibility(avatar, true);
            ovrAvatar_SetRightControllerVisibility(avatar, true);
            ovrAvatar_SetLeftHandVisibility(avatar, true);
            ovrAvatar_SetRightHandVisibility(avatar, true);
            ovrAvatarPose_Update3DofHands(avatar, leftPtr, rightPtr, type);
        }
        public void SetDeviceIndex(uint index)
        {
            //Debug.Log(transform.parent.parent.name + " SetDeviceIndex " + index);
            m_deviceIndex = index;
#if (VIU_OCULUSVR_1_32_0_OR_NEWER || VIU_OCULUSVR_1_36_0_OR_NEWER) && VIU_OCULUSVR_AVATAR
            ovrController = this.GetComponent <OvrAvatarTouchController>();
#endif
#if VIU_OCULUSVR && VIU_OCULUSVR_AVATAR
            var headsetType = OVRPlugin.GetSystemHeadsetType();
            switch (headsetType)
            {
#if !VIU_OCULUSVR_19_0_OR_NEWER
            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:
                m_controllerType = ovrAvatarControllerType.Malibu;
                break;

            case OVRPlugin.SystemHeadset.Oculus_Go:
                m_controllerType = ovrAvatarControllerType.Go;
                break;
#endif
#if VIU_OCULUSVR_16_0_OR_NEWER
            case OVRPlugin.SystemHeadset.Oculus_Link_Quest:
#endif
            case OVRPlugin.SystemHeadset.Oculus_Quest:
#if VIU_OCULUSVR_1_37_0_OR_NEWER
            case OVRPlugin.SystemHeadset.Rift_S:
                m_controllerType = ovrAvatarControllerType.Quest;
                break;
#endif
            case OVRPlugin.SystemHeadset.Rift_DK1:
            case OVRPlugin.SystemHeadset.Rift_DK2:
            case OVRPlugin.SystemHeadset.Rift_CV1:
            default:
                m_controllerType = ovrAvatarControllerType.Touch;
                break;
            }
#endif
            LoadPreferedModel();
        }
Exemplo n.º 4
0
    void Start()
    {
        var headsetType = OVRPlugin.GetSystemHeadsetType();

        switch (headsetType)
        {
        case OVRPlugin.SystemHeadset.Oculus_Quest:
        case OVRPlugin.SystemHeadset.Rift_S:
            ControllerType = ovrAvatarControllerType.Quest;
            break;

        case OVRPlugin.SystemHeadset.Rift_DK1:
        case OVRPlugin.SystemHeadset.Rift_DK2:
        case OVRPlugin.SystemHeadset.Rift_CV1:
        default:
            ControllerType = ovrAvatarControllerType.Touch;
            break;
        }
    }
Exemplo n.º 5
0
 public static extern void ovrAvatarPose_Update3DofHands(
     IntPtr avatar,
     IntPtr inputStateLeft,
     IntPtr inputStateRight,
     ovrAvatarControllerType type);