From a1a7a2f46afeda58ff0ed08fbca40512fc33ff3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Mon, 14 Dec 2020 16:30:40 +0100 Subject: [PATCH 01/11] Add grip pose to default mappings --- .../Runtime/Providers/Controllers/BaseOculusController.cs | 5 +++-- .../Runtime/Providers/Controllers/OculusTouchController.cs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs index 4e73279..2e9bab2 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs @@ -76,6 +76,7 @@ protected BaseOculusController(IMixedRealityControllerDataProvider controllerDat new MixedRealityInteractionMapping("Button.DpadLeft Press", AxisType.Digital, "DpadLeft", DeviceInputType.ThumbStickPress), new MixedRealityInteractionMapping("Button.DpadRight Press", AxisType.Digital, "DpadRight", DeviceInputType.ThumbStickPress), new MixedRealityInteractionMapping("Button.RTouchpad", AxisType.Digital, "RTouchpad", DeviceInputType.ThumbTouch), + new MixedRealityInteractionMapping("Grip Pose", AxisType.SixDof, DeviceInputType.SpatialGrip) }; /// @@ -307,7 +308,7 @@ private void UpdateButtonDataTouch(MixedRealityInteractionMapping interactionMap ((OculusApi.RawTouch)previousState.Touches & interactionButton) != 0) { interactionMapping.BoolData = false; - } + } } } @@ -327,7 +328,7 @@ private void UpdateButtonDataNearTouch(MixedRealityInteractionMapping interactio ((OculusApi.RawNearTouch)previousState.NearTouches & interactionButton) != 0) { interactionMapping.BoolData = false; - } + } } } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs index ef022bb..9065e3e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs @@ -43,7 +43,8 @@ public OculusTouchController(IMixedRealityControllerDataProvider controllerDataP new MixedRealityInteractionMapping("Button.Four Touch", AxisType.Digital, "Y", DeviceInputType.ButtonTouch), new MixedRealityInteractionMapping("Axis2D.PrimaryThumbRest", AxisType.DualAxis, "LTouchpad", DeviceInputType.ThumbStick), new MixedRealityInteractionMapping("Touch.PrimaryThumbRest Touch", AxisType.Digital, "LThumbRest", DeviceInputType.ThumbTouch), - new MixedRealityInteractionMapping("Touch.PrimaryThumbRest Near Touch", AxisType.Digital, "LThumbRest", DeviceInputType.ThumbNearTouch) + new MixedRealityInteractionMapping("Touch.PrimaryThumbRest Near Touch", AxisType.Digital, "LThumbRest", DeviceInputType.ThumbNearTouch), + new MixedRealityInteractionMapping("Grip Pose", AxisType.SixDof, DeviceInputType.SpatialGrip) }; /// @@ -66,7 +67,8 @@ public OculusTouchController(IMixedRealityControllerDataProvider controllerDataP new MixedRealityInteractionMapping("Button.Two Touch", AxisType.Digital, "B", DeviceInputType.ButtonTouch), new MixedRealityInteractionMapping("Axis2D.SecondaryThumbRest", AxisType.DualAxis, "RTouchpad", DeviceInputType.ThumbStick), new MixedRealityInteractionMapping("Touch.SecondaryThumbRest Touch", AxisType.Digital, "RThumbRest", DeviceInputType.ThumbTouch), - new MixedRealityInteractionMapping("Touch.SecondaryThumbRest Near Touch", AxisType.Digital, "RThumbRest", DeviceInputType.ThumbNearTouch) + new MixedRealityInteractionMapping("Touch.SecondaryThumbRest Near Touch", AxisType.Digital, "RThumbRest", DeviceInputType.ThumbNearTouch), + new MixedRealityInteractionMapping("Grip Pose", AxisType.SixDof, DeviceInputType.SpatialGrip) }; } } \ No newline at end of file From 44fa764c79b3ad2d7e2476e98dd106ba0fa5fcaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Mon, 14 Dec 2020 16:48:50 +0100 Subject: [PATCH 02/11] Add grip pose profile --- ...uchGripPoseInteractionMappingProfile.asset | 30 +++++++++++++++++++ ...ipPoseInteractionMappingProfile.asset.meta | 8 +++++ ...uchGripPoseInteractionMappingProfile.asset | 30 +++++++++++++++++++ ...ipPoseInteractionMappingProfile.asset.meta | 8 +++++ 4 files changed, 76 insertions(+) create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset.meta create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset new file mode 100644 index 0000000..0e7d595 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e3fb79524faca40478c0844c24e542f7, type: 3} + m_Name: LeftOculusHandGripPoseInteractionMappingProfile + m_EditorClassIdentifier: + interactionMapping: + description: Grip Pose + stateChangeType: 0 + axisType: 7 + inputType: 14 + inputAction: + profileGuid: 399335ccc89c4d12b79f3539ca7771db + id: 3 + description: Grip Pose + axisConstraint: 7 + keyCode: 0 + inputName: + axisCodeX: + axisCodeY: + inputProcessors: [] + pointerProfiles: [] diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset.meta new file mode 100644 index 0000000..4661fac --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 44d1dac04942dba44ab0f01ee529dec8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset new file mode 100644 index 0000000..3e1122c --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset @@ -0,0 +1,30 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e3fb79524faca40478c0844c24e542f7, type: 3} + m_Name: RightOculusHandGripPoseInteractionMappingProfile + m_EditorClassIdentifier: + interactionMapping: + description: Grip Pose + stateChangeType: 0 + axisType: 7 + inputType: 14 + inputAction: + profileGuid: 399335ccc89c4d12b79f3539ca7771db + id: 3 + description: Grip Pose + axisConstraint: 7 + keyCode: 0 + inputName: + axisCodeX: + axisCodeY: + inputProcessors: [] + pointerProfiles: [] diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset.meta new file mode 100644 index 0000000..f1d5698 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6bdb400e6c8fb154c973f1e2577f9b24 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 6ec38e947e96bfb38d00547b2148ab92e375e3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Mon, 14 Dec 2020 16:59:02 +0100 Subject: [PATCH 03/11] Assign grop pose mapping --- .../Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset | 2 +- .../LeftOculusTouchControllerProfile.asset | 1 + .../RightOculusTouchGripPoseInteractionMappingProfile.asset | 2 +- .../RightOculusTouchControllerProfile.asset | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset index 0e7d595..e6012ae 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/LeftOculusTouchGripPoseInteractionMappingProfile.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: e3fb79524faca40478c0844c24e542f7, type: 3} - m_Name: LeftOculusHandGripPoseInteractionMappingProfile + m_Name: LeftOculusTouchGripPoseInteractionMappingProfile m_EditorClassIdentifier: interactionMapping: description: Grip Pose diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/LeftOculusTouchControllerProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/LeftOculusTouchControllerProfile.asset index 21f74ed..344fd00 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/LeftOculusTouchControllerProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/LeftOculusTouchControllerProfile.asset @@ -38,3 +38,4 @@ MonoBehaviour: - {fileID: 11400000, guid: fb9b971cf238bb4449528a3b93906c0a, type: 2} - {fileID: 11400000, guid: a28ef8a54b31cd7429a330d53d37bda4, type: 2} - {fileID: 11400000, guid: 4c2c7b74b24b9d946af40c80ee0d0e9a, type: 2} + - {fileID: 11400000, guid: 44d1dac04942dba44ab0f01ee529dec8, type: 2} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset index 3e1122c..f29e9d8 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/RightOculusTouchGripPoseInteractionMappingProfile.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: e3fb79524faca40478c0844c24e542f7, type: 3} - m_Name: RightOculusHandGripPoseInteractionMappingProfile + m_Name: RightOculusTouchGripPoseInteractionMappingProfile m_EditorClassIdentifier: interactionMapping: description: Grip Pose diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/RightOculusTouchControllerProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/RightOculusTouchControllerProfile.asset index 48f1f6b..a4f9411 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/RightOculusTouchControllerProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/RightOculusTouchControllerProfile.asset @@ -37,3 +37,4 @@ MonoBehaviour: - {fileID: 11400000, guid: dd3b05d4a1ecb1a4fb8223e48a0e2cd5, type: 2} - {fileID: 11400000, guid: 8d874651626c3ec468f4807dc53538b0, type: 2} - {fileID: 11400000, guid: a29c31e27b6a4dd478d0baffe9c452bf, type: 2} + - {fileID: 11400000, guid: 6bdb400e6c8fb154c973f1e2577f9b24, type: 2} From 64c8beb099f3ce0669fcea52dadd064a6d1e90aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Mon, 14 Dec 2020 17:16:32 +0100 Subject: [PATCH 04/11] Implement raising Grip Pose in BaseOculusController --- .../Providers/Controllers/BaseOculusController.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs index 2e9bab2..66f79cd 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs @@ -143,6 +143,9 @@ public override void UpdateController() case DeviceInputType.Touchpad: UpdateDualAxisData(interactionMapping); break; + case DeviceInputType.SpatialGrip: + UpdateSpatialGripData(interactionMapping); + break; default: Debug.LogError($"Input [{interactionMapping.InputType}] is not handled for this controller [{GetType().Name}]"); break; @@ -369,6 +372,12 @@ private void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMapp interactionMapping.FloatData = singleAxisValue; } + private void UpdateSpatialGripData(MixedRealityInteractionMapping interactionMapping) + { + Debug.Assert(interactionMapping.AxisType == AxisType.SixDof); + interactionMapping.PoseData = currentControllerPose; + } + private void UpdateDualAxisData(MixedRealityInteractionMapping interactionMapping) { Debug.Assert(interactionMapping.AxisType == AxisType.DualAxis); From 6478ef2ac1c6ec0ecc42c10e4fbb92c15ba95094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Tue, 15 Dec 2020 10:51:10 +0100 Subject: [PATCH 05/11] Add grip pose offset --- .../Providers/Controllers/BaseOculusController.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs index 66f79cd..2d07e14 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs @@ -28,6 +28,13 @@ protected BaseOculusController(IMixedRealityControllerDataProvider controllerDat NodeType = nodeType; } + /// + /// Local offset from the controller position defining where the grip pose is. + /// The grip pose may be used to attach things to the controller when grabbing objects. + /// + private readonly MixedRealityPose gripPoseOffset = new + MixedRealityPose(new Vector3(0f, 0f, .03f), Quaternion.Euler(0f, 90f, 0f)); + /// /// The Oculus Node Type. /// @@ -375,7 +382,9 @@ private void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMapp private void UpdateSpatialGripData(MixedRealityInteractionMapping interactionMapping) { Debug.Assert(interactionMapping.AxisType == AxisType.SixDof); - interactionMapping.PoseData = currentControllerPose; + interactionMapping.PoseData = new MixedRealityPose( + currentControllerPose.Position + gripPoseOffset.Position, + Quaternion.Euler(currentControllerPose.Rotation.eulerAngles + gripPoseOffset.Rotation.eulerAngles)); } private void UpdateDualAxisData(MixedRealityInteractionMapping interactionMapping) From 5838eafc9a7648db734d1d103858dd6a94403ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Tue, 15 Dec 2020 21:58:24 +0100 Subject: [PATCH 06/11] Set oculus controller grip input action defaults --- .../LeftOculusHandGripInteractionMappingProfile.asset | 2 +- .../RightOculusHandGripInteractionMappingProfile.asset | 2 +- .../Left/Axis1D.PrimaryHandTriggerPressProfile.asset | 8 ++++---- .../Left/Axis1D.PrimaryHandTriggerProfile.asset | 2 +- .../Right/Axis1D.SecondaryHandTriggerPressProfile.asset | 8 ++++---- .../Right/Axis1D.SecondaryHandTriggerProfile.asset | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset index 8ea42a4..1c9cd39 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset @@ -20,7 +20,7 @@ MonoBehaviour: inputAction: profileGuid: 399335ccc89c4d12b79f3539ca7771db id: 16 - description: Grip + description: Grip Press axisConstraint: 2 keyCode: 0 inputName: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset index ed2050a..ead3624 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset @@ -20,7 +20,7 @@ MonoBehaviour: inputAction: profileGuid: 399335ccc89c4d12b79f3539ca7771db id: 16 - description: Grip + description: Grip Press axisConstraint: 2 keyCode: 0 inputName: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset index 1d9575d..c7db83b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset @@ -18,10 +18,10 @@ MonoBehaviour: axisType: 2 inputType: 13 inputAction: - profileGuid: 00000000000000000000000000000000 - id: 0 - description: None - axisConstraint: 0 + profileGuid: 399335ccc89c4d12b79f3539ca7771db + id: 16 + description: Grip Press + axisConstraint: 2 keyCode: 0 inputName: LHandTrigger axisCodeX: AXIS_11 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset index 4ba1cca..486086e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset @@ -20,7 +20,7 @@ MonoBehaviour: inputAction: profileGuid: 399335ccc89c4d12b79f3539ca7771db id: 7 - description: Grip Press + description: Grip Strength axisConstraint: 3 keyCode: 0 inputName: LHandTrigger diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset index 1889551..5dd6e76 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset @@ -18,10 +18,10 @@ MonoBehaviour: axisType: 2 inputType: 13 inputAction: - profileGuid: 00000000000000000000000000000000 - id: 0 - description: None - axisConstraint: 0 + profileGuid: 399335ccc89c4d12b79f3539ca7771db + id: 16 + description: Grip Press + axisConstraint: 2 keyCode: 0 inputName: RHandTrigger axisCodeX: AXIS_12 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset index 1f1486f..646b7eb 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset @@ -20,7 +20,7 @@ MonoBehaviour: inputAction: profileGuid: 399335ccc89c4d12b79f3539ca7771db id: 7 - description: Grip Press + description: Grip Strength axisConstraint: 3 keyCode: 0 inputName: RHandTrigger From b6b63b0e183f2db3c06e10634ba786329c3b75a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Tue, 15 Dec 2020 22:10:17 +0100 Subject: [PATCH 07/11] Fix grip press naming for hands --- .../Left/LeftOculusHandGripInteractionMappingProfile.asset | 2 +- .../Right/RightOculusHandGripInteractionMappingProfile.asset | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset index 1c9cd39..2628590 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Left/LeftOculusHandGripInteractionMappingProfile.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: LeftOculusHandGripInteractionMappingProfile m_EditorClassIdentifier: interactionMapping: - description: Grip + description: Grip Press stateChangeType: 0 axisType: 2 inputType: 13 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset index ead3624..21b0828 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/HandController/Right/RightOculusHandGripInteractionMappingProfile.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: RightOculusHandGripInteractionMappingProfile m_EditorClassIdentifier: interactionMapping: - description: Grip + description: Grip Press stateChangeType: 0 axisType: 2 inputType: 13 From 00be521595c168b047a6823aa9d2f4e2a81987d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Tue, 15 Dec 2020 22:28:43 +0100 Subject: [PATCH 08/11] Move grip pose offset to BaseController --- .../Providers/Controllers/BaseOculusController.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs index 2d07e14..185bed7 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs @@ -28,13 +28,6 @@ protected BaseOculusController(IMixedRealityControllerDataProvider controllerDat NodeType = nodeType; } - /// - /// Local offset from the controller position defining where the grip pose is. - /// The grip pose may be used to attach things to the controller when grabbing objects. - /// - private readonly MixedRealityPose gripPoseOffset = new - MixedRealityPose(new Vector3(0f, 0f, .03f), Quaternion.Euler(0f, 90f, 0f)); - /// /// The Oculus Node Type. /// @@ -383,8 +376,8 @@ private void UpdateSpatialGripData(MixedRealityInteractionMapping interactionMap { Debug.Assert(interactionMapping.AxisType == AxisType.SixDof); interactionMapping.PoseData = new MixedRealityPose( - currentControllerPose.Position + gripPoseOffset.Position, - Quaternion.Euler(currentControllerPose.Rotation.eulerAngles + gripPoseOffset.Rotation.eulerAngles)); + currentControllerPose.Position + GripPoseOffset.Position, + Quaternion.Euler(currentControllerPose.Rotation.eulerAngles + GripPoseOffset.Rotation.eulerAngles)); } private void UpdateDualAxisData(MixedRealityInteractionMapping interactionMapping) From c3a36390abb1d14729bdac83b8f73d6b0e921120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Wed, 16 Dec 2020 12:20:18 +0100 Subject: [PATCH 09/11] Fix assigned camera data provider profile in platform config --- .../Profiles~/OculusPlatformServiceConfigurationsProfile.asset | 2 +- .../Runtime/Profiles/OculusControllerDataProviderProfile.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset index b407ad5..693f105 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset @@ -25,7 +25,7 @@ MonoBehaviour: runtimePlatforms: - reference: c838c4f5-a87e-48c7-8742-09a4d85fc3bc - reference: db1acc26-ec8d-4bc6-afca-c51351b2da2e - profile: {fileID: 11400000, guid: c02516a14adf1ff45b2e6feaefd1d090, type: 2} + profile: {fileID: 11400000, guid: 69601914bd8789b49bc45cc0a9220b4d, type: 2} - instancedType: reference: 0de5da40-feb8-4891-b9b2-942eafd041b9 name: Oculus Controller Data Provider diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs index 5a09dba..3a3a4ea 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs @@ -15,7 +15,7 @@ public override ControllerDefinition[] GetDefaultControllerOptions() { new ControllerDefinition(typeof(OculusRemoteController)), new ControllerDefinition(typeof(OculusTouchController), Handedness.Left), - new ControllerDefinition(typeof(OculusTouchController), Handedness.Right), + new ControllerDefinition(typeof(OculusTouchController), Handedness.Right) }; } } From 9b073ab6dba4a9c933cd92a25c4493a220ad6f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Wed, 16 Dec 2020 18:59:59 +0100 Subject: [PATCH 10/11] Add grip pose override for Oculus Touch --- .../Runtime/Providers/Controllers/BaseOculusController.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs index 185bed7..af5a973 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs @@ -33,6 +33,9 @@ protected BaseOculusController(IMixedRealityControllerDataProvider controllerDat /// private OculusApi.Node NodeType { get; } + /// + protected override MixedRealityPose GripPoseOffset => new MixedRealityPose(Vector3.zero, Quaternion.Euler(0f, 0f, -90f)); + /// /// The Oculus Controller Type. /// @@ -376,8 +379,8 @@ private void UpdateSpatialGripData(MixedRealityInteractionMapping interactionMap { Debug.Assert(interactionMapping.AxisType == AxisType.SixDof); interactionMapping.PoseData = new MixedRealityPose( - currentControllerPose.Position + GripPoseOffset.Position, - Quaternion.Euler(currentControllerPose.Rotation.eulerAngles + GripPoseOffset.Rotation.eulerAngles)); + currentControllerPose.Position + currentControllerPose.Rotation * GripPoseOffset.Position, + currentControllerPose.Rotation * GripPoseOffset.Rotation); } private void UpdateDualAxisData(MixedRealityInteractionMapping interactionMapping) From b1df9bc1cff85215a62e9650a30105c341f085b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dino=20Fejzagi=C4=87?= Date: Wed, 16 Dec 2020 20:35:49 +0100 Subject: [PATCH 11/11] Update core package dependency --- XRTK.Oculus/Packages/com.xrtk.oculus/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/package.json b/XRTK.Oculus/Packages/com.xrtk.oculus/package.json index 65ecee3..cad7d1a 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/package.json +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/package.json @@ -15,7 +15,7 @@ "src": "Assets/XRTK.Oculus", "author": "XRTK Team (https://github.com/XRTK)", "dependencies": { - "com.xrtk.core": "0.2.0-preview.133" + "com.xrtk.core": "0.2.0-preview.161" }, "profiles": [ {