public OpenVRController(VRInputDeviceHand hand)
        {
            Pointer = new InputDevicePointer(this);
            Pointer.Activate();
            Hand = hand;

            _buttonInputMap = GenerateButtonInputMap();
            _axis1DMap      = GenerateAxis1DInputMap();
            _axis2DMap      = GenerateAxis2DInputMap();
        }
Exemplo n.º 2
0
    /// <summary>
    /// OVRInput.Controller will return it as an enum and not a mask.
    /// </summary>
    /// <param name="limbType"></param>
    /// <returns></returns>
    public static OVRInput.Controller GetControllerType(VRInputDeviceHand hand)
    {
        switch (hand)
        {
        case VRInputDeviceHand.Left:
            return(IsOculusQuest ? OVRInput.Controller.LTouch : OVRInput.Controller.LTrackedRemote);

        case VRInputDeviceHand.Right:
            return(IsOculusQuest ? OVRInput.Controller.RTouch : OVRInput.Controller.RTrackedRemote);

        default:
            return(OVRInput.Controller.None);
        }
    }
Exemplo n.º 3
0
    private IVRInputDevice GetInput(VRInputDeviceHand hand)
    {
        IVRDevice device = VRDevice.Device;

        return(hand == VRInputDeviceHand.Left ? device.SecondaryInputDevice : device.PrimaryInputDevice);
    }
Exemplo n.º 4
0
 public GearVRController(VRInputDeviceHand hand) : base(OVRUtils.GetControllerType(hand))
 {
     _hand = hand;
 }