Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral

About lawwong

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. VIU is dedicated on identifying controller model for connected controller device VRModule.GetDeviceState(ViveRole.GetDeviceIndex(HandRole.RightHand)).deviceModel This property should tell you which device is currently used public enum VRModuleDeviceModel { // ... OculusTouchLeft, // Oculus 1 OculusTouchRight, // Oculus 1 // ... ViveFocusChirp, // Focus Plus // ... OculusQuestOrRiftSControllerLeft, // Oculus 2 OculusQuestOrRiftSControllerRight, // Oculus 2 // ... WaveCRControllerLeft, // Focus 3 WaveCRControllerRight,
  2. Thanks for the feedback! Its seems to be a bug, will fix in next update. If need it, you can hot fix yourself by modifying following line https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/baacdbd76387574b16efc0a5bcc430eebb258e3f/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModule.cs#L334 into state.SetAxisValue(VRModuleRawAxis.TouchpadX, primary2DAxis.x); state.SetAxisValue(VRModuleRawAxis.TouchpadY, primary2DAxis.y); It seems odd but VRModuleRawAxis.TouchpadX/Y actually means "primary axis X/Y" now. (See how the field treated in ControllerS
  3. Hi @bella-1995, I'm guessing you get "raycastResults" from ViveRaycaster.SortedRaycastResults ? That means this property stores all raycast results and sorted by hit distance, hence index 0 result is the nearest. (Or just use ViveRaycaster.FirstRaycastResult() function) Default UGUI event, reticle and guideline all interact with only the first raycast result, you can do the same. Alternatively you can also implement your interaction logic within the event handlers. FYR., more details from Unity docs: https://docs.unity3d.com/Packages/com.unity.ugui@1.0
  4. Hi @AlGolden The unexpected behavior for you is caused by this: In our default setup in our prefab & example scene, RenderModelHook (visible controller model) will be switched off only if device is disconnected. ColliderEventCaster (invisible controller grabber) will be switched off if device is disconnected or lost tracking. So when your Rift controller or Vive controller lost tracking (but still connected), their model are still visible but the grabber is disabled (thus grabbed object is released). But for Focus Plus controller, its hard to lost its t
  5. Do you mean you want to rotate camera root around HMD? public static void RotateAroundHMD(Transform vrOrigin, Transform hmd, Quaternion rot) { vrOrigin.position = rot * (vrOrigin.position - hmd.position) + hmd.position; vrOrigin.rotation = rot * vrOrigin.rotation; } public static void OnSomeRightTurnEventOcurred() { // Turn right around Y axis for 45 degree RotateAroundHMD(vrOrigin, hmd, Quaternion.Euler(new Vector3(0f, 45f, 0f))); }
  6. Hi @FrancescoFontana About using Wave SDK via VIU, after you installed it into your project, first please make sure the Wave SDK support is enabled in the "Edit > Preferences > VIU Settings" configuration window. After that, you can take a look at the example scenes in HTC.UnityPlugin/ViveInputUtility/Examples folder. Briefly, the stereo camera is handled by the VIU script - VRCameraHook, so it can be crossed VR platforms.
  7. Its a historical issue... At first, ViveInput.GetPress only takes HandRole perameter. After the Role Binding Update, custom role enum is supported. I tried to add ViveInput.GetPress<TRole>(TRole role, ...) but the methods signature is ambiguous to ViveInput.GetPress(HandRole role, ...) because Unity was using older C# version. (template specialization only supported in newer C# version) It may not cause compile error if I just replace ViveInput.GetPress(HandRole role, ...) to ViveInput.GetPress<TRole>(TRole role, ...) but technically it changes the signature and also auto-comp
  8. Hi, Following sample should do the work. Also it's cross platform. using HTC.UnityPlugin.Vive;using UnityEngine;public class SwipeSample : MonoBehaviour, IViveRoleComponent{ [serializeField] private ViveRoleProperty m_viveRole = ViveRoleProperty.New(HandRole.RightHand); [serializeField] private float m_swipeThreshold = 0.75f; private Vector2 m_downAxis; public ViveRoleProperty viveRole { get { return m_viveRole; } } private void OnEnable() { ViveInput.AddListener(m_viveRole, ControllerButton.PadTouch, ButtonEventType.Down, OnPadDown); ViveInput.AddListe
  • Create New...