Exemplo n.º 1
0
 public GamepadSys()
 {
     /* The 'Buttons' Array covers 6 total possible buttons on a generic SteamVR controller. By default, the mappings are done similarly
      * to an HTC Vive controller. There are 5 Primary bindings on the Vive controller.
      * [0] = Menu Button
      * [1] = System Button
      * [2] = Trigger Pressed
      * [3] = Grip Button
      * [4] = Touchpad Clicked (Tactile)
      * [5] = Touchpad Touched (Capacitive)
      */
     n_VridgeRemote = null;
     LButtons[0]    = false;
     LButtons[1]    = false;
     LButtons[2]    = false;
     LButtons[3]    = false;
     LButtons[4]    = false;
     LButtons[5]    = false;
     RButtons[0]    = false;
     RButtons[1]    = false;
     RButtons[2]    = false;
     RButtons[3]    = false;
     RButtons[4]    = false;
     RButtons[5]    = false;
     Teemer         = new Timer(obj => Update());
 }
Exemplo n.º 2
0
        public MainWindow()
        {
            m_VridgeRemote = new VridgeRemote("localhost", "Vridge.NoloVR", Capabilities.HeadTracking | Capabilities.Controllers);

            InitializeComponent();

            SetTextValue(HeadHeight, m_HeadHeight);
            SetToggleValue(HeadRotationEnabled, m_RotationEnabled);
            SetToggleValue(NoloVREnabled, m_RudderEnabled);

            Closing += Window_Closed;
        }
Exemplo n.º 3
0
        public MainWindow()
        {
            m_VridgeRemote     = new VridgeRemote("localhost", "Vridge.3dRudder", Capabilities.HeadTracking);
            m_AxesParamDefault = new AxesParamDefault();
            m_AxesValue        = new AxesValue();

            InitializeComponent();

            SetTextValue(HeadHeight, m_HeadHeight);
            SetTextValue(MoveSpeed, m_MoveSpeed);
            SetTextValue(RotationSpeed, m_RotationSpeed);
            SetToggleValue(RotationEnabled, m_RotationEnabled);
            SetToggleValue(RudderEnabled, m_RudderEnabled);
            SetToggleValue(SimulateCrouch, m_SimulateCrouch);
        }
Exemplo n.º 4
0
        public MainWindow()
        {
            m_VridgeRemote = new VridgeRemote("localhost", "Vridge.Kinect", Capabilities.Controllers | Capabilities.HeadTracking);

            InitializeComponent();

            Closing += (s, e) => Shutdown();
            Closed  += (s, e) => Shutdown();

            KinectTypeCombo.SelectedIndex = m_Use360Driver ? 1 : 0;

            SetToggleValue(SendLeftPosition, m_SendLeftPosition);
            SetToggleValue(SendLeftRotation, m_SendLeftRotation);
            SetToggleValue(SendRightPosition, m_SendRightPosition);
            SetToggleValue(SendRightRotation, m_SendRightRotation);
        }
Exemplo n.º 5
0
        public ControlViewModel()
        {
            HeadTrackingModes = new  Dictionary <TrackingType, string>()
            {
                { TrackingType.Position, "Send position only" },
                { TrackingType.PositionAndRotation, "Send position and rotation" },
                { TrackingType.SyncOffset, "Send synchronous offset" },
                { TrackingType.AsyncOffset, "Send asynchronous offset" },
            };

            ControlTargets = new Dictionary <ControlTarget, string>()
            {
                { ControlTarget.Head, "Control head tracking" },
                { ControlTarget.Controller1, "Control VR controller #1" },
                { ControlTarget.Controller2, "Control VR controller #2" },
                { ControlTarget.Controller3, "Control VR controller #3" },
                { ControlTarget.Controller4, "Control VR controller #4" },
            };

            HeadRelations = new Dictionary <ControllerMode, string>()
            {
                { ControllerMode.Unrelated, "Unrelated to head pose" },
                { ControllerMode.SticksToHead, "Attach poses to head pose" },
                { ControllerMode.ThreeDof, "Remap 3->6 DOF" },
                { ControllerMode.StickyThreeDof, "Remap 3->6 DOF (sticky)" },
                { ControllerMode.IsInHeadSpace, "Treat poses as in head-space" },
            };

            //Status = new RelayCommand(CheckStatus);
            ResetAsync  = new RelayCommand(ResetAsyncRotation);
            Recenter    = new RelayCommand(RecenterView);
            Discover    = new RelayCommand(DiscoverExecute);
            CheckStatus = new RelayCommand(CheckStatusExecute);

            // Kill all active listeners, otherwise process won't quit
            Application.Current.Exit += (sender, args) => vridge?.Dispose();

            // Try connecting by default
            vridge = new VridgeRemote(
                "localhost",
                "Desktop-Tester",
                Capabilities.Controllers | Capabilities.HeadTracking);

            vridge.HapticPulse += OnHapticFeedbackReceived;
        }
Exemplo n.º 6
0
 public void SetControllerState(VridgeRemote vridge)
 {
     vridge.Controller.SetControllerState(
         ControllerId,
         HeadRelation,
         SuggestedHand,
         Orientation,
         Position,
         AnalogX,
         AnalogY,
         AnalogTrigger,
         IsMenuPressed,
         IsSystemPressed,
         IsTriggerPressed,
         IsGripPressed,
         IsTouchpadPressed,
         IsTouchpadTouched);
 }
Exemplo n.º 7
0
 public VridgeSocketReader(string portName, bool left)
 {
     m_ArduinoController = new ArduinoController(left);
     SerialportName      = portName;
     m_VridgeRemote      = new VridgeRemote("localhost", "OssCtrlR-Vridge", Capabilities.Controllers);
 }