Example #1
0
 /// <summary>
 /// Returns time of the last frame that user pressed down the button on the controller identified by role
 /// </summary>
 public static float LastPressDownTime(HandRole role, ControllerButton button)
 {
     return(LastPressDownTimeEx(role, button));
 }
 /// <summary>
 /// Remove press down handler for the button on the controller identified by role
 /// </summary>
 public static void RemovePressDown(HandRole role, ControllerButton button, Action callback)
 {
     RemoveListenerEx(role, button, ButtonEventType.Down, callback);
 }
 /// <summary>
 /// Trigger vibration of the controller identified by role
 /// </summary>
 public static void TriggerHapticPulse(HandRole role, ushort durationMicroSec = 500)
 {
     TriggerHapticPulseEx(role, durationMicroSec);
 }
 public static Vector2 GetPadTouchVector(HandRole role)
 {
     return(GetPadTouchVectorEx(role));
 }
 public static Vector2 GetScrollDelta(HandRole role, ScrollType scrollType, Vector2 scale, ControllerAxis xAxis = ControllerAxis.PadX, ControllerAxis yAxis = ControllerAxis.PadY)
 {
     return(GetScrollDeltaEx(role, scrollType, scale, xAxis, yAxis));
 }
 public ViveColliderTriggerValueEventData(IColliderEventCaster eventCaster, HandRole hand, int axisId = 0) : base(eventCaster, Dim.d1, axisId)
 {
     this.hand = hand;
 }
Example #7
0
 private void OnButtonDown(HandRole device)
 {
     ControllerManager.instance.RegisterPullPush(device, ChangeScene);
 }
Example #8
0
 public static Vector2 GetPadPressVector(HandRole role)
 {
     return(GetPadPressVectorEx(role));
 }
 public static Vector3 GetAngularVelocity(HandRole role, Transform origin = null)
 {
     return(GetAngularVelocity(ViveRole.GetDeviceIndexEx(role), origin));
 }
Example #10
0
 /// <summary>
 /// Returns raw analog value of the touch pad  on the controller identified by role
 /// </summary>
 public static Vector2 GetPadAxis(HandRole role, bool usePrevState = false)
 {
     return(GetPadAxisEx(role, usePrevState));
 }
Example #11
0
 /// <summary>
 /// Returns raw analog value of the touch pad on the controller identified by role if touched,
 /// otherwise, returns Vector2.zero
 /// </summary>
 public static Vector2 GetPadTouchAxis(HandRole role)
 {
     return(GetPadTouchAxisEx(role));
 }
Example #12
0
 /// <summary>
 /// Returns raw analog value of the trigger button on the controller identified by role
 /// </summary>
 public static float GetTriggerValue(HandRole role, bool usePrevState = false)
 {
     return(GetTriggerValueEx(role, usePrevState));
 }
Example #13
0
 public static float GetAxis(HandRole role, ControllerAxis axis, bool usePrevState = false)
 {
     return(GetAxisEx(role, axis, usePrevState));
 }
Example #14
0
 /// <summary>
 /// Return amount of clicks in a row for the button on the controller identified by role
 /// Set ViveInput.clickInterval to configure click interval
 /// </summary>
 public static int ClickCount(HandRole role, ControllerButton button)
 {
     return(ClickCountEx(role, button));
 }
Example #15
0
 /// <summary>
 /// Returns device index of the device identified by the role
 /// Returns OpenVR.k_unTrackedDeviceIndexInvalid if the role doesn't assign to any device
 /// </summary>
 /// <returns>Current device index assigned to the role, should be tested by ViveRole.IsValidIndex before using it</returns>
 public static uint GetDeviceIndex(HandRole role)
 {
     return(GetDeviceIndex(role.ToDeviceRole()));
 }
 /// <summary>
 /// Returns tracking pose of the device identified by role
 /// </summary>
 public static RigidPose GetPose(HandRole role, Transform origin = null)
 {
     return(GetPose(ViveRole.GetDeviceIndexEx(role), origin));
 }
 public ViveColliderButtonEventData(IColliderEventCaster eventCaster, HandRole hand, ControllerButton viveButton, int buttonId = 0) : base(eventCaster, buttonId)
 {
     this.hand       = hand;
     this.viveButton = viveButton;
 }
 /// <summary>
 /// Set target pose to tracking pose of the device identified by role relative to the origin
 /// </summary>
 public static void SetPose(Transform target, HandRole role, Transform origin = null)
 {
     SetPose(target, ViveRole.GetDeviceIndexEx(role), origin);
 }
 public ViveColliderPadAxisEventData(IColliderEventCaster eventCaster, HandRole hand, int axisId = 0) : base(eventCaster, Dim.d2, axisId)
 {
     this.hand = hand;
 }
 /// <summary>
 /// Returns true if the device identified by role is connected.
 /// </summary>
 public static bool IsConnected(HandRole role)
 {
     return(IsConnected(ViveRole.GetDeviceIndexEx(role)));
 }
Example #21
0
 /// <summary>
 /// Returns device index of the device identified by the role
 /// Returns INVALID_DEVICE_INDEX if the role doesn't assign to any device
 /// </summary>
 /// <returns>Current device index assigned to the role, should be tested by ViveRole.IsValidIndex before using it</returns>
 public static uint GetDeviceIndex(HandRole role)
 {
     return GetDeviceIndexEx(role);
 }
 /// <summary>
 /// Returns true if tracking data of the device identified by role has valid value.
 /// </summary>
 public static bool HasTracking(HandRole role)
 {
     return(HasTracking(ViveRole.GetDeviceIndexEx(role)));
 }
 public static Vector2 GetPadTouchDelta(HandRole role)
 {
     return(GetPadTouchDeltaEx(role));
 }
 public static bool IsOutOfRange(HandRole role)
 {
     return(IsOutOfRange(ViveRole.GetDeviceIndexEx(role)));
 }
 /// <summary>
 /// Add press up handler for the button on the controller identified by role
 /// </summary>
 public static void AddPressUp(HandRole role, ControllerButton button, Action callback)
 {
     AddListenerEx(role, button, ButtonEventType.Up, callback);
 }
 public static bool IsCalibrating(HandRole role)
 {
     return(IsCalibrating(ViveRole.GetDeviceIndexEx(role)));
 }
 /// <summary>
 /// Remove click handler for the button on the controller identified by role
 /// </summary>
 public static void RemoveClick(HandRole role, ControllerButton button, Action callback)
 {
     RemoveListenerEx(role, button, ButtonEventType.Click, callback);
 }
 public static bool IsUninitialized(HandRole role)
 {
     return(IsUninitialized(ViveRole.GetDeviceIndexEx(role)));
 }
 /// <summary>
 /// Returns true while the button on the controller identified by role is held down
 /// </summary>
 public static bool GetPress(HandRole role, ControllerButton button)
 {
     return(GetPressEx(role, button));
 }
Example #30
0
 /// <summary>
 /// Trigger vibration of the controller identified by role
 /// </summary>
 public static void TriggerHapticVibration(HandRole role, float durationSeconds = 0.01f, float frequency = 85f, float amplitude = 0.125f, float startSecondsFromNow = 0f)
 {
     TriggerHapticVibrationEx(role, durationSeconds, frequency, amplitude, startSecondsFromNow);
 }