void HideFeedback(VRInputDevice.VRControl control) { ProxyFeedbackRequest request; if (m_FeedbackRequests.TryGetValue(control, out request)) { m_FeedbackRequests.Remove(control); this.RemoveFeedbackRequest(request); } }
void HideFeedback(VRInputDevice.VRControl control) { var key = (int)control; ProxyFeedbackRequest request; if (m_FeedbackRequests.TryGetValue(key, out request)) { m_FeedbackRequests.Remove(key); this.RemoveFeedbackRequest(request); } }
bool GetAxis(VRInputDevice.Handedness hand, VRInputDevice.VRControl axis, out float value) { switch (axis) { case VRInputDevice.VRControl.Trigger1: if (hand == VRInputDevice.Handedness.Left) { value = UnityEngine.Input.GetAxis("XRI_Left_Trigger"); } else { value = UnityEngine.Input.GetAxis("XRI_Right_Trigger"); } return(true); case VRInputDevice.VRControl.Trigger2: if (hand == VRInputDevice.Handedness.Left) { value = UnityEngine.Input.GetAxis("XRI_Left_Grip"); } else { value = UnityEngine.Input.GetAxis("XRI_Right_Grip"); } return(true); case VRInputDevice.VRControl.LeftStickX: if (hand == VRInputDevice.Handedness.Left) { value = UnityEngine.Input.GetAxis("XRI_Left_Primary2DAxis_Horizontal"); } else { value = UnityEngine.Input.GetAxis("XRI_Right_Primary2DAxis_Horizontal"); } return(true); case VRInputDevice.VRControl.LeftStickY: if (hand == VRInputDevice.Handedness.Left) { value = -1f * UnityEngine.Input.GetAxis("XRI_Left_Primary2DAxis_Vertical"); } else { value = -1f * UnityEngine.Input.GetAxis("XRI_Right_Primary2DAxis_Vertical"); } return(true); } value = 0f; return(false); }
private float GetAxis(OVRInput.Controller controller, VRInputDevice.VRControl axis) { switch (axis) { case VRInputDevice.VRControl.Trigger1: return(OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger, controller)); case VRInputDevice.VRControl.LeftStickX: return(OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick, controller).x); case VRInputDevice.VRControl.LeftStickY: return(OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick, controller).y); } return(0f); }
void ShowFeedback(VRInputDevice.VRControl control) { var key = (int)control; if (m_FeedbackRequests.ContainsKey(key)) { return; } var request = (ProxyFeedbackRequest)this.GetFeedbackRequestObject(typeof(ProxyFeedbackRequest)); request.control = control; request.node = node; request.duration = -1; m_FeedbackRequests[key] = request; this.AddFeedbackRequest(request); }
void ShowFeedback(VRInputDevice.VRControl control) { if (m_FeedbackRequests.ContainsKey(control)) { return; } var request = new ProxyFeedbackRequest { control = control, node = node, duration = -1 }; m_FeedbackRequests[control] = request; this.AddFeedbackRequest(request); }
private float GetAxis(int deviceIndex, VRInputDevice.VRControl axis) { var controller = SixenseInput.Controllers[deviceIndex]; if (controller != null) { switch (axis) { case VRInputDevice.VRControl.Trigger1: return(controller.Trigger); case VRInputDevice.VRControl.LeftStickX: return(controller.JoystickX); case VRInputDevice.VRControl.LeftStickY: return(controller.JoystickY); } } return(0f); }
protected override string GetButtonAxis(VRInputDevice.Handedness hand, VRInputDevice.VRControl button) { // For some reason primary/secondary are swapped in OpenVR switch (button) { case VRInputDevice.VRControl.Action1: if (hand == VRInputDevice.Handedness.Left) { return("XRI_Left_SecondaryButton"); } else { return("XRI_Right_SecondaryButton"); } case VRInputDevice.VRControl.Action2: if (hand == VRInputDevice.Handedness.Left) { return("XRI_Left_PrimaryButton"); } else { return("XRI_Right_PrimaryButton"); } case VRInputDevice.VRControl.LeftStickButton: if (hand == VRInputDevice.Handedness.Left) { return("XRI_Left_Primary2DAxisClick"); } else { return("XRI_Right_Primary2DAxisClick"); } } // Not all buttons are currently mapped return(null); }
protected virtual string GetButtonAxis(VRInputDevice.Handedness hand, VRInputDevice.VRControl button) { switch (button) { case VRInputDevice.VRControl.Action1: if (hand == VRInputDevice.Handedness.Left) { return("XRI_Left_PrimaryButton"); } else { return("XRI_Right_PrimaryButton"); } case VRInputDevice.VRControl.Action2: if (hand == VRInputDevice.Handedness.Left) { return("XRI_Left_SecondaryButton"); } else { return("XRI_Right_SecondaryButton"); } case VRInputDevice.VRControl.LeftStickButton: if (hand == VRInputDevice.Handedness.Left) { return("XRI_Left_Primary2DAxisClick"); } else { return("XRI_Right_Primary2DAxisClick"); } } // Not all buttons are currently mapped return(null); }
private bool GetAxis(OVRInput.Controller controller, VRInputDevice.VRControl axis, out float value) { switch (axis) { case VRInputDevice.VRControl.Trigger1: value = OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger, controller); return(true); case VRInputDevice.VRControl.Trigger2: value = OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger, controller); return(true); case VRInputDevice.VRControl.LeftStickX: value = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick, controller).x; return(true); case VRInputDevice.VRControl.LeftStickY: value = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick, controller).y; return(true); } value = 0f; return(false); }
public void UpdateValues(ProxyFeedbackRequest request) { m_Control = request.control; m_TooltipText = request.tooltipText; }