From ff7eefffdfb2f8c39671ded08a98e35ff0a73187 Mon Sep 17 00:00:00 2001 From: lawwong Date: Thu, 3 Mar 2022 15:16:49 +0800 Subject: [PATCH 01/14] Fix Grabbable with PoseFreezer calculate wrong pose when the object root is not at (0,0,0) --- .../ViveInputUtility/Scripts/Misc/GrabbableBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/GrabbableBase.cs b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/GrabbableBase.cs index e1021008..d4afcd89 100644 --- a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/GrabbableBase.cs +++ b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/GrabbableBase.cs @@ -383,7 +383,7 @@ protected override void OnGrabTransform() protected void GrabRigidbodyToPose(RigidPose targetPose) { - ModifyPose(ref targetPose, true); + ModifyPose(ref targetPose, false); RigidPose.SetRigidbodyVelocity(grabRigidbody, grabRigidbody.position, targetPose.pos, followingDuration); RigidPose.SetRigidbodyAngularVelocity(grabRigidbody, grabRigidbody.rotation, targetPose.rot, followingDuration, overrideMaxAngularVelocity); @@ -391,7 +391,7 @@ protected void GrabRigidbodyToPose(RigidPose targetPose) protected void GrabTransformToPose(RigidPose targetPose) { - ModifyPose(ref targetPose, true); + ModifyPose(ref targetPose, false); if (grabRigidbody != null) { From 0687dfe40b372d6ce46c53b8dccb5c13cb4bce46 Mon Sep 17 00:00:00 2001 From: ChengNan Yang Date: Wed, 9 Mar 2022 13:55:56 +0800 Subject: [PATCH 02/14] Update Wave pinch ray status * Check if pinch data state type is WVR_HandPoseType_Invalid --- .../VRModule/Submodules/WaveHandTrackingSubmodule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs index 2d3f42c6..405f21da 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs @@ -200,7 +200,7 @@ public static bool TryGetLeftPinchRay(out Vector3 origin, out Vector3 direction) Coordinate.GetVectorFromGL(pinch.pinch.origin, out origin); Coordinate.GetVectorFromGL(pinch.pinch.direction, out direction); - return true; + return pinch.state.type != WVR_HandPoseType.WVR_HandPoseType_Invalid; } public static bool TryGetRightPinchRay(out Vector3 origin, out Vector3 direction) @@ -217,7 +217,7 @@ public static bool TryGetRightPinchRay(out Vector3 origin, out Vector3 direction Coordinate.GetVectorFromGL(pinch.pinch.origin, out origin); Coordinate.GetVectorFromGL(pinch.pinch.direction, out direction); - return true; + return pinch.state.type != WVR_HandPoseType.WVR_HandPoseType_Invalid; } private enum FeatureActivity From b82d8367637ceab4405c2a49907c1ae940fedd74 Mon Sep 17 00:00:00 2001 From: ChengNan Yang Date: Tue, 22 Mar 2022 15:39:01 +0800 Subject: [PATCH 03/14] Fix Wave hand gesture cannot reset issue --- .../Submodules/WaveHandTrackingSubmodule.cs | 71 ++++++++----------- 1 file changed, 31 insertions(+), 40 deletions(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs index 405f21da..e1ce800f 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs @@ -74,10 +74,14 @@ protected override void OnUpdateDeviceConnectionAndPoses() trackingActivator.TryFetchData(WVR_PoseOriginModel.WVR_PoseOriginModel_OriginOnHead); } + var isFocused = Interop.WVR_IsInputFocusCapturedBySystem(); + var isLeftValid = !isFocused && (trackingActivator.isLeftValid || gestureActivator.isLeftValid); + var isRightValid = !isFocused && (trackingActivator.isRightValid || gestureActivator.isRightValid); + IVRModuleDeviceState prevState; IVRModuleDeviceStateRW currState; // update connection/pose for left hand devices - if (trackingActivator.isLeftValid) + if (isLeftValid) { if (leftDeviceIndex != VRModule.INVALID_DEVICE_INDEX) { @@ -97,7 +101,11 @@ protected override void OnUpdateDeviceConnectionAndPoses() } currState.isConnected = true; - trackingActivator.UpdateJoints(currState, true); + + if (trackingActivator.isLeftValid) + { + trackingActivator.UpdateJoints(currState, true); + } } else { @@ -109,7 +117,7 @@ protected override void OnUpdateDeviceConnectionAndPoses() } } - if (trackingActivator.isRightValid) + if (isRightValid) { if (rightDeviceIndex != VRModule.INVALID_DEVICE_INDEX) { @@ -129,7 +137,11 @@ protected override void OnUpdateDeviceConnectionAndPoses() } currState.isConnected = true; - trackingActivator.UpdateJoints(currState, false); + + if (trackingActivator.isRightValid) + { + trackingActivator.UpdateJoints(currState, false); + } } else { @@ -151,35 +163,13 @@ protected override void OnUpdateDeviceInput() IVRModuleDeviceState prevState; IVRModuleDeviceStateRW currState; - if (leftDeviceIndex != VRModule.INVALID_DEVICE_INDEX) - { - if (gestureActivator.isLeftValid) - { - EnsureValidDeviceState(leftDeviceIndex, out prevState, out currState); - gestureActivator.UpdateGestureInput(currState, true); - } - - if (trackingActivator.isLeftValid) - { - EnsureValidDeviceState(leftDeviceIndex, out prevState, out currState); - trackingActivator.UpdateDeviceInput(currState, true); - } - } + EnsureValidDeviceState(leftDeviceIndex, out prevState, out currState); + gestureActivator.UpdateDeviceInput(currState, true); + trackingActivator.UpdateDeviceInput(currState, true); - if (rightDeviceIndex != VRModule.INVALID_DEVICE_INDEX) - { - if (gestureActivator.isRightValid) - { - EnsureValidDeviceState(rightDeviceIndex, out prevState, out currState); - gestureActivator.UpdateGestureInput(currState, false); - } - - if (trackingActivator.isRightValid) - { - EnsureValidDeviceState(rightDeviceIndex, out prevState, out currState); - trackingActivator.UpdateDeviceInput(currState, false); - } - } + EnsureValidDeviceState(rightDeviceIndex, out prevState, out currState); + gestureActivator.UpdateDeviceInput(currState, false); + trackingActivator.UpdateDeviceInput(currState, false); } public override uint GetLeftHandedIndex() { return leftDeviceIndex; } @@ -492,9 +482,9 @@ public bool TryFetchData(WVR_PoseOriginModel originModel) return false; } - public bool isLeftValid { get { return trackingData.left.isValidPose && !Interop.WVR_IsInputFocusCapturedBySystem(); } } + public bool isLeftValid { get { return trackingData.left.isValidPose; } } - public bool isRightValid { get { return trackingData.right.isValidPose && !Interop.WVR_IsInputFocusCapturedBySystem(); } } + public bool isRightValid { get { return trackingData.right.isValidPose; } } public WVR_HandPoseState_t getLeftPinchData { get { return pinchData.left; } } @@ -787,20 +777,21 @@ public bool TryFetchData() return false; } - public void UpdateGestureInput(IVRModuleDeviceStateRW state, bool isLeft) + public void UpdateDeviceInput(IVRModuleDeviceStateRW state, bool isLeft) { var gesture = isLeft ? gestureData.left : gestureData.right; + state.SetButtonPress(VRModuleRawButton.GestureFist, gesture == WVR_HandGestureType.WVR_HandGestureType_Fist); - state.SetButtonPress(VRModuleRawButton.GestureFive, gesture == WVR_HandGestureType.WVR_HandGestureType_Five); - state.SetButtonPress(VRModuleRawButton.GestureIndexUp, gesture == WVR_HandGestureType.WVR_HandGestureType_IndexUp); - state.SetButtonPress(VRModuleRawButton.GestureOk, gesture == WVR_HandGestureType.WVR_HandGestureType_OK); - state.SetButtonPress(VRModuleRawButton.GestureThumbUp, gesture == WVR_HandGestureType.WVR_HandGestureType_ThumbUp); - state.SetButtonPress(VRModuleRawButton.System, gesture == WVR_HandGestureType_WVR_HandGestureType_Palm_Pinch); state.SetButtonTouch(VRModuleRawButton.GestureFist, gesture == WVR_HandGestureType.WVR_HandGestureType_Fist); + state.SetButtonPress(VRModuleRawButton.GestureFive, gesture == WVR_HandGestureType.WVR_HandGestureType_Five); state.SetButtonTouch(VRModuleRawButton.GestureFive, gesture == WVR_HandGestureType.WVR_HandGestureType_Five); + state.SetButtonPress(VRModuleRawButton.GestureIndexUp, gesture == WVR_HandGestureType.WVR_HandGestureType_IndexUp); state.SetButtonTouch(VRModuleRawButton.GestureIndexUp, gesture == WVR_HandGestureType.WVR_HandGestureType_IndexUp); + state.SetButtonPress(VRModuleRawButton.GestureOk, gesture == WVR_HandGestureType.WVR_HandGestureType_OK); state.SetButtonTouch(VRModuleRawButton.GestureOk, gesture == WVR_HandGestureType.WVR_HandGestureType_OK); + state.SetButtonPress(VRModuleRawButton.GestureThumbUp, gesture == WVR_HandGestureType.WVR_HandGestureType_ThumbUp); state.SetButtonTouch(VRModuleRawButton.GestureThumbUp, gesture == WVR_HandGestureType.WVR_HandGestureType_ThumbUp); + state.SetButtonPress(VRModuleRawButton.System, gesture == WVR_HandGestureType_WVR_HandGestureType_Palm_Pinch); state.SetButtonTouch(VRModuleRawButton.System, gesture == WVR_HandGestureType_WVR_HandGestureType_Palm_Pinch); } From 327c0a8a6e8be08c49fa8465c437b576492b9b58 Mon Sep 17 00:00:00 2001 From: lawwong Date: Tue, 22 Mar 2022 18:00:05 +0800 Subject: [PATCH 04/14] Now fetch Wave hand tracking & gesture at the same time --- .../Submodules/WaveHandTrackingSubmodule.cs | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs index e1ce800f..044ef085 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs @@ -64,6 +64,7 @@ protected override void OnDeactivated() protected override void OnUpdateDeviceConnectionAndPoses() { trackingActivator.SetActive(deviceFeature.supportTracking); + gestureActivator.SetActive(VRModuleSettings.enableWaveHandGesture && deviceFeature.supportGesture); if (VRModule.trackingSpaceType == VRModuleTrackingSpaceType.RoomScale) { @@ -74,6 +75,8 @@ protected override void OnUpdateDeviceConnectionAndPoses() trackingActivator.TryFetchData(WVR_PoseOriginModel.WVR_PoseOriginModel_OriginOnHead); } + gestureActivator.TryFetchData(); + var isFocused = Interop.WVR_IsInputFocusCapturedBySystem(); var isLeftValid = !isFocused && (trackingActivator.isLeftValid || gestureActivator.isLeftValid); var isRightValid = !isFocused && (trackingActivator.isRightValid || gestureActivator.isRightValid); @@ -105,6 +108,12 @@ protected override void OnUpdateDeviceConnectionAndPoses() if (trackingActivator.isLeftValid) { trackingActivator.UpdateJoints(currState, true); + trackingActivator.UpdateDeviceInput(currState, true); + } + + if (gestureActivator.isLeftValid) + { + gestureActivator.UpdateDeviceInput(currState, true); } } else @@ -141,6 +150,12 @@ protected override void OnUpdateDeviceConnectionAndPoses() if (trackingActivator.isRightValid) { trackingActivator.UpdateJoints(currState, false); + trackingActivator.UpdateDeviceInput(currState, false); + } + + if (gestureActivator.isRightValid) + { + gestureActivator.UpdateDeviceInput(currState, false); } } else @@ -154,24 +169,6 @@ protected override void OnUpdateDeviceConnectionAndPoses() } } - protected override void OnUpdateDeviceInput() - { - gestureActivator.SetActive(VRModuleSettings.enableWaveHandGesture && deviceFeature.supportGesture); - - gestureActivator.TryFetchData(); - - IVRModuleDeviceState prevState; - IVRModuleDeviceStateRW currState; - - EnsureValidDeviceState(leftDeviceIndex, out prevState, out currState); - gestureActivator.UpdateDeviceInput(currState, true); - trackingActivator.UpdateDeviceInput(currState, true); - - EnsureValidDeviceState(rightDeviceIndex, out prevState, out currState); - gestureActivator.UpdateDeviceInput(currState, false); - trackingActivator.UpdateDeviceInput(currState, false); - } - public override uint GetLeftHandedIndex() { return leftDeviceIndex; } public override uint GetRightHandedIndex() { return rightDeviceIndex; } From 12a633f83020958c4fd925f326f8d203d0013ece Mon Sep 17 00:00:00 2001 From: ChengNan Yang Date: Wed, 23 Mar 2022 18:15:39 +0800 Subject: [PATCH 05/14] Fix device input did not reset issue --- .../Submodules/WaveHandTrackingSubmodule.cs | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs index 044ef085..08777b65 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Submodules/WaveHandTrackingSubmodule.cs @@ -105,16 +105,9 @@ protected override void OnUpdateDeviceConnectionAndPoses() currState.isConnected = true; - if (trackingActivator.isLeftValid) - { - trackingActivator.UpdateJoints(currState, true); - trackingActivator.UpdateDeviceInput(currState, true); - } - - if (gestureActivator.isLeftValid) - { - gestureActivator.UpdateDeviceInput(currState, true); - } + trackingActivator.UpdateJoints(currState, true); + trackingActivator.UpdateDeviceInput(currState, true); + gestureActivator.UpdateDeviceInput(currState, true); } else { @@ -147,16 +140,9 @@ protected override void OnUpdateDeviceConnectionAndPoses() currState.isConnected = true; - if (trackingActivator.isRightValid) - { - trackingActivator.UpdateJoints(currState, false); - trackingActivator.UpdateDeviceInput(currState, false); - } - - if (gestureActivator.isRightValid) - { - gestureActivator.UpdateDeviceInput(currState, false); - } + trackingActivator.UpdateJoints(currState, false); + trackingActivator.UpdateDeviceInput(currState, false); + gestureActivator.UpdateDeviceInput(currState, false); } else { From 68b173ba3ce008ec713fcd7bdfe659e7ba57c023 Mon Sep 17 00:00:00 2001 From: Dario Laverde Date: Fri, 25 Mar 2022 15:04:25 -0400 Subject: [PATCH 06/14] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4be9090d..e03a043b 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The VIVE Input Utility (VIU) is a toolkit for developing VR experiences in Unity ## How Do I Use This? -[Read this step-by-step guide to using the Vive Input Utility for Unity.](https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/Example-0.Tutorial) +[Read this step-by-step guide to using the Vive Input Utility for Unity.](https://github.com/ViveSoftware/ViveInputUtility-Unity/wiki/Example-0.Tutorial) - also see [https://developer.vive.com] ## Requirements @@ -20,6 +20,9 @@ The VIVE Input Utility (VIU) is a toolkit for developing VR experiences in Unity - UI Pointer (EventSystem compatible) - Teleport - Object Grabbing/Throwing example +- Role Binding +- OpenXR Support +- cross platform hand tracking ## Supporting device @@ -37,6 +40,8 @@ Email: ViveSoftware@htc.com Repository: [GitHub](https://github.com/ViveSoftware/ViveInputUtility-Unity) +Forum: [https://forum.vive.com/forum/72-vive-input-utility/] + ## Contributing guidelines: 1. Read and agree the [CLA](https://github.com/ViveSoftware/ViveInputUtility-Unity/blob/master/CONTRIBUTING.md). From 577c279ecda433955dc4ab6859281e37b39295f7 Mon Sep 17 00:00:00 2001 From: lawwong Date: Wed, 20 Apr 2022 18:04:52 +0800 Subject: [PATCH 07/14] Add reservedDeviceIndex to main module --- Assets/HTC.UnityPlugin/VRModule/VRModuleBase.cs | 3 +++ .../HTC.UnityPlugin/VRModule/VRModuleManager.cs | 15 +++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/VRModuleBase.cs b/Assets/HTC.UnityPlugin/VRModule/VRModuleBase.cs index 904391b5..b66bb7cd 100644 --- a/Assets/HTC.UnityPlugin/VRModule/VRModuleBase.cs +++ b/Assets/HTC.UnityPlugin/VRModule/VRModuleBase.cs @@ -80,6 +80,9 @@ private struct WVRCtrlProfile public abstract int moduleIndex { get; } + // reserved device index, so any device index less then this will not be occupied by submodule + public virtual uint reservedDeviceIndex { get { return HMD_DEVICE_INDEX; } } + public virtual bool ShouldActiveModule() { return false; } public void Activated() diff --git a/Assets/HTC.UnityPlugin/VRModule/VRModuleManager.cs b/Assets/HTC.UnityPlugin/VRModule/VRModuleManager.cs index e7265020..83e68452 100644 --- a/Assets/HTC.UnityPlugin/VRModule/VRModuleManager.cs +++ b/Assets/HTC.UnityPlugin/VRModule/VRModuleManager.cs @@ -197,22 +197,21 @@ private void EnsureValidDeviceState(uint index, out IVRModuleDeviceState prevSta // this function will skip VRModule.HMD_DEVICE_INDEX (preserved index for HMD) private uint FindAndEnsureUnusedNotHMDDeviceState(out IVRModuleDeviceState prevState, out IVRModuleDeviceStateRW currState) { + var index = (m_activatedModuleBase == null ? VRModule.HMD_DEVICE_INDEX : m_activatedModuleBase.reservedDeviceIndex) + 1u; var len = GetDeviceStateLength(); - for (uint i = 0u, imax = len; i < imax; ++i) + for (; index < len; ++index) { - if (i == VRModule.HMD_DEVICE_INDEX) { continue; } - if (TryGetValidDeviceState(i, out prevState, out currState)) + if (TryGetValidDeviceState(index, out prevState, out currState)) { if (prevState.isConnected) { continue; } if (currState.isConnected) { continue; } + return index; } - - EnsureValidDeviceState(i, out prevState, out currState); - return i; + break; } - EnsureValidDeviceState(len, out prevState, out currState); - return len; + EnsureValidDeviceState(index, out prevState, out currState); + return index; } private void Update() From 0de89ddbb21ffe5a52b7e01e10491b8c4d808ee2 Mon Sep 17 00:00:00 2001 From: lawwong Date: Wed, 20 Apr 2022 18:14:19 +0800 Subject: [PATCH 08/14] Now UnityXRModule manage connected device without reseting device connection state --- .../VRModule/Modules/UnityXRModuleBase.cs | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModuleBase.cs b/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModuleBase.cs index 877cdc09..79844be2 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModuleBase.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModuleBase.cs @@ -88,6 +88,16 @@ private struct XRInputSubsystemProfile new WaveTrackerSubmodule() ); + private bool[] prevDeviceConnected = new bool[VRModule.MAX_DEVICE_COUNT]; + private bool[] currDeviceConnected = new bool[VRModule.MAX_DEVICE_COUNT]; + private void FlushDeviceConnectedState() + { + var temp = prevDeviceConnected; + prevDeviceConnected = currDeviceConnected; + currDeviceConnected = temp; + Array.Clear(currDeviceConnected, 0, (int)VRModule.MAX_DEVICE_COUNT); + } + protected VRModuleKnownXRLoader KnownActiveLoader { get { return knownActiveLoader; } } protected VRModuleKnownXRInputSubsystem KnownActiveInputSubsystem { get { return knownActiveInputSubsystem; } } @@ -219,26 +229,40 @@ public sealed override void BeforeRenderUpdate() currState.angularVelocity = GetDeviceFeatureValueOrDefault(device, CommonUsages.deviceAngularVelocity); } + currDeviceConnected[deviceIndex] = true; + // TODO: update hand skeleton pose } // unmap index for disconnected device state - deviceIndex = 0u; - for (var len = GetDeviceStateLength(); deviceIndex < len; ++deviceIndex) + for (uint i = 0u, imax = VRModule.MAX_DEVICE_COUNT; i < imax; ++i) { - if (indexMap.IsMapped(deviceIndex)) + if (prevDeviceConnected[i] && !currDeviceConnected[i]) { - EnsureValidDeviceState(deviceIndex, out prevState, out currState); - if (prevState.isConnected && !currState.isConnected) + if (indexMap.IsMapped(deviceIndex)) { indexMap.UnmapByIndex(deviceIndex); + } + else + { + Debug.LogWarning("[UnityXRModule] Disconnected device[" + deviceIndex + "] already unmapped"); + } + + if (TryGetValidDeviceState(deviceIndex, out prevState, out currState) && currState.isConnected) + { currState.Reset(); if (uxrRightIndex == deviceIndex) { uxrRightIndex = INVALID_DEVICE_INDEX; } if (uxrLeftIndex == deviceIndex) { uxrLeftIndex = INVALID_DEVICE_INDEX; } } + else + { + Debug.LogWarning("[UnityXRModule] Disconnected device[" + deviceIndex + "] already been reset"); + } } } + FlushDeviceConnectedState(); + submodules.UpdateModulesDeviceConnectionAndPoses(); // process hand role From 6f5e8ea3da9655931fb15ceee48f2497fde52c03 Mon Sep 17 00:00:00 2001 From: lawwong Date: Wed, 20 Apr 2022 18:14:49 +0800 Subject: [PATCH 09/14] Now OculusVRModule support submodule --- .../VRModule/Modules/OculusVRModule.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs b/Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs index 329fcaff..f57ff3ab 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Modules/OculusVRModule.cs @@ -264,6 +264,10 @@ private bool IsHand() private string m_systemHeadsetName; private OVRPlugin.TrackingOrigin m_prevTrackingSpace; + private VRModule.SubmoduleBase.Collection submodules = new VRModule.SubmoduleBase.Collection(); + + public override uint reservedDeviceIndex { get { return (uint)(s_index2node.Length - 1); } } + #if VIU_OCULUSVR_20_0_OR_NEWER private struct SkeletonData { @@ -366,12 +370,16 @@ public override bool ShouldActiveModule() return XRSettings.enabled && XRSettings.loadedDeviceName == "Oculus"; #endif #pragma warning restore 0162 + + submodules.ActivateAllModules(); } public override void OnActivated() { Debug.Log("OculusVRModule activated."); + submodules.DeactivateAllModules(); + m_systemHeadsetType = OVRPlugin.GetSystemHeadsetType(); m_systemHeadsetName = m_systemHeadsetType.ToString(); m_prevTrackingSpace = OVRPlugin.GetTrackingOriginType(); @@ -480,7 +488,7 @@ public override void BeforeRenderUpdate() { FlushDeviceState(); - for (uint i = 0u, imax = GetDeviceStateLength(); i < imax; ++i) + for (uint i = 0u, imax = (uint)s_index2node.Length; i < imax; ++i) { var node = s_index2node[i]; var deviceClass = s_index2class[i]; @@ -840,6 +848,10 @@ public override void BeforeRenderUpdate() //} } + submodules.UpdateAllModulesActivity(); + submodules.UpdateModulesDeviceConnectionAndPoses(); + submodules.UpdateModulesDeviceInput(); + ProcessConnectedDeviceChanged(); ProcessDevicePoseChanged(); ProcessDeviceInputChanged(); From ecededfdd42236a38128c0ac6c9021becc710969 Mon Sep 17 00:00:00 2001 From: lawwong Date: Tue, 26 Apr 2022 11:57:15 +0800 Subject: [PATCH 10/14] Fix field typo --- Assets/HTC.UnityPlugin/Pointer3D/Pointer3DEventData.cs | 4 +++- .../HTC.UnityPlugin/Pointer3D/Pointer3DInputModule.cs | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DEventData.cs b/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DEventData.cs index e9667f4e..15395e2e 100644 --- a/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DEventData.cs +++ b/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DEventData.cs @@ -66,7 +66,9 @@ public class Pointer3DEventData : PointerEventData public float pressDistance; public GameObject pressEnter; - public bool pressPrecessed; + public bool pressProcessed; + [System.Obsolete("Use pressProcessed instead.")] + public bool pressPrecessed { get { return pressProcessed; } set { pressProcessed = value; } } public Pointer3DEventData(Pointer3DRaycaster ownerRaycaster, EventSystem eventSystem) : base(eventSystem) { diff --git a/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DInputModule.cs b/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DInputModule.cs index 0e7023ba..50f2c182 100644 --- a/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DInputModule.cs +++ b/Assets/HTC.UnityPlugin/Pointer3D/Pointer3DInputModule.cs @@ -227,7 +227,7 @@ protected void CleanUpRaycaster(Pointer3DRaycaster raycaster) buttonEventData.Reset(); - if (buttonEventData.pressPrecessed) + if (buttonEventData.pressProcessed) { ProcessPressUp(buttonEventData); HandlePressExitAndEnter(buttonEventData, null); @@ -378,14 +378,14 @@ protected virtual void ProcessPress(Pointer3DEventData eventData) { if (eventData.GetPress()) { - if (!eventData.pressPrecessed) + if (!eventData.pressProcessed) { ProcessPressDown(eventData); } HandlePressExitAndEnter(eventData, eventData.pointerCurrentRaycast.gameObject); } - else if (eventData.pressPrecessed) + else if (eventData.pressProcessed) { ProcessPressUp(eventData); HandlePressExitAndEnter(eventData, null); @@ -396,7 +396,7 @@ protected void ProcessPressDown(Pointer3DEventData eventData) { var currentOverGo = eventData.pointerCurrentRaycast.gameObject; - eventData.pressPrecessed = true; + eventData.pressProcessed = true; eventData.eligibleForClick = true; eventData.delta = Vector2.zero; eventData.dragging = false; @@ -473,7 +473,7 @@ protected void ProcessPressUp(Pointer3DEventData eventData) ExecuteEvents.ExecuteHierarchy(currentOverGo, eventData, ExecuteEvents.dropHandler); } - eventData.pressPrecessed = false; + eventData.pressProcessed = false; eventData.eligibleForClick = false; eventData.pointerPress = null; eventData.rawPointerPress = null; From 035b56ce4c46562640c82e5f7c27fc65d65fb2e6 Mon Sep 17 00:00:00 2001 From: lawwong Date: Tue, 26 Apr 2022 12:07:01 +0800 Subject: [PATCH 11/14] Now WristTracker button mapping to ApplicationMenu/B --- Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModule.cs b/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModule.cs index 15bfd5fa..edfe4f7e 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModule.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Modules/UnityXRModule.cs @@ -603,7 +603,7 @@ private void UpdateViveWristTrackerState(IVRModuleDeviceStateRW state, InputDevi bool primaryButton = GetDeviceFeatureValueOrDefault(device, CommonUsages.primaryButton); bool menuButton = GetDeviceFeatureValueOrDefault(device, CommonUsages.menuButton); - state.SetButtonPress(VRModuleRawButton.A, primaryButton); + state.SetButtonPress(VRModuleRawButton.ApplicationMenu, primaryButton); state.SetButtonPress(VRModuleRawButton.System, menuButton); } From d31f1947b5c71918eaa3a074c2570f7a42ee8744 Mon Sep 17 00:00:00 2001 From: lawwong Date: Tue, 26 Apr 2022 15:08:08 +0800 Subject: [PATCH 12/14] Remove Graphic Jobs recommanded settings for Wave According to Unity document, Graphics Jobs only supported on certain environment(Vulkan) on Android. --- .../Editor/VRPlatformSettings/WaveVRSettings.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VRPlatformSettings/WaveVRSettings.cs b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VRPlatformSettings/WaveVRSettings.cs index e4fa73e6..02140bd5 100644 --- a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VRPlatformSettings/WaveVRSettings.cs +++ b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Editor/VRPlatformSettings/WaveVRSettings.cs @@ -47,17 +47,6 @@ public WaveVRRecommendedSettings() #endif recommendedValue = true, }); - -#if UNITY_5_4_OR_NEWER - Add(new VIUVersionCheck.RecommendedSetting() - { - settingTitle = "Graphic Jobs", - skipCheckFunc = () => !VIUSettingsEditor.supportWaveVR, - currentValueFunc = () => PlayerSettings.graphicsJobs, - setValueFunc = v => PlayerSettings.graphicsJobs = v, - recommendedValue = true, - }); -#endif } } From 2bf5628b690f9f10b7fac1efc425cd703a24761c Mon Sep 17 00:00:00 2001 From: lawwong Date: Tue, 26 Apr 2022 15:25:00 +0800 Subject: [PATCH 13/14] Add bindings for Vive Focus 3 Tracker Required when using Focus 3 Tracker with Vive Busniss Streaming --- .../PartialInputBindings/actions.json | 4 + .../bindings_vive_focus3_tracker.json | 729 ++++++++++++++++++ .../bindings_vive_focus3_tracker.json.meta | 7 + .../bindings_vive_tracker.json | 466 ++++++++++- 4 files changed, 1193 insertions(+), 13 deletions(-) create mode 100644 Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json create mode 100644 Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json.meta diff --git a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/actions.json b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/actions.json index ccd88453..d2d4be27 100644 --- a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/actions.json +++ b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/actions.json @@ -321,6 +321,10 @@ { "controller_type": "vive_tracker_keyboard", "binding_url": "bindings_vive_tracker_keyboard.json" + }, + { + "controller_type": "vive_focus3_tracker", + "binding_url": "bindings_vive_focus3_tracker.json" } ], "localization": [ diff --git a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json new file mode 100644 index 00000000..c33516f7 --- /dev/null +++ b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json @@ -0,0 +1,729 @@ +{ + "controller_type": "vive_focus3_tracker", + "bindings": { + "/actions/htc_viu": { + "sources": [ + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/hand/left/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/hand/right/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/foot/left/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/foot/right/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/camera/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/chest/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/keyboard/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/waist/input/system" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/hand/left/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/hand/right/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/foot/left/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/foot/right/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/camera/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/chest/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/keyboard/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/waist/input/y" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/hand/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/hand/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/foot/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/foot/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/camera/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/chest/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/keyboard/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_02" + } + }, + "mode": "button", + "path": "/user/waist/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/hand/left/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/hand/right/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/foot/left/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/foot/right/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/camera/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/chest/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/keyboard/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_07" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_07" + } + }, + "mode": "button", + "path": "/user/waist/input/x" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/foot/left/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/foot/right/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/camera/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/chest/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/keyboard/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_0xy" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_32" + } + }, + "mode": "button", + "path": "/user/waist/input/trackpad" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/foot/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/foot/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/camera/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/chest/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/keyboard/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + }, + "position": { + "output": "/actions/htc_viu/in/viu_axis_1x" + }, + "touch": { + "output": "/actions/htc_viu/in/viu_touch_33" + } + }, + "mode": "button", + "path": "/user/waist/input/trigger" + } + ] + } + } +} \ No newline at end of file diff --git a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json.meta b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json.meta new file mode 100644 index 00000000..077c5ca1 --- /dev/null +++ b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_focus3_tracker.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 830116ef6e30ed740b14650a377d6652 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_tracker.json b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_tracker.json index 83e265b9..6d2ec18a 100644 --- a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_tracker.json +++ b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/Misc/SteamVRExtension/PartialInputBindings/bindings_vive_tracker.json @@ -12,7 +12,7 @@ "mode": "button", "path": "/user/hand/left/input/power" }, - { + { "inputs": { "click": { "output": "/actions/htc_viu/in/viu_press_00" @@ -24,38 +24,74 @@ { "inputs": { "click": { - "output": "/actions/htc_viu/in/viu_press_33" + "output": "/actions/htc_viu/in/viu_press_00" } }, "mode": "button", - "path": "/user/hand/left/input/trigger" + "path": "/user/foot/left/input/power" }, - { + { "inputs": { "click": { - "output": "/actions/htc_viu/in/viu_press_33" + "output": "/actions/htc_viu/in/viu_press_00" } }, "mode": "button", - "path": "/user/hand/right/input/trigger" + "path": "/user/foot/right/input/power" }, { "inputs": { "click": { - "output": "/actions/htc_viu/in/viu_press_02" + "output": "/actions/htc_viu/in/viu_press_00" } }, "mode": "button", - "path": "/user/hand/left/input/grip" + "path": "/user/shoulder/left/input/power" }, - { + { "inputs": { "click": { - "output": "/actions/htc_viu/in/viu_press_02" + "output": "/actions/htc_viu/in/viu_press_00" } }, "mode": "button", - "path": "/user/hand/right/input/grip" + "path": "/user/shoulder/right/input/power" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/camera/input/power" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/chest/input/power" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/keyboard/input/power" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_00" + } + }, + "mode": "button", + "path": "/user/waist/input/power" }, { "inputs": { @@ -66,7 +102,7 @@ "mode": "button", "path": "/user/hand/left/input/application_menu" }, - { + { "inputs": { "click": { "output": "/actions/htc_viu/in/viu_press_01" @@ -75,6 +111,168 @@ "mode": "button", "path": "/user/hand/right/input/application_menu" }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/foot/left/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/foot/right/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/camera/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/chest/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/keyboard/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_01" + } + }, + "mode": "button", + "path": "/user/waist/input/application_menu" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/hand/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/hand/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/foot/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/foot/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/camera/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/chest/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/keyboard/input/grip" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_02" + } + }, + "mode": "button", + "path": "/user/waist/input/grip" + }, { "inputs": { "click": { @@ -84,7 +282,7 @@ "mode": "button", "path": "/user/hand/left/input/thumb" }, - { + { "inputs": { "click": { "output": "/actions/htc_viu/in/viu_press_32" @@ -92,6 +290,168 @@ }, "mode": "button", "path": "/user/hand/right/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/foot/left/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/foot/right/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/camera/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/chest/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/keyboard/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_32" + } + }, + "mode": "button", + "path": "/user/waist/input/thumb" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/hand/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/hand/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/foot/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/foot/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/shoulder/left/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/shoulder/right/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/camera/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/chest/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/keyboard/input/trigger" + }, + { + "inputs": { + "click": { + "output": "/actions/htc_viu/in/viu_press_33" + } + }, + "mode": "button", + "path": "/user/waist/input/trigger" } ], "haptics": [ @@ -102,6 +462,38 @@ { "output": "/actions/htc_viu/out/viu_vib_01", "path": "/user/hand/right/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/foot/left/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/foot/right/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/shoulder/left/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/shoulder/right/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/camera/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/chest/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/keyboard/output/haptic" + }, + { + "output": "/actions/htc_viu/out/viu_vib_01", + "path": "/user/waist/output/haptic" } ], "skeleton": [ @@ -109,9 +501,57 @@ "output": "/actions/htc_viu/in/viu_skeleton_left", "path": "/user/hand/left/input/skeleton/left" }, + { + "output": "/actions/htc_viu/in/viu_skeleton_left", + "path": "/user/foot/left/input/skeleton/left" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_left", + "path": "/user/shoulder/left/input/skeleton/left" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_left", + "path": "/user/camera/input/skeleton/left" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_left", + "path": "/user/chest/input/skeleton/left" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_left", + "path": "/user/keyboard/input/skeleton/left" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_left", + "path": "/user/waist/input/skeleton/left" + }, { "output": "/actions/htc_viu/in/viu_skeleton_right", "path": "/user/hand/right/input/skeleton/right" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_right", + "path": "/user/foot/right/input/skeleton/right" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_right", + "path": "/user/shoulder/right/input/skeleton/right" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_right", + "path": "/user/camera/input/skeleton/right" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_right", + "path": "/user/chest/input/skeleton/right" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_right", + "path": "/user/keyboard/input/skeleton/right" + }, + { + "output": "/actions/htc_viu/in/viu_skeleton_right", + "path": "/user/waist/input/skeleton/right" } ] } From c908c5233a46672c954436e680f1852ea3092741 Mon Sep 17 00:00:00 2001 From: lawwong Date: Tue, 26 Apr 2022 18:57:48 +0800 Subject: [PATCH 14/14] Update version code to v1.17.0 --- Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/VIUVersion.cs | 2 +- Assets/HTC.UnityPlugin/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/VIUVersion.cs b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/VIUVersion.cs index e872a8d3..41a7e188 100644 --- a/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/VIUVersion.cs +++ b/Assets/HTC.UnityPlugin/ViveInputUtility/Scripts/VIUVersion.cs @@ -6,6 +6,6 @@ namespace HTC.UnityPlugin.Vive { public static class VIUVersion { - public static readonly Version current = new Version("1.16.0.0"); + public static readonly Version current = new Version("1.17.0.0"); } } \ No newline at end of file diff --git a/Assets/HTC.UnityPlugin/package.json b/Assets/HTC.UnityPlugin/package.json index daabab25..df21ce1f 100644 --- a/Assets/HTC.UnityPlugin/package.json +++ b/Assets/HTC.UnityPlugin/package.json @@ -1,6 +1,6 @@ { "name": "com.htc.upm.vive-input-utility", - "version": "1.16.0", + "version": "1.17.0", "displayName": "VIVE Input Utility", "description": "The VIVE Input Utility (VIU) is a toolkit for developing VR experiences in Unity, especially with the VIVE/VIVE Pro but also targeting many platforms from a common code base including Oculus Rift, Rift S Go, Quest, Google Daydream, VIVE Wave SDK (e.g. VIVE Focus standalone) and additional VR platforms as supported by Unity such as Microsoft's 'Mixed Reality' VR headsets and more.\n\nCompatible with SteamVR 2.4.0+ and Oculus Integration 16.0+.\n\nView license:\nhttps://github.com/ViveSoftware/ViveInputUtility-Unity/blob/develop/LICENSE.md", "keywords": [