From 60583abdc7039c68008532c990bcd3e1a7c1fac2 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 6 Apr 2020 13:44:51 -0400 Subject: [PATCH 01/70] updated oculus data provider profiles --- .../Controllers/BaseOculusController.cs | 64 ++++++++-------- .../OculusControllerDataProvider.cs | 29 ++------ .../Controllers/OculusGoController.cs | 60 +++++++-------- .../Controllers/OculusRemoteController.cs | 16 ++-- .../Controllers/OculusTouchController.cs | 74 +++++++++---------- .../Extensions/ControllerExtensions.cs | 25 ------- ...ulusGoControllerMappingProfileInspector.cs | 12 --- ...oControllerMappingProfileInspector.cs.meta | 11 --- ...RemoteControllerMappingProfileInspector.cs | 12 --- ...eControllerMappingProfileInspector.cs.meta | 11 --- ...sTouchControllerMappingProfileInspector.cs | 12 --- ...hControllerMappingProfileInspector.cs.meta | 11 --- .../OculusGoControllerDataProviderProfile.cs | 17 +++++ ...usGoControllerDataProviderProfile.cs.meta} | 0 .../OculusGoControllerMappingProfile.cs | 36 --------- ...ulusRemoteControllerDataProviderProfile.cs | 16 ++++ ...moteControllerDataProviderProfile.cs.meta} | 0 .../OculusRemoteControllerMappingProfile.cs | 34 --------- ...culusTouchControllerDataProviderProfile.cs | 17 +++++ ...ouchControllerDataProviderProfile.cs.meta} | 0 .../OculusTouchControllerMappingProfile.cs | 36 --------- 21 files changed, 165 insertions(+), 328 deletions(-) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs.meta delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs.meta delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs.meta create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs rename XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/{OculusGoControllerMappingProfile.cs.meta => OculusGoControllerDataProviderProfile.cs.meta} (100%) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerMappingProfile.cs create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs rename XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/{OculusRemoteControllerMappingProfile.cs.meta => OculusRemoteControllerDataProviderProfile.cs.meta} (100%) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerMappingProfile.cs create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs rename XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/{OculusTouchControllerMappingProfile.cs.meta => OculusTouchControllerDataProviderProfile.cs.meta} (100%) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerMappingProfile.cs diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs index dee5e68..c3738c9 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs @@ -54,38 +54,38 @@ public BaseOculusController( /// public override MixedRealityInteractionMapping[] DefaultInteractions => new[] { - new MixedRealityInteractionMapping(0, "Button.A Press", AxisType.Digital, "A", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(1, "Button.B Press", AxisType.Digital, "B", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(2, "Button.X Press", AxisType.Digital, "X", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(3, "Button.Y Press", AxisType.Digital, "Y", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(4, "Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(5, "Button.Back Press", AxisType.Digital, "Back", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(6, "Button.LShoulder Press", AxisType.Digital, "LShoulder", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(7, "Axis1D.LIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(8, "Axis1D.LIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), - new MixedRealityInteractionMapping(9, "Axis1D.LIndexTrigger Near Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerNearTouch), - new MixedRealityInteractionMapping(10, "Axis1D.LIndexTrigger Press", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(11, "Axis1D.LHandTrigger Press", AxisType.SingleAxis, "LHandTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(12, "Axis2D.LThumbstick", AxisType.DualAxis, "PrimaryThumbstick", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(13, "Button.LThumbstick Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickTouch), - new MixedRealityInteractionMapping(14, "Button.LThumbstick Near Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbNearTouch), - new MixedRealityInteractionMapping(15, "Button.LThumbstick Press", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(16, "Button.RShoulder Press", AxisType.Digital, "RShoulder", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(17, "Axis1D.RIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(18, "Axis1D.RIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), - new MixedRealityInteractionMapping(19, "Axis1D.RIndexTrigger Near Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerNearTouch), - new MixedRealityInteractionMapping(20, "Axis1D.RIndexTrigger Press", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(21, "Axis1D.RHandTrigger Press", AxisType.SingleAxis, "RHandTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(22, "Axis2D.RThumbstick", AxisType.DualAxis, "SecondaryThumbstick", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(23, "Button.RThumbstick Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickTouch), - new MixedRealityInteractionMapping(24, "Button.RThumbstick Near Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbNearTouch), - new MixedRealityInteractionMapping(25, "Button.RThumbstick Press", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(26, "Axis2D.Dpad", AxisType.DualAxis, DeviceInputType.ThumbStick, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(27, "Button.DpadUp Press", AxisType.Digital, "DpadUp", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(28, "Button.DpadDown Press", AxisType.Digital, "DpadDown", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(29, "Button.DpadLeft Press", AxisType.Digital, "DpadLeft", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(30, "Button.DpadRight Press", AxisType.Digital, "DpadRight", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(31, "Button.RTouchpad", AxisType.Digital, "RTouchpad", DeviceInputType.ThumbTouch), + new MixedRealityInteractionMapping("Button.A Press", AxisType.Digital, "A", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.B Press", AxisType.Digital, "B", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.X Press", AxisType.Digital, "X", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Y Press", AxisType.Digital, "Y", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Back Press", AxisType.Digital, "Back", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.LShoulder Press", AxisType.Digital, "LShoulder", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Axis1D.LIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.LIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), + new MixedRealityInteractionMapping("Axis1D.LIndexTrigger Near Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerNearTouch), + new MixedRealityInteractionMapping("Axis1D.LIndexTrigger Press", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis1D.LHandTrigger Press", AxisType.SingleAxis, "LHandTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis2D.LThumbstick", AxisType.DualAxis, "PrimaryThumbstick", DeviceInputType.ThumbStick), + new MixedRealityInteractionMapping("Button.LThumbstick Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickTouch), + new MixedRealityInteractionMapping("Button.LThumbstick Near Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbNearTouch), + new MixedRealityInteractionMapping("Button.LThumbstick Press", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickPress), + new MixedRealityInteractionMapping("Button.RShoulder Press", AxisType.Digital, "RShoulder", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Axis1D.RIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.RIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), + new MixedRealityInteractionMapping("Axis1D.RIndexTrigger Near Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerNearTouch), + new MixedRealityInteractionMapping("Axis1D.RIndexTrigger Press", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis1D.RHandTrigger Press", AxisType.SingleAxis, "RHandTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis2D.RThumbstick", AxisType.DualAxis, "SecondaryThumbstick", DeviceInputType.ThumbStick), + new MixedRealityInteractionMapping("Button.RThumbstick Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickTouch), + new MixedRealityInteractionMapping("Button.RThumbstick Near Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbNearTouch), + new MixedRealityInteractionMapping("Button.RThumbstick Press", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickPress), + new MixedRealityInteractionMapping("Axis2D.Dpad", AxisType.DualAxis, DeviceInputType.ThumbStick, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Button.DpadUp Press", AxisType.Digital, "DpadUp", DeviceInputType.ThumbStickPress), + new MixedRealityInteractionMapping("Button.DpadDown Press", AxisType.Digital, "DpadDown", DeviceInputType.ThumbStickPress), + 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), }; /// diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 15ca626..99b6e4d 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -9,6 +9,7 @@ using XRTK.Definitions.Utilities; using XRTK.Oculus.Extensions; using XRTK.Providers.Controllers; +using XRTK.Providers.Controllers.OpenVR; using XRTK.Services; namespace XRTK.Oculus.Controllers @@ -105,21 +106,7 @@ private BaseOculusController GetOrAddController(OculusApi.Controller controllerM if (!addController) { return null; } - var currentControllerType = GetCurrentControllerType(controllerMask); - Type controllerType = null; - - switch (currentControllerType) - { - case SupportedControllerType.OculusTouch: - controllerType = typeof(OculusTouchController); - break; - case SupportedControllerType.OculusGo: - controllerType = typeof(OculusGoController); - break; - case SupportedControllerType.OculusRemote: - controllerType = typeof(OculusRemoteController); - break; - } + var controllerType = GetCurrentControllerType(controllerMask); // Determine Handedness of the current controller var controllingHand = controllerMask.ToHandedness(); @@ -255,24 +242,24 @@ private void RaiseSourceLost(OculusApi.Controller activeController, bool clearFr } } - private SupportedControllerType GetCurrentControllerType(OculusApi.Controller controllerMask) + private Type GetCurrentControllerType(OculusApi.Controller controllerMask) { switch (controllerMask) { case OculusApi.Controller.LTouch: case OculusApi.Controller.RTouch: case OculusApi.Controller.Touch: - return SupportedControllerType.OculusTouch; + return typeof(OculusTouchController); case OculusApi.Controller.Remote: - return SupportedControllerType.OculusRemote; + return typeof(OculusRemoteController); case OculusApi.Controller.LTrackedRemote: case OculusApi.Controller.RTrackedRemote: - return SupportedControllerType.OculusGo; + return typeof(OculusGoController); } - Debug.LogWarning($"{controllerMask} does not have a defined controller type, falling back to generic controller type"); + Debug.LogWarning($"{controllerMask} does not have a defined controller type, falling back to {nameof(GenericOpenVRController)}"); - return SupportedControllerType.GenericOpenVR; + return typeof(GenericOpenVRController); } } } \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs index c45313a..3c51216 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs @@ -30,41 +30,41 @@ public OculusGoController( /// Note, MUST use RAW button types as that is what the API works with, DO NOT use Virtual! public override MixedRealityInteractionMapping[] DefaultLeftHandedInteractions => new[] { - new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(1, "Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(2, "Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), - new MixedRealityInteractionMapping(3, "Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(4, "Axis1D.PrimaryHandTrigger", AxisType.SingleAxis, "LHandTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(5, "Axis1D.PrimaryHandTrigger Press", AxisType.Digital, "LHandTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(6, "Axis2D.PrimaryTouchpad", AxisType.DualAxis, "LTouchpad", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(7, "Button.PrimaryTouchpad Touch", AxisType.Digital, "LTouchpad", DeviceInputType.ThumbStickTouch), - new MixedRealityInteractionMapping(8, "Button.PrimaryTouchpad Press", AxisType.Digital, "LTouchpad", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(9, "Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(10, "Button.Back Touch", AxisType.Digital, "Back", DeviceInputType.ButtonTouch), - new MixedRealityInteractionMapping(11, "Button.DpadUp", AxisType.Digital, "DpadUp", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(12, "Button.DpadDown", AxisType.Digital, "DpadDown", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(13, "Button.DpadLeft", AxisType.Digital, "DpadLeft", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(14, "Button.DpadRight", AxisType.Digital, "DpadRight", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis1D.PrimaryHandTrigger", AxisType.SingleAxis, "LHandTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.PrimaryHandTrigger Press", AxisType.Digital, "LHandTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis2D.PrimaryTouchpad", AxisType.DualAxis, "LTouchpad", DeviceInputType.ThumbStick), + new MixedRealityInteractionMapping("Button.PrimaryTouchpad Touch", AxisType.Digital, "LTouchpad", DeviceInputType.ThumbStickTouch), + new MixedRealityInteractionMapping("Button.PrimaryTouchpad Press", AxisType.Digital, "LTouchpad", DeviceInputType.ThumbStickPress), + new MixedRealityInteractionMapping("Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Back Touch", AxisType.Digital, "Back", DeviceInputType.ButtonTouch), + new MixedRealityInteractionMapping("Button.DpadUp", AxisType.Digital, "DpadUp", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadDown", AxisType.Digital, "DpadDown", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadLeft", AxisType.Digital, "DpadLeft", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadRight", AxisType.Digital, "DpadRight", DeviceInputType.ButtonPress), }; /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => new[] { - new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(1, "Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(2, "Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), - new MixedRealityInteractionMapping(3, "Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(4, "Axis1D.PrimaryHandTrigger", AxisType.SingleAxis, "RHandTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(5, "Axis1D.PrimaryHandTrigger Press", AxisType.Digital, "RHandTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(6, "Axis2D.PrimaryTouchpad", AxisType.DualAxis, "RTouchpad", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(7, "Button.PrimaryTouchpad Touch", AxisType.Digital, "RTouchpad", DeviceInputType.ThumbStickTouch), - new MixedRealityInteractionMapping(8, "Button.PrimaryTouchpad Press", AxisType.Digital, "RTouchpad", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(9, "Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(10, "Button.Back Touch", AxisType.Digital, "Back", DeviceInputType.ButtonTouch), - new MixedRealityInteractionMapping(11, "Button.DpadUp", AxisType.Digital, "DpadUp", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(12, "Button.DpadDown", AxisType.Digital, "DpadDown", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(13, "Button.DpadLeft", AxisType.Digital, "DpadLeft", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(14, "Button.DpadRight", AxisType.Digital, "DpadRight", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis1D.PrimaryHandTrigger", AxisType.SingleAxis, "RHandTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.PrimaryHandTrigger Press", AxisType.Digital, "RHandTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis2D.PrimaryTouchpad", AxisType.DualAxis, "RTouchpad", DeviceInputType.ThumbStick), + new MixedRealityInteractionMapping("Button.PrimaryTouchpad Touch", AxisType.Digital, "RTouchpad", DeviceInputType.ThumbStickTouch), + new MixedRealityInteractionMapping("Button.PrimaryTouchpad Press", AxisType.Digital, "RTouchpad", DeviceInputType.ThumbStickPress), + new MixedRealityInteractionMapping("Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Back Touch", AxisType.Digital, "Back", DeviceInputType.ButtonTouch), + new MixedRealityInteractionMapping("Button.DpadUp", AxisType.Digital, "DpadUp", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadDown", AxisType.Digital, "DpadDown", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadLeft", AxisType.Digital, "DpadLeft", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadRight", AxisType.Digital, "DpadRight", DeviceInputType.ButtonPress), }; /// diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs index 908a2ef..31f583f 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs @@ -28,14 +28,14 @@ public OculusRemoteController( /// public override MixedRealityInteractionMapping[] DefaultInteractions => new[] { - new MixedRealityInteractionMapping(0, "Button.DpadUp", AxisType.Digital, "DpadUp", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(1, "Button.DpadDown", AxisType.Digital, "DpadDown", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(2, "Button.DpadLeft", AxisType.Digital, "DpadLeft", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(3, "Button.DpadRight", AxisType.Digital, "DpadRight", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(4, "Button.One", AxisType.Digital, "One", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(5, "Button.Two", AxisType.Digital, "Two", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(6, "Button.Start", AxisType.Digital, "Start", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(7, "Button.Back", AxisType.Digital, "Back", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadUp", AxisType.Digital, "DpadUp", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadDown", AxisType.Digital, "DpadDown", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadLeft", AxisType.Digital, "DpadLeft", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.DpadRight", AxisType.Digital, "DpadRight", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.One", AxisType.Digital, "One", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Two", AxisType.Digital, "Two", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Start", AxisType.Digital, "Start", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Back", AxisType.Digital, "Back", DeviceInputType.ButtonPress), }; /// diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs index 27ed3b3..ec3e073 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs @@ -30,48 +30,48 @@ public OculusTouchController( /// Note, MUST use RAW button types as that is what the API works with, DO NOT use Virtual! public override MixedRealityInteractionMapping[] DefaultLeftHandedInteractions => new[] { - new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(1, "Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(2, "Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), - new MixedRealityInteractionMapping(3, "Axis1D.PrimaryIndexTrigger Near Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerNearTouch), - new MixedRealityInteractionMapping(4, "Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(5, "Axis1D.PrimaryHandTrigger", AxisType.SingleAxis, "LHandTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(6, "Axis1D.PrimaryHandTrigger Press", AxisType.Digital, "LHandTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(7, "Axis2D.PrimaryThumbstick", AxisType.DualAxis, "LThumbstick", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(8, "Button.PrimaryThumbstick Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickTouch), - new MixedRealityInteractionMapping(9, "Button.PrimaryThumbstick Near Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbNearTouch), - new MixedRealityInteractionMapping(10, "Button.PrimaryThumbstick Press", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(11, "Button.Three Press", AxisType.Digital, "X", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(12, "Button.Four Press", AxisType.Digital, "Y", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(13, "Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(14, "Button.Three Touch", AxisType.Digital, "X", DeviceInputType.ButtonTouch), - new MixedRealityInteractionMapping(15, "Button.Four Touch", AxisType.Digital, "Y", DeviceInputType.ButtonTouch), - new MixedRealityInteractionMapping(16, "Axis2D.PrimaryThumbRest", AxisType.DualAxis, "LTouchpad", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(17, "Touch.PrimaryThumbRest Touch", AxisType.Digital, "LThumbRest", DeviceInputType.ThumbTouch), - new MixedRealityInteractionMapping(18, "Touch.PrimaryThumbRest Near Touch", AxisType.Digital, "LThumbRest", DeviceInputType.ThumbNearTouch) + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Near Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerNearTouch), + new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis1D.PrimaryHandTrigger", AxisType.SingleAxis, "LHandTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.PrimaryHandTrigger Press", AxisType.Digital, "LHandTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis2D.PrimaryThumbstick", AxisType.DualAxis, "LThumbstick", DeviceInputType.ThumbStick), + new MixedRealityInteractionMapping("Button.PrimaryThumbstick Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickTouch), + new MixedRealityInteractionMapping("Button.PrimaryThumbstick Near Touch", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbNearTouch), + new MixedRealityInteractionMapping("Button.PrimaryThumbstick Press", AxisType.Digital, "LThumbstick", DeviceInputType.ThumbStickPress), + new MixedRealityInteractionMapping("Button.Three Press", AxisType.Digital, "X", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Four Press", AxisType.Digital, "Y", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Start Press", AxisType.Digital, "Start", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Three Touch", AxisType.Digital, "X", DeviceInputType.ButtonTouch), + 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) }; /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => new[] { - new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(1, "Axis1D.SecondaryIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(2, "Axis1D.SecondaryIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), - new MixedRealityInteractionMapping(3, "Axis1D.SecondaryIndexTrigger Near Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerNearTouch), - new MixedRealityInteractionMapping(4, "Axis1D.SecondaryIndexTrigger Press", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(5, "Axis1D.SecondaryHandTrigger", AxisType.SingleAxis, "RHandTrigger", DeviceInputType.Trigger), - new MixedRealityInteractionMapping(6, "Axis1D.SecondaryHandTrigger Press", AxisType.Digital, "RHandTrigger", DeviceInputType.TriggerPress), - new MixedRealityInteractionMapping(7, "Axis2D.SecondaryThumbstick", AxisType.DualAxis, "RThumbstick", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(8, "Button.SecondaryThumbstick Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickTouch), - new MixedRealityInteractionMapping(9, "Button.SecondaryThumbstick Near Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbNearTouch), - new MixedRealityInteractionMapping(10, "Button.SecondaryThumbstick Press", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping(11, "Button.One Press", AxisType.Digital, "A", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(12, "Button.Two Press", AxisType.Digital, "B", DeviceInputType.ButtonPress), - new MixedRealityInteractionMapping(13, "Button.One Touch", AxisType.Digital, "A", DeviceInputType.ButtonTouch), - new MixedRealityInteractionMapping(14, "Button.Two Touch", AxisType.Digital, "B", DeviceInputType.ButtonTouch), - new MixedRealityInteractionMapping(15, "Axis2D.SecondaryThumbRest", AxisType.DualAxis, "RTouchpad", DeviceInputType.ThumbStick), - new MixedRealityInteractionMapping(16, "Touch.SecondaryThumbRest Touch", AxisType.Digital, "RThumbRest", DeviceInputType.ThumbTouch), - new MixedRealityInteractionMapping(17, "Touch.SecondaryThumbRest Near Touch", AxisType.Digital, "RThumbRest", DeviceInputType.ThumbNearTouch) + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Axis1D.SecondaryIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.SecondaryIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), + new MixedRealityInteractionMapping("Axis1D.SecondaryIndexTrigger Near Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerNearTouch), + new MixedRealityInteractionMapping("Axis1D.SecondaryIndexTrigger Press", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis1D.SecondaryHandTrigger", AxisType.SingleAxis, "RHandTrigger", DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Axis1D.SecondaryHandTrigger Press", AxisType.Digital, "RHandTrigger", DeviceInputType.TriggerPress), + new MixedRealityInteractionMapping("Axis2D.SecondaryThumbstick", AxisType.DualAxis, "RThumbstick", DeviceInputType.ThumbStick), + new MixedRealityInteractionMapping("Button.SecondaryThumbstick Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickTouch), + new MixedRealityInteractionMapping("Button.SecondaryThumbstick Near Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbNearTouch), + new MixedRealityInteractionMapping("Button.SecondaryThumbstick Press", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickPress), + new MixedRealityInteractionMapping("Button.One Press", AxisType.Digital, "A", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.Two Press", AxisType.Digital, "B", DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Button.One Touch", AxisType.Digital, "A", DeviceInputType.ButtonTouch), + 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) }; /// diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/ControllerExtensions.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/ControllerExtensions.cs index b083fd3..c502528 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/ControllerExtensions.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/ControllerExtensions.cs @@ -2,37 +2,12 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; namespace XRTK.Oculus.Extensions { public static class ControllerExtensions { - /// - /// Converts an mask to a XRTK . - /// - /// Controller mask. - /// Controller type. - public static SupportedControllerType ToControllerType(this OculusApi.Controller controller) - { - switch (controller) - { - case OculusApi.Controller.LTouch: - case OculusApi.Controller.RTouch: - case OculusApi.Controller.Touch: - return SupportedControllerType.OculusTouch; - case OculusApi.Controller.Remote: - return SupportedControllerType.OculusRemote; - case OculusApi.Controller.LTrackedRemote: - case OculusApi.Controller.RTrackedRemote: - return SupportedControllerType.OculusGo; - } - - Debug.LogWarning($"{controller} does not have a defined controller type, falling back to generic controller type"); - return SupportedControllerType.GenericOpenVR; - } - /// /// Converts an mask to a XRTK . /// diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs deleted file mode 100644 index db92b89..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using UnityEditor; -using XRTK.Inspectors.Profiles.InputSystem.Controllers; -using XRTK.Oculus.Profiles; - -namespace XRTK.Oculus.Inspectors -{ - [CustomEditor(typeof(OculusGoControllerMappingProfile))] - public class OculusGoControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector { } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs.meta deleted file mode 100644 index 2630aff..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusGoControllerMappingProfileInspector.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0ce97eae860dde04196e35229c44ffd4 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs deleted file mode 100644 index 806b777..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using UnityEditor; -using XRTK.Inspectors.Profiles.InputSystem.Controllers; -using XRTK.Oculus.Profiles; - -namespace XRTK.Oculus.Inspectors -{ - [CustomEditor(typeof(OculusRemoteControllerMappingProfile))] - public class OculusRemoteControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector { } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs.meta deleted file mode 100644 index b982df5..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusRemoteControllerMappingProfileInspector.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7de4aaeee2b1cf04f82c33f928e448ad -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs deleted file mode 100644 index 027d70b..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using UnityEditor; -using XRTK.Inspectors.Profiles.InputSystem.Controllers; -using XRTK.Oculus.Profiles; - -namespace XRTK.Oculus.Inspectors -{ - [CustomEditor(typeof(OculusTouchControllerMappingProfile))] - public class OculusTouchControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector { } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs.meta deleted file mode 100644 index 5be0adf..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusTouchControllerMappingProfileInspector.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 0ea804616e7334440878ea21510d3f38 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs new file mode 100644 index 0000000..e490b28 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs @@ -0,0 +1,17 @@ +// Copyright (c) XRTK. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using XRTK.Definitions.Controllers; + +namespace XRTK.Oculus.Profiles +{ + public class OculusGoControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile + { + public override ControllerDefinition[] GetControllerDefinitions() + { + // new MixedRealityControllerMapping("Oculus Go Controller Left", typeof(OculusGoController), Handedness.Left), + // new MixedRealityControllerMapping("Oculus Go Controller Right", typeof(OculusGoController), Handedness.Right), + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerMappingProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerMappingProfile.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerMappingProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerMappingProfile.cs deleted file mode 100644 index fa6640d..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerMappingProfile.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using UnityEngine; -using XRTK.Definitions.Devices; -using XRTK.Definitions.Utilities; -using XRTK.Oculus.Controllers; -using XRTK.Definitions.Controllers; -using XRTK.Providers.Controllers; - -namespace XRTK.Oculus.Profiles -{ - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Native Oculus Go Controller Mapping Profile", fileName = "OculusGoControllerMappingProfile")] - public class OculusGoControllerMappingProfile : BaseMixedRealityControllerMappingProfile - { - /// - public override SupportedControllerType ControllerType => SupportedControllerType.OculusGo; - - /// - public override string TexturePath => $"{base.TexturePath}OculusGoController"; - - protected override void Awake() - { - if (!HasSetupDefaults) - { - ControllerMappings = new[] - { - new MixedRealityControllerMapping("Oculus Go Controller Left", typeof(OculusGoController), Handedness.Left), - new MixedRealityControllerMapping("Oculus Go Controller Right", typeof(OculusGoController), Handedness.Right), - }; - } - - base.Awake(); - } - } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs new file mode 100644 index 0000000..05958cf --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs @@ -0,0 +1,16 @@ +// Copyright (c) XRTK. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using XRTK.Definitions.Controllers; + +namespace XRTK.Oculus.Profiles +{ + public class OculusRemoteControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile + { + public override ControllerDefinition[] GetControllerDefinitions() + { + // new MixedRealityControllerMapping("Oculus Remote Controller", typeof(OculusRemoteController)), + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerMappingProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerMappingProfile.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerMappingProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerMappingProfile.cs deleted file mode 100644 index 8b2e66b..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerMappingProfile.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using UnityEngine; -using XRTK.Definitions.Devices; -using XRTK.Oculus.Controllers; -using XRTK.Definitions.Controllers; -using XRTK.Providers.Controllers; - -namespace XRTK.Oculus.Profiles -{ - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Native Oculus Remote Controller Mapping Profile", fileName = "OculusRemoteControllerMappingProfile")] - public class OculusRemoteControllerMappingProfile : BaseMixedRealityControllerMappingProfile - { - /// - public override SupportedControllerType ControllerType => SupportedControllerType.OculusRemote; - - /// - public override string TexturePath => $"{base.TexturePath}OculusRemoteController"; - - protected override void Awake() - { - if (!HasSetupDefaults) - { - ControllerMappings = new[] - { - new MixedRealityControllerMapping("Oculus Remote Controller", typeof(OculusRemoteController)), - }; - } - - base.Awake(); - } - } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs new file mode 100644 index 0000000..5460650 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs @@ -0,0 +1,17 @@ +// Copyright (c) XRTK. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using XRTK.Definitions.Controllers; + +namespace XRTK.Oculus.Profiles +{ + public class OculusTouchControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile + { + public override ControllerDefinition[] GetControllerDefinitions() + { + // new MixedRealityControllerMapping("Oculus Touch Controller Left", typeof(OculusTouchController), Handedness.Left), + // new MixedRealityControllerMapping("Oculus Touch Controller Right", typeof(OculusTouchController), Handedness.Right), + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerMappingProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerMappingProfile.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerMappingProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerMappingProfile.cs deleted file mode 100644 index 1e9e7c6..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerMappingProfile.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using UnityEngine; -using XRTK.Definitions.Devices; -using XRTK.Definitions.Utilities; -using XRTK.Oculus.Controllers; -using XRTK.Definitions.Controllers; -using XRTK.Providers.Controllers; - -namespace XRTK.Oculus.Profiles -{ - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Native Oculus Touch Controller Mapping Profile", fileName = "OculusTouchControllerMappingProfile")] - public class OculusTouchControllerMappingProfile : BaseMixedRealityControllerMappingProfile - { - /// - public override SupportedControllerType ControllerType => SupportedControllerType.OculusTouch; - - /// - public override string TexturePath => $"{base.TexturePath}OculusControllersTouch"; - - protected override void Awake() - { - if (!HasSetupDefaults) - { - ControllerMappings = new[] - { - new MixedRealityControllerMapping("Oculus Touch Controller Left", typeof(OculusTouchController), Handedness.Left), - new MixedRealityControllerMapping("Oculus Touch Controller Right", typeof(OculusTouchController), Handedness.Right), - }; - } - - base.Awake(); - } - } -} \ No newline at end of file From cf389aa2031800a766b85d650eb6a2c7e5cd82a1 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 6 Apr 2020 23:45:41 -0400 Subject: [PATCH 02/70] updated oculus controller --- .../com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 9855ebc..ae901b8 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -124,7 +124,7 @@ private BaseOculusController GetOrAddController(OculusApi.Controller controllerM } var pointers = RequestPointers(typeof(BaseOculusController), controllingHand); - var inputSource = MixedRealityToolkit.InputSystem?.RequestNewGenericInputSource($"Oculus Controller {controllingHand}", pointers); + var inputSource = MixedRealityToolkit.InputSystem?.RequestNewGenericInputSource($"{controllerType.Name} {controllingHand}", pointers); var detectedController = new BaseOculusController(this, TrackingState.NotTracked, controllingHand, controllerMask, nodeType, inputSource); if (!detectedController.SetupConfiguration(controllerType)) From a5a5a4dca208be52f0d86dac2742c40a3420b146 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 00:29:38 -0400 Subject: [PATCH 03/70] updated references --- .../com.xrtk.oculus/Controllers/BaseOculusController.cs | 2 +- .../com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs index b43b4f1..5e5a859 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs @@ -3,6 +3,7 @@ using System; using UnityEngine; +using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; using XRTK.Definitions.InputSystem; using XRTK.Definitions.Utilities; @@ -10,7 +11,6 @@ using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Extensions; -using XRTK.Providers.Controllers; using XRTK.Services; namespace XRTK.Oculus.Controllers diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index ae901b8..5681b57 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -5,11 +5,11 @@ using System.Collections.Generic; using UnityEngine; using XRTK.Definitions.Controllers; +using XRTK.Definitions.Controllers.OpenVR; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; using XRTK.Oculus.Extensions; using XRTK.Providers.Controllers; -using XRTK.Providers.Controllers.OpenVR; using XRTK.Services; namespace XRTK.Oculus.Controllers From 6fe13abc150b4cb05bb0baf1ac5631b44434eb73 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 03:23:12 -0400 Subject: [PATCH 04/70] updated profile constructor parameter reference to enable inspector --- .../Controllers/OculusControllerDataProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 5681b57..c7dd6fe 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -4,11 +4,11 @@ using System; using System.Collections.Generic; using UnityEngine; -using XRTK.Definitions.Controllers; using XRTK.Definitions.Controllers.OpenVR; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; using XRTK.Oculus.Extensions; +using XRTK.Oculus.Profiles; using XRTK.Providers.Controllers; using XRTK.Services; @@ -22,7 +22,7 @@ public class OculusControllerDataProvider : BaseControllerDataProvider /// Name of the data provider as assigned in the configuration profile. /// Data provider priority controls the order in the service registry. /// Controller data provider profile assigned to the provider instance in the configuration inspector. - public OculusControllerDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile) + public OculusControllerDataProvider(string name, uint priority, OculusGoControllerDataProviderProfile profile) : base(name, priority, profile) { } From d3a621e19b5537284bb113589ff5a51371041198 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 13:42:03 -0400 Subject: [PATCH 05/70] updated references --- .../OculusControllerDataProvider.cs | 6 ++++ .../SupportedControllerTypeExtensions.cs | 36 ------------------- .../SupportedControllerTypeExtensions.cs.meta | 11 ------ ...OculusHandControllerDataProviderProfile.cs | 6 ++++ 4 files changed, 12 insertions(+), 47 deletions(-) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 8eb68ee..9963ed2 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -1,6 +1,7 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; using System.Collections.Generic; using UnityEngine; using XRTK.Definitions.Controllers.OpenVR; @@ -8,6 +9,7 @@ using XRTK.Oculus.Extensions; using XRTK.Oculus.Profiles; using XRTK.Providers.Controllers; +using XRTK.Providers.Controllers.Hands; using XRTK.Services; namespace XRTK.Oculus.Controllers @@ -241,6 +243,10 @@ private Type GetCurrentControllerType(OculusApi.Controller controllerMask) case OculusApi.Controller.LTrackedRemote: case OculusApi.Controller.RTrackedRemote: return typeof(OculusGoController); + case OculusApi.Controller.Hands: + case OculusApi.Controller.LHand: + case OculusApi.Controller.RHand: + return null; } Debug.LogWarning($"{controllerMask} does not have a defined controller type, falling back to {nameof(GenericOpenVRController)}"); diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs deleted file mode 100644 index d05ba7c..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System; -using XRTK.Oculus.Controllers; -using XRTK.Providers.Controllers.Hands; - -namespace XRTK.Oculus.Extensions -{ - public static class SupportedControllerTypeExtensions - { - /// - /// Gets the concrete imlementation for a XRTK - /// on the Oculus platform. - /// - /// The to lookup an implementation for. - /// of the controller implementation. - public static Type ToImplementation(this Definitions.Devices.SupportedControllerType supportedControllerType) - { - switch (supportedControllerType) - { - case Definitions.Devices.SupportedControllerType.OculusTouch: - return typeof(OculusTouchController); - case Definitions.Devices.SupportedControllerType.OculusGo: - return typeof(OculusGoController); - case Definitions.Devices.SupportedControllerType.OculusRemote: - return typeof(OculusRemoteController); - case Definitions.Devices.SupportedControllerType.Hand: - return typeof(MixedRealityHandController); - case Definitions.Devices.SupportedControllerType.None: - default: - return null; - } - } - } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs.meta deleted file mode 100644 index 82b4d93..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Extensions/SupportedControllerTypeExtensions.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ac0931372295f7543a71217bf949a3b7 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs index 137526e..e96985a 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; +using XRTK.Definitions.Controllers; using XRTK.Definitions.Controllers.Hands; using XRTK.Definitions.Utilities; @@ -21,5 +22,10 @@ public class OculusHandControllerDataProviderProfile : BaseHandControllerDataPro /// The minimum hand tracking confidence expected. /// public int MinConfidenceRequired => minConfidenceRequired; + + public override ControllerDefinition[] GetControllerDefinitions() + { + throw new System.NotImplementedException(); + } } } \ No newline at end of file From 01de05adc4614deb5a65d26f71fa156ed7eea213 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 15:17:29 -0400 Subject: [PATCH 06/70] Added default controller definitions --- .../OculusControllerDataProvider.cs | 2 +- .../OculusControllerDataProviderProfile.cs | 24 +++++++++++++++++++ ...ulusControllerDataProviderProfile.cs.meta} | 0 .../OculusGoControllerDataProviderProfile.cs | 17 ------------- ...OculusHandControllerDataProviderProfile.cs | 6 ----- ...ulusRemoteControllerDataProviderProfile.cs | 16 ------------- ...emoteControllerDataProviderProfile.cs.meta | 11 --------- ...culusTouchControllerDataProviderProfile.cs | 17 ------------- ...TouchControllerDataProviderProfile.cs.meta | 11 --------- 9 files changed, 25 insertions(+), 79 deletions(-) create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs rename XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/{OculusGoControllerDataProviderProfile.cs.meta => OculusControllerDataProviderProfile.cs.meta} (100%) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs.meta delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 9963ed2..786accf 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -22,7 +22,7 @@ public class OculusControllerDataProvider : BaseControllerDataProvider /// Name of the data provider as assigned in the configuration profile. /// Data provider priority controls the order in the service registry. /// Controller data provider profile assigned to the provider instance in the configuration inspector. - public OculusControllerDataProvider(string name, uint priority, OculusGoControllerDataProviderProfile profile) + public OculusControllerDataProvider(string name, uint priority, OculusControllerDataProviderProfile profile) : base(name, priority, profile) { } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs new file mode 100644 index 0000000..37aa856 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs @@ -0,0 +1,24 @@ +// Copyright (c) XRTK. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using XRTK.Definitions.Controllers; +using XRTK.Definitions.Utilities; +using XRTK.Oculus.Controllers; + +namespace XRTK.Oculus.Profiles +{ + public class OculusControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile + { + public override ControllerDefinition[] GetDefaultControllerOptions() + { + return new[] + { + new ControllerDefinition(typeof(OculusGoController), Handedness.Left), + new ControllerDefinition(typeof(OculusGoController), Handedness.Right), + new ControllerDefinition(typeof(OculusRemoteController)), + new ControllerDefinition(typeof(OculusTouchController), Handedness.Left), + new ControllerDefinition(typeof(OculusTouchController), Handedness.Right), + }; + } + } +} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs deleted file mode 100644 index e490b28..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusGoControllerDataProviderProfile.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using XRTK.Definitions.Controllers; - -namespace XRTK.Oculus.Profiles -{ - public class OculusGoControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile - { - public override ControllerDefinition[] GetControllerDefinitions() - { - // new MixedRealityControllerMapping("Oculus Go Controller Left", typeof(OculusGoController), Handedness.Left), - // new MixedRealityControllerMapping("Oculus Go Controller Right", typeof(OculusGoController), Handedness.Right), - throw new System.NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs index e96985a..137526e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using UnityEngine; -using XRTK.Definitions.Controllers; using XRTK.Definitions.Controllers.Hands; using XRTK.Definitions.Utilities; @@ -22,10 +21,5 @@ public class OculusHandControllerDataProviderProfile : BaseHandControllerDataPro /// The minimum hand tracking confidence expected. /// public int MinConfidenceRequired => minConfidenceRequired; - - public override ControllerDefinition[] GetControllerDefinitions() - { - throw new System.NotImplementedException(); - } } } \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs deleted file mode 100644 index 05958cf..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using XRTK.Definitions.Controllers; - -namespace XRTK.Oculus.Profiles -{ - public class OculusRemoteControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile - { - public override ControllerDefinition[] GetControllerDefinitions() - { - // new MixedRealityControllerMapping("Oculus Remote Controller", typeof(OculusRemoteController)), - throw new System.NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs.meta deleted file mode 100644 index 378c66e..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusRemoteControllerDataProviderProfile.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 6ec9851caca47084da7d757658375f1d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs deleted file mode 100644 index 5460650..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using XRTK.Definitions.Controllers; - -namespace XRTK.Oculus.Profiles -{ - public class OculusTouchControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile - { - public override ControllerDefinition[] GetControllerDefinitions() - { - // new MixedRealityControllerMapping("Oculus Touch Controller Left", typeof(OculusTouchController), Handedness.Left), - // new MixedRealityControllerMapping("Oculus Touch Controller Right", typeof(OculusTouchController), Handedness.Right), - throw new System.NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs.meta deleted file mode 100644 index ca27a96..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusTouchControllerDataProviderProfile.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: ad754132a294fad4490673a98acb2ef9 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} - userData: - assetBundleName: - assetBundleVariant: From fc1eb0d9bcb4f842881d40e3e9ed8a1b9baa0460 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 8 Apr 2020 01:46:16 -0400 Subject: [PATCH 07/70] updated hand provider inspector --- .../OculusHandControllerDataProviderProfileInspector.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs index 673db26..efcdace 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs @@ -30,8 +30,6 @@ public override void OnInspectorGUI() { RenderHeader(); - EditorGUILayout.LabelField("Oculus Hand Controller Data Provider Settings", EditorStyles.boldLabel); - base.OnInspectorGUI(); serializedObject.Update(); From b7b0deb0b473bcac5f60a0a6274c48c5998438a7 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 8 Apr 2020 22:30:37 -0400 Subject: [PATCH 08/70] fixed hand inspector --- .../OculusHandControllerDataProviderProfileInspector.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs index efcdace..fe5edc9 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs @@ -28,9 +28,8 @@ protected override void OnEnable() public override void OnInspectorGUI() { - RenderHeader(); - base.OnInspectorGUI(); + serializedObject.Update(); EditorGUILayout.Space(); From 3dca42577cb0ab7560a3059833b2ab7562cd06ac Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 8 Apr 2020 22:49:18 -0400 Subject: [PATCH 09/70] cleaned up references --- .../com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 786accf..0f9407e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -9,7 +9,6 @@ using XRTK.Oculus.Extensions; using XRTK.Oculus.Profiles; using XRTK.Providers.Controllers; -using XRTK.Providers.Controllers.Hands; using XRTK.Services; namespace XRTK.Oculus.Controllers From f426ee28a9871568b86939cffab4bee75e099e74 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 8 Apr 2020 22:59:36 -0400 Subject: [PATCH 10/70] cleaned up controller interaction mappings a bit --- .../com.xrtk.oculus/Controllers/BaseOculusController.cs | 3 +-- .../com.xrtk.oculus/Controllers/OculusGoController.cs | 4 ++-- .../com.xrtk.oculus/Controllers/OculusTouchController.cs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs index 5e5a859..f055991 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs @@ -5,7 +5,6 @@ using UnityEngine; using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; -using XRTK.Definitions.InputSystem; using XRTK.Definitions.Utilities; using XRTK.Extensions; using XRTK.Interfaces.InputSystem; @@ -67,7 +66,7 @@ public BaseOculusController(IMixedRealityControllerDataProvider controllerDataPr new MixedRealityInteractionMapping("Button.RThumbstick Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickTouch), new MixedRealityInteractionMapping("Button.RThumbstick Near Touch", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbNearTouch), new MixedRealityInteractionMapping("Button.RThumbstick Press", AxisType.Digital, "RThumbstick", DeviceInputType.ThumbStickPress), - new MixedRealityInteractionMapping("Axis2D.Dpad", AxisType.DualAxis, DeviceInputType.ThumbStick, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Axis2D.Dpad", AxisType.DualAxis, DeviceInputType.ThumbStick), new MixedRealityInteractionMapping("Button.DpadUp Press", AxisType.Digital, "DpadUp", DeviceInputType.ThumbStickPress), new MixedRealityInteractionMapping("Button.DpadDown Press", AxisType.Digital, "DpadDown", DeviceInputType.ThumbStickPress), new MixedRealityInteractionMapping("Button.DpadLeft Press", AxisType.Digital, "DpadLeft", DeviceInputType.ThumbStickPress), diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs index bc8268f..81464f8 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs @@ -21,7 +21,7 @@ public OculusGoController(IMixedRealityControllerDataProvider controllerDataProv /// Note, MUST use RAW button types as that is what the API works with, DO NOT use Virtual! public override MixedRealityInteractionMapping[] DefaultLeftHandedInteractions => new[] { - new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerPress), @@ -41,7 +41,7 @@ public OculusGoController(IMixedRealityControllerDataProvider controllerDataProv /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => new[] { - new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Press", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerPress), diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs index c48af15..ab89986 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs @@ -21,7 +21,7 @@ public OculusTouchController(IMixedRealityControllerDataProvider controllerDataP /// Note, MUST use RAW button types as that is what the API works with, DO NOT use Virtual! public override MixedRealityInteractionMapping[] DefaultLeftHandedInteractions => new[] { - new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger", AxisType.SingleAxis, "LIndexTrigger", DeviceInputType.Trigger), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerTouch), new MixedRealityInteractionMapping("Axis1D.PrimaryIndexTrigger Near Touch", AxisType.Digital, "LIndexTrigger", DeviceInputType.TriggerNearTouch), @@ -45,7 +45,7 @@ public OculusTouchController(IMixedRealityControllerDataProvider controllerDataP /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => new[] { - new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer), new MixedRealityInteractionMapping("Axis1D.SecondaryIndexTrigger", AxisType.SingleAxis, "RIndexTrigger", DeviceInputType.Trigger), new MixedRealityInteractionMapping("Axis1D.SecondaryIndexTrigger Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerTouch), new MixedRealityInteractionMapping("Axis1D.SecondaryIndexTrigger Near Touch", AxisType.Digital, "RIndexTrigger", DeviceInputType.TriggerNearTouch), From b5cfb2a21ef60abd19888718e2d471b121ef86b5 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 03:03:05 -0400 Subject: [PATCH 11/70] updated references fixed GetCOntroller return types --- .../Controllers/BaseOculusController.cs | 2 +- .../Controllers/OculusControllerDataProvider.cs | 11 ++--------- .../com.xrtk.oculus/Controllers/OculusGoController.cs | 1 - .../Controllers/OculusTouchController.cs | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs index f055991..bab9e3f 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs @@ -3,13 +3,13 @@ using System; using UnityEngine; -using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; using XRTK.Extensions; using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Extensions; +using XRTK.Providers.Controllers; using XRTK.Services; namespace XRTK.Oculus.Controllers diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 0f9407e..589ca44 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using UnityEngine; -using XRTK.Definitions.Controllers.OpenVR; using XRTK.Definitions.Devices; using XRTK.Oculus.Extensions; using XRTK.Oculus.Profiles; @@ -229,7 +228,7 @@ private void RaiseSourceLost(OculusApi.Controller activeController, bool clearFr } } - private Type GetCurrentControllerType(OculusApi.Controller controllerMask) + private static Type GetCurrentControllerType(OculusApi.Controller controllerMask) { switch (controllerMask) { @@ -242,15 +241,9 @@ private Type GetCurrentControllerType(OculusApi.Controller controllerMask) case OculusApi.Controller.LTrackedRemote: case OculusApi.Controller.RTrackedRemote: return typeof(OculusGoController); - case OculusApi.Controller.Hands: - case OculusApi.Controller.LHand: - case OculusApi.Controller.RHand: + default: return null; } - - Debug.LogWarning($"{controllerMask} does not have a defined controller type, falling back to {nameof(GenericOpenVRController)}"); - - return typeof(GenericOpenVRController); } } } \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs index 81464f8..114ad12 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using XRTK.Definitions.Devices; -using XRTK.Definitions.InputSystem; using XRTK.Definitions.Utilities; using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs index ab89986..f29b05a 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using XRTK.Definitions.Devices; -using XRTK.Definitions.InputSystem; using XRTK.Definitions.Utilities; using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; From 257490cbe1dbebb901dc39d0a0486d858523d0eb Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 13:07:19 -0400 Subject: [PATCH 12/70] updated controller instance creation --- .../Controllers/BaseOculusController.cs | 6 ++--- .../OculusControllerDataProvider.cs | 26 ++++++++++--------- .../Controllers/OculusGoController.cs | 6 ++--- .../OculusHandControllerDataProvider.cs | 21 ++++++--------- .../Controllers/OculusRemoteController.cs | 6 ++--- .../Controllers/OculusTouchController.cs | 6 ++--- 6 files changed, 34 insertions(+), 37 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs index bab9e3f..53a1019 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs @@ -3,10 +3,10 @@ using System; using UnityEngine; +using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; using XRTK.Extensions; -using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Extensions; using XRTK.Providers.Controllers; @@ -17,8 +17,8 @@ namespace XRTK.Oculus.Controllers public class BaseOculusController : BaseController { /// - public BaseOculusController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, OculusApi.Controller controllerType, OculusApi.Node nodeType, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) - : base(controllerDataProvider, trackingState, controllerHandedness, inputSource, interactions) + public BaseOculusController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile) { ControllerType = controllerType; NodeType = nodeType; diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 589ca44..61518b0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -25,7 +25,7 @@ public OculusControllerDataProvider(string name, uint priority, OculusController { } - private const float DeviceRefreshInterval = 3.0f; + private const float DEVICE_REFRESH_INTERVAL = 3.0f; /// /// Dictionary to capture all active controllers detected @@ -57,7 +57,7 @@ public override void Update() deviceRefreshTimer += Time.unscaledDeltaTime; - if (deviceRefreshTimer >= DeviceRefreshInterval) + if (deviceRefreshTimer >= DEVICE_REFRESH_INTERVAL) { deviceRefreshTimer = 0.0f; RefreshDevices(); @@ -106,23 +106,25 @@ private BaseOculusController GetOrAddController(OculusApi.Controller controllerM var controllerType = GetCurrentControllerType(controllerMask); - var controllingHand = controllerMask.ToHandedness(); - var nodeType = controllingHand.ToNode(); + var handedness = controllerMask.ToHandedness(); + var nodeType = handedness.ToNode(); - var pointers = RequestPointers(typeof(BaseOculusController), controllingHand); - var inputSource = MixedRealityToolkit.InputSystem?.RequestNewGenericInputSource($"{controllerType.Name} {controllingHand}", pointers); - var detectedController = new BaseOculusController(this, TrackingState.NotTracked, controllingHand, controllerMask, nodeType, inputSource); + BaseOculusController detectedController; - if (!detectedController.SetupConfiguration(controllerType)) + try { - // Controller failed to be setup correctly. - // Return null so we don't raise the source detected. + detectedController = Activator.CreateInstance(controllerType, this, TrackingState.NotTracked, handedness, GetControllerMappingProfile(controllerType, handedness), controllerMask, nodeType) as BaseOculusController; + } + catch (Exception e) + { + Debug.LogError($"Failed to create {controllerType.Name} controller!\n{e}"); return null; } - for (int i = 0; i < detectedController.InputSource?.Pointers?.Length; i++) + if (detectedController == null) { - detectedController.InputSource.Pointers[i].Controller = detectedController; + Debug.LogError($"Failed to create {controllerType.Name} controller!"); + return null; } detectedController.TryRenderControllerModel(controllerType); diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs index 114ad12..bbf6186 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs @@ -1,9 +1,9 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; -using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; namespace XRTK.Oculus.Controllers @@ -11,8 +11,8 @@ namespace XRTK.Oculus.Controllers public class OculusGoController : BaseOculusController { /// - public OculusGoController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) - : base(controllerDataProvider, trackingState, controllerHandedness, OculusApi.Controller.None, OculusApi.Node.None, inputSource, interactions) + public OculusGoController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile, controllerType, nodeType) { } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs index 4820b44..a1fb4ad 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs @@ -1,6 +1,7 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System; using System.Collections.Generic; using UnityEngine; using XRTK.Definitions.Devices; @@ -119,24 +120,18 @@ private MixedRealityHandController GetOrAddController(Handedness handedness) return existingController; } - var controllerType = typeof(MixedRealityHandController); - var pointers = RequestPointers(controllerType, handedness, true); - var inputSource = MixedRealityToolkit.InputSystem.RequestNewGenericInputSource($"{handedness} Hand Controller", pointers); - var detectedController = new MixedRealityHandController(this, TrackingState.Tracked, handedness, inputSource); - - if (!detectedController.SetupConfiguration(controllerType)) + MixedRealityHandController detectedController; + try { - // Controller failed to be setup correctly. - // Return null so we don't raise the source detected. - return null; + detectedController = new MixedRealityHandController(this, TrackingState.Tracked, handedness, GetControllerMappingProfile(typeof(MixedRealityHandController), handedness)); } - - for (int i = 0; i < detectedController.InputSource?.Pointers?.Length; i++) + catch (Exception e) { - detectedController.InputSource.Pointers[i].Controller = detectedController; + Debug.LogError($"Failed to create {nameof(MixedRealityHandController)}!\n{e}"); + return null; } - detectedController.TryRenderControllerModel(controllerType); + detectedController.TryRenderControllerModel(typeof(MixedRealityHandController)); AddController(detectedController); activeControllers.Add(handedness, detectedController); MixedRealityToolkit.InputSystem?.RaiseSourceDetected(detectedController.InputSource, detectedController); diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs index 5001354..3410c6c 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs @@ -1,9 +1,9 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; -using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; namespace XRTK.Oculus.Controllers @@ -11,8 +11,8 @@ namespace XRTK.Oculus.Controllers public class OculusRemoteController : BaseOculusController { /// - public OculusRemoteController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) - : base(controllerDataProvider, trackingState, controllerHandedness, OculusApi.Controller.None, OculusApi.Node.None, inputSource, interactions) + public OculusRemoteController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile, controllerType, nodeType) { } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs index f29b05a..011312d 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs @@ -1,9 +1,9 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; -using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; namespace XRTK.Oculus.Controllers @@ -11,8 +11,8 @@ namespace XRTK.Oculus.Controllers public class OculusTouchController : BaseOculusController { /// - public OculusTouchController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) - : base(controllerDataProvider, trackingState, controllerHandedness, OculusApi.Controller.None, OculusApi.Node.None, inputSource, interactions) + public OculusTouchController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile, controllerType, nodeType) { } From 2581c2848dcb6e1a727f913d98296eae607a12d6 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 18:34:28 -0400 Subject: [PATCH 13/70] added default constructor --- .../Controllers/BaseOculusController.cs | 10 ++++++---- .../com.xrtk.oculus/Controllers/OculusGoController.cs | 4 +++- .../Controllers/OculusRemoteController.cs | 4 +++- .../Controllers/OculusTouchController.cs | 4 +++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs index 53a1019..976076a 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs @@ -14,10 +14,12 @@ namespace XRTK.Oculus.Controllers { - public class BaseOculusController : BaseController + public abstract class BaseOculusController : BaseController { + public BaseOculusController() : base() { } + /// - public BaseOculusController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + protected BaseOculusController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType = OculusApi.Controller.None, OculusApi.Node nodeType = OculusApi.Node.None) : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile) { ControllerType = controllerType; @@ -27,12 +29,12 @@ public BaseOculusController(IMixedRealityControllerDataProvider controllerDataPr /// /// The Oculus Node Type. /// - public OculusApi.Node NodeType { get; } + private OculusApi.Node NodeType { get; } /// /// The Oculus Controller Type. /// - public OculusApi.Controller ControllerType { get; } + private OculusApi.Controller ControllerType { get; } private OculusApi.ControllerState4 previousState = new OculusApi.ControllerState4(); private OculusApi.ControllerState4 currentState = new OculusApi.ControllerState4(); diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs index bbf6186..3abc622 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs @@ -10,8 +10,10 @@ namespace XRTK.Oculus.Controllers { public class OculusGoController : BaseOculusController { + public OculusGoController() : base() { } + /// - public OculusGoController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + public OculusGoController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType = OculusApi.Controller.None, OculusApi.Node nodeType = OculusApi.Node.None) : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile, controllerType, nodeType) { } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs index 3410c6c..7a8f739 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs @@ -10,8 +10,10 @@ namespace XRTK.Oculus.Controllers { public class OculusRemoteController : BaseOculusController { + public OculusRemoteController() : base() { } + /// - public OculusRemoteController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + public OculusRemoteController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType = OculusApi.Controller.None, OculusApi.Node nodeType = OculusApi.Node.None) : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile, controllerType, nodeType) { } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs index 011312d..fa46072 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs @@ -10,8 +10,10 @@ namespace XRTK.Oculus.Controllers { public class OculusTouchController : BaseOculusController { + public OculusTouchController() : base() { } + /// - public OculusTouchController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType, OculusApi.Node nodeType) + public OculusTouchController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile, OculusApi.Controller controllerType = OculusApi.Controller.None, OculusApi.Node nodeType = OculusApi.Node.None) : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile, controllerType, nodeType) { } From 1326d4035aad5e1a96743d1446b53c77bcb683b1 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 20:13:44 -0400 Subject: [PATCH 14/70] updated TryRenderController method --- .../com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs | 2 +- .../Controllers/OculusHandControllerDataProvider.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 61518b0..2d8900c 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -127,7 +127,7 @@ private BaseOculusController GetOrAddController(OculusApi.Controller controllerM return null; } - detectedController.TryRenderControllerModel(controllerType); + detectedController.TryRenderControllerModel(); activeControllers.Add(controllerMask, detectedController); AddController(detectedController); diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs index a1fb4ad..eb0d22d 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs @@ -131,7 +131,7 @@ private MixedRealityHandController GetOrAddController(Handedness handedness) return null; } - detectedController.TryRenderControllerModel(typeof(MixedRealityHandController)); + detectedController.TryRenderControllerModel(); AddController(detectedController); activeControllers.Add(handedness, detectedController); MixedRealityToolkit.InputSystem?.RaiseSourceDetected(detectedController.InputSource, detectedController); From cfc3d9c2861d7577402e300a27f5523c3ce21908 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 02:20:26 -0400 Subject: [PATCH 15/70] removed asset menu --- .../Profiles/OculusHandControllerDataProviderProfile.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs index 137526e..f8409c5 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusHandControllerDataProviderProfile.cs @@ -3,14 +3,12 @@ using UnityEngine; using XRTK.Definitions.Controllers.Hands; -using XRTK.Definitions.Utilities; namespace XRTK.Oculus.Profiles { /// /// Configuration profile for Oculus hand controllers. /// - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Data Providers/Oculus Hand", fileName = "OculusHandControllerDataProviderProfile", order = (int)CreateProfileMenuItemIndices.Input)] public class OculusHandControllerDataProviderProfile : BaseHandControllerDataProviderProfile { [SerializeField] From 3921db6d843f82c1d00065067a26c079b4a5efdf Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 11 Apr 2020 14:30:55 +0200 Subject: [PATCH 16/70] Remove obsolete SetupDefaultInteractions (#53) --- .../com.xrtk.oculus/Controllers/BaseOculusController.cs | 6 ------ .../com.xrtk.oculus/Controllers/OculusGoController.cs | 6 ------ .../com.xrtk.oculus/Controllers/OculusRemoteController.cs | 6 ------ .../com.xrtk.oculus/Controllers/OculusTouchController.cs | 6 ------ 4 files changed, 24 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs index 976076a..8452f9b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/BaseOculusController.cs @@ -82,12 +82,6 @@ protected BaseOculusController(IMixedRealityControllerDataProvider controllerDat /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => DefaultInteractions; - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } - private MixedRealityPose currentPointerPose = MixedRealityPose.ZeroIdentity; private MixedRealityPose lastControllerPose = MixedRealityPose.ZeroIdentity; private MixedRealityPose currentControllerPose = MixedRealityPose.ZeroIdentity; diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs index 3abc622..838f15e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusGoController.cs @@ -58,11 +58,5 @@ public OculusGoController(IMixedRealityControllerDataProvider controllerDataProv new MixedRealityInteractionMapping("Button.DpadLeft", AxisType.Digital, "DpadLeft", DeviceInputType.ButtonPress), new MixedRealityInteractionMapping("Button.DpadRight", AxisType.Digital, "DpadRight", DeviceInputType.ButtonPress), }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); - } } } \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs index 7a8f739..d0c5b73 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusRemoteController.cs @@ -30,11 +30,5 @@ public OculusRemoteController(IMixedRealityControllerDataProvider controllerData new MixedRealityInteractionMapping("Button.Start", AxisType.Digital, "Start", DeviceInputType.ButtonPress), new MixedRealityInteractionMapping("Button.Back", AxisType.Digital, "Back", DeviceInputType.ButtonPress), }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } } } \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs index fa46072..6044e7c 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusTouchController.cs @@ -65,11 +65,5 @@ public OculusTouchController(IMixedRealityControllerDataProvider controllerDataP new MixedRealityInteractionMapping("Touch.SecondaryThumbRest Touch", AxisType.Digital, "RThumbRest", DeviceInputType.ThumbTouch), new MixedRealityInteractionMapping("Touch.SecondaryThumbRest Near Touch", AxisType.Digital, "RThumbRest", DeviceInputType.ThumbNearTouch) }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); - } } } \ No newline at end of file From 510179839feb76ec1a697f325f6718ff149d0863 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 15:10:05 -0400 Subject: [PATCH 17/70] updated references to camera system --- .../Controllers/OculusControllerDataProvider.cs | 5 +---- .../Controllers/OculusHandControllerDataProvider.cs | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 63ae0dc..03012d9 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -40,10 +40,7 @@ public override void Initialize() { base.Initialize(); - if (MixedRealityToolkit.CameraSystem != null) - { - MixedRealityToolkit.CameraSystem.HeadHeight = OculusApi.EyeHeight; - } + MixedRealityToolkit.CameraSystem?.SetHeadHeight(OculusApi.EyeHeight); } /// diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs index 4820b44..0506566 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs @@ -42,11 +42,7 @@ public override void Initialize() { base.Initialize(); - if (MixedRealityToolkit.CameraSystem != null) - { - MixedRealityToolkit.CameraSystem.HeadHeight = OculusApi.EyeHeight; - } - + MixedRealityToolkit.CameraSystem?.SetHeadHeight(OculusApi.EyeHeight); OculusHandDataConverter.HandMeshingEnabled = HandMeshingEnabled; } From b8472ee4f71a3a4fc8e076f40fbf52978a52cebd Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 17:45:31 -0400 Subject: [PATCH 18/70] Changed timing of initialization to prevent race condition --- .../Controllers/OculusControllerDataProvider.cs | 4 ++-- .../Controllers/OculusHandControllerDataProvider.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 03012d9..67376a8 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -36,9 +36,9 @@ public OculusControllerDataProvider(string name, uint priority, BaseMixedReality private OculusApi.Controller lastDeviceList; /// - public override void Initialize() + public override void Enable() { - base.Initialize(); + base.Enable(); MixedRealityToolkit.CameraSystem?.SetHeadHeight(OculusApi.EyeHeight); } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs index 0506566..d919884 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs @@ -38,9 +38,9 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo public OculusApi.TrackingConfidence MinConfidenceRequired { get; } = OculusApi.TrackingConfidence.Low; /// - public override void Initialize() + public override void Enable() { - base.Initialize(); + base.Enable(); MixedRealityToolkit.CameraSystem?.SetHeadHeight(OculusApi.EyeHeight); OculusHandDataConverter.HandMeshingEnabled = HandMeshingEnabled; From 6c70c60d53338f1718d2425c2bd234d60796fce0 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 20:27:50 -0400 Subject: [PATCH 19/70] updated hands inspector --- .../OculusHandControllerDataProviderProfileInspector.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs index fe5edc9..983fe5a 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs @@ -32,8 +32,7 @@ public override void OnInspectorGUI() serializedObject.Update(); - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Oculus Hand Settings"); + EditorGUILayout.LabelField("Oculus Hand Settings", EditorStyles.boldLabel); minConfidenceRequired.intValue = (int)(OculusApi.TrackingConfidence)EditorGUILayout.EnumPopup(confidenceContent, (OculusApi.TrackingConfidence)minConfidenceRequired.intValue); serializedObject.ApplyModifiedProperties(); From 2badc3f6bb620940774e3fa08dc5e0b50e6eca4d Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 14 Apr 2020 00:08:53 -0400 Subject: [PATCH 20/70] updated constructors for data providers --- .../Controllers/OculusControllerDataProvider.cs | 12 ++++-------- .../Controllers/OculusHandControllerDataProvider.cs | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index 63ae0dc..dde2c32 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -5,6 +5,7 @@ using UnityEngine; using XRTK.Definitions.Controllers; using XRTK.Definitions.Devices; +using XRTK.Interfaces.InputSystem; using XRTK.Oculus.Extensions; using XRTK.Providers.Controllers; using XRTK.Services; @@ -13,14 +14,9 @@ namespace XRTK.Oculus.Controllers { public class OculusControllerDataProvider : BaseControllerDataProvider { - /// - /// Constructor. - /// - /// Name of the data provider as assigned in the configuration profile. - /// Data provider priority controls the order in the service registry. - /// Controller data provider profile assigned to the provider instance in the configuration inspector. - public OculusControllerDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile) - : base(name, priority, profile) + /// + public OculusControllerDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile, IMixedRealityInputSystem parentService) + : base(name, priority, profile, parentService) { } diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs index 4820b44..1526d76 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs @@ -5,6 +5,7 @@ using UnityEngine; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; +using XRTK.Interfaces.InputSystem; using XRTK.Oculus.Profiles; using XRTK.Providers.Controllers.Hands; using XRTK.Services; @@ -13,14 +14,9 @@ namespace XRTK.Oculus.Controllers { public class OculusHandControllerDataProvider : BaseHandControllerDataProvider { - /// - /// Constructor. - /// - /// Name of the data provider as assigned in the configuration profile. - /// Data provider priority controls the order in the service registry. - /// Controller data provider profile assigned to the provider instance in the configuration inspector. - public OculusHandControllerDataProvider(string name, uint priority, OculusHandControllerDataProviderProfile profile) - : base(name, priority, profile) + /// + public OculusHandControllerDataProvider(string name, uint priority, OculusHandControllerDataProviderProfile profile, IMixedRealityInputSystem parentService) + : base(name, priority, profile, parentService) { MinConfidenceRequired = (OculusApi.TrackingConfidence)profile.MinConfidenceRequired; } From 6723ff75c5acf7234676122de340828a87cb5f65 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Wed, 15 Apr 2020 14:37:22 +0200 Subject: [PATCH 21/70] Change requests for controller provider inspectors (#55) * Update indent levels for oculus settings * Cache GUIContent --- ...ulusHandControllerDataProviderProfileInspector.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs index 983fe5a..1e64a93 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Inspectors/OculusHandControllerDataProviderProfileInspector.cs @@ -3,6 +3,7 @@ using UnityEditor; using UnityEngine; +using XRTK.Inspectors.Extensions; using XRTK.Inspectors.Profiles.InputSystem.Controllers; using XRTK.Oculus.Profiles; @@ -16,7 +17,9 @@ public class OculusHandControllerDataProviderProfileInspector : BaseMixedReality { private SerializedProperty minConfidenceRequired; + private bool showOculusHandTrackingSettings = true; private GUIContent confidenceContent; + private static readonly GUIContent oculusHandSettingsFoldoutHeader = new GUIContent("Oculus Hand Tracking Settings"); protected override void OnEnable() { @@ -32,8 +35,13 @@ public override void OnInspectorGUI() serializedObject.Update(); - EditorGUILayout.LabelField("Oculus Hand Settings", EditorStyles.boldLabel); - minConfidenceRequired.intValue = (int)(OculusApi.TrackingConfidence)EditorGUILayout.EnumPopup(confidenceContent, (OculusApi.TrackingConfidence)minConfidenceRequired.intValue); + showOculusHandTrackingSettings = EditorGUILayoutExtensions.FoldoutWithBoldLabel(showOculusHandTrackingSettings, oculusHandSettingsFoldoutHeader, true); + if (showOculusHandTrackingSettings) + { + EditorGUI.indentLevel++; + minConfidenceRequired.intValue = (int)(OculusApi.TrackingConfidence)EditorGUILayout.EnumPopup(confidenceContent, (OculusApi.TrackingConfidence)minConfidenceRequired.intValue); + EditorGUI.indentLevel--; + } serializedObject.ApplyModifiedProperties(); } From d45257831c2a35090af11a9149a0b3aba9ec95cf Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Wed, 15 Apr 2020 17:38:21 +0200 Subject: [PATCH 22/70] Update Oculus hand data converter --- .../Controllers/OculusHandControllerDataProvider.cs | 6 ++++-- .../Controllers/OculusHandDataConverter.cs | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs index 6e1c783..bd16b21 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs @@ -20,10 +20,12 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo : base(name, priority, profile, parentService) { MinConfidenceRequired = (OculusApi.TrackingConfidence)profile.MinConfidenceRequired; + leftHandConverter = new OculusHandDataConverter(Handedness.Left, TrackedPoses); + rightHandConverter = new OculusHandDataConverter(Handedness.Right, TrackedPoses); } - private readonly OculusHandDataConverter leftHandConverter = new OculusHandDataConverter(Handedness.Left); - private readonly OculusHandDataConverter rightHandConverter = new OculusHandDataConverter(Handedness.Right); + private readonly OculusHandDataConverter leftHandConverter; + private readonly OculusHandDataConverter rightHandConverter; private readonly Dictionary activeControllers = new Dictionary(); private OculusApi.HandState leftHandState = default; diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs index 97ca2c9..93d5f4b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs @@ -5,21 +5,24 @@ using System.Collections.Generic; using UnityEngine; using XRTK.Definitions.Controllers.Hands; +using XRTK.Definitions.Controllers.Simulation.Hands; using XRTK.Definitions.Utilities; using XRTK.Oculus.Extensions; +using XRTK.Providers.Controllers.Hands; namespace XRTK.Oculus.Controllers { /// /// Converts oculus hand data to . /// - public sealed class OculusHandDataConverter + public sealed class OculusHandDataConverter : BaseHandDataConverter { /// /// Constructor. /// /// Handedness of the hand this converter is created for. - public OculusHandDataConverter(Handedness handedness) + /// The tracked poses collection to use for pose recognition. + public OculusHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) { this.handedness = handedness; } @@ -73,6 +76,7 @@ public HandData GetHandData() } } + PostProcess(updatedHandData); return updatedHandData; } From 7275f21a21b78067590044013881961b4eac2b17 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 16 Apr 2020 13:36:15 +0200 Subject: [PATCH 23/70] Remove redundant handedness field --- .../Controllers/OculusHandDataConverter.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs index 93d5f4b..a85177e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs @@ -23,12 +23,9 @@ public sealed class OculusHandDataConverter : BaseHandDataConverter /// Handedness of the hand this converter is created for. /// The tracked poses collection to use for pose recognition. public OculusHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) - { - this.handedness = handedness; - } + { } private readonly Dictionary boneProxyTransforms = new Dictionary(); - private readonly Handedness handedness; private bool isInitialized = false; private OculusApi.Skeleton handSkeleton = new OculusApi.Skeleton(); @@ -48,17 +45,17 @@ public HandData GetHandData() { if (!isInitialized) { - isInitialized = OculusApi.GetSkeleton(handedness.ToSkeletonType(), out handSkeleton); + isInitialized = OculusApi.GetSkeleton(Handedness.ToSkeletonType(), out handSkeleton); if (!isInitialized) { - Debug.LogError($"{GetType().Name} - {handedness} failed to initialize."); + Debug.LogError($"{GetType().Name} - {Handedness} failed to initialize."); return null; } } HandData updatedHandData = new HandData { - IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, handedness.ToHand(), ref handState), + IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, Handedness.ToHand(), ref handState), TimeStamp = DateTimeOffset.UtcNow.Ticks }; @@ -177,7 +174,7 @@ private void UpdateHandJoints(MixedRealityPose[] jointPoses) private bool TryGetUpdatedHandMeshData(out HandMeshData data) { - if (OculusApi.GetMesh(handedness.ToMeshType(), out handMesh)) + if (OculusApi.GetMesh(Handedness.ToMeshType(), out handMesh)) { Vector3[] vertices = new Vector3[handMesh.NumVertices]; @@ -296,7 +293,7 @@ private MixedRealityPose FixRotation(MixedRealityPose bonePose) { // WARNING THIS CODE IS SUBJECT TO CHANGE WITH THE OCULUS SDK // - This fix is a hack to fix broken and inconsistent rotations for hands. - if (handedness == Handedness.Left) + if (Handedness == Handedness.Left) { // Rotate bone 180 degrees on X to flip up. bonePose.Rotation *= Quaternion.Euler(180f, 0f, 0f); @@ -325,7 +322,7 @@ private Transform GetProxyTransform(OculusApi.BoneId boneId) return boneProxyTransforms[(int)boneId]; } - var transform = new GameObject($"Oculus Hand {handedness} {boneId} Proxy").transform; + var transform = new GameObject($"Oculus Hand {Handedness} {boneId} Proxy").transform; boneProxyTransforms.Add((int)boneId, transform); return transform; From 816c3950ad99efa0432e82c838a94c8e842af28d Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 16 Apr 2020 15:10:58 +0200 Subject: [PATCH 24/70] Update due to rename --- .../com.xrtk.oculus/Controllers/OculusHandDataConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs index a85177e..d548a67 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs @@ -22,7 +22,7 @@ public sealed class OculusHandDataConverter : BaseHandDataConverter /// /// Handedness of the hand this converter is created for. /// The tracked poses collection to use for pose recognition. - public OculusHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) + public OculusHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) { } private readonly Dictionary boneProxyTransforms = new Dictionary(); From ff10a5fe6927a554782c02f49b5ed2b55079e211 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 16 Apr 2020 15:26:13 +0200 Subject: [PATCH 25/70] Cleanup usings --- .../com.xrtk.oculus/Controllers/OculusHandDataConverter.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs index d548a67..3dfef9c 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandDataConverter.cs @@ -5,7 +5,6 @@ using System.Collections.Generic; using UnityEngine; using XRTK.Definitions.Controllers.Hands; -using XRTK.Definitions.Controllers.Simulation.Hands; using XRTK.Definitions.Utilities; using XRTK.Oculus.Extensions; using XRTK.Providers.Controllers.Hands; From 6d029ef4bbec7fa00ce0a5e07eb03948104bf252 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 18 Apr 2020 23:13:50 -0400 Subject: [PATCH 26/70] Removed head height settings in controllers --- .../Controllers/OculusControllerDataProvider.cs | 8 -------- .../Controllers/OculusHandControllerDataProvider.cs | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs index b26831e..1d9a02f 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusControllerDataProvider.cs @@ -31,14 +31,6 @@ public OculusControllerDataProvider(string name, uint priority, BaseMixedReality private float deviceRefreshTimer; private OculusApi.Controller lastDeviceList; - /// - public override void Enable() - { - base.Enable(); - - MixedRealityToolkit.CameraSystem?.SetHeadHeight(OculusApi.EyeHeight); - } - /// public override void Update() { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs index f6abc73..f93aa7a 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Controllers/OculusHandControllerDataProvider.cs @@ -31,14 +31,13 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo /// /// The minimum required tracking confidence for hands to be registered. /// - public OculusApi.TrackingConfidence MinConfidenceRequired { get; } = OculusApi.TrackingConfidence.Low; + public OculusApi.TrackingConfidence MinConfidenceRequired { get; } /// public override void Enable() { base.Enable(); - MixedRealityToolkit.CameraSystem?.SetHeadHeight(OculusApi.EyeHeight); OculusHandDataConverter.HandMeshingEnabled = HandMeshingEnabled; } From 998693996996ffea925e86dfea6fbef05c353a6d Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sun, 19 Apr 2020 11:29:57 -0400 Subject: [PATCH 27/70] added initial platform definition for Oculus --- .../Packages/com.xrtk.oculus/Runtime.meta | 8 ++++++ .../com.xrtk.oculus/Runtime/OculusPlatform.cs | 26 +++++++++++++++++++ .../Runtime/OculusPlatform.cs.meta | 11 ++++++++ .../com.xrtk.oculus/Runtime/Providers.meta | 8 ++++++ .../Providers/OculusCameraDataProvider.cs | 26 +++++++++++++++++++ .../OculusCameraDataProvider.cs.meta | 11 ++++++++ 6 files changed, 90 insertions(+) create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime.meta create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime.meta new file mode 100644 index 0000000..3031875 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a81af84b47834f4ca2df9c31b88d97d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs new file mode 100644 index 0000000..073b1c3 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs @@ -0,0 +1,26 @@ +using XRTK.Definitions.Platforms; + +namespace XRTK.Oculus +{ + public class OculusPlatform : BasePlatform + { + /// + public override bool IsAvailable => !UnityEngine.Application.isEditor && OculusApi.Version != null && OculusApi.Initialized; + + /// + public override bool IsBuildTargetAvailable + { + get + { +#if UNITY_EDITOR + return (UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.Android || + UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows || + UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows64) && + OculusApi.Version != null && OculusApi.Initialized; +#else + return false; +#endif + } + } + } +} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta new file mode 100644 index 0000000..b9f7dfb --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 405597ab1b0d16c42a4674b4a0094712 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta new file mode 100644 index 0000000..6c57f8f --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b2b124285c4ed641bb7f8ff50265b16 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs new file mode 100644 index 0000000..2e7a77d --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs @@ -0,0 +1,26 @@ +// Copyright (c) XRTK. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using XRTK.Definitions.CameraSystem; +using XRTK.Interfaces.CameraSystem; +using XRTK.Providers.CameraSystem; + +namespace XRTK.Oculus.Providers.CameraSystem +{ + public class OculusCameraDataProvider : BaseCameraDataProvider + { + /// + public OculusCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile, IMixedRealityCameraSystem parentService) + : base(name, priority, profile, parentService) + { + } + + /// + protected override void ApplySettingsForDefaultHeadHeight() + { + HeadHeight = OculusApi.EyeHeight; + ResetRigTransforms(); + SyncRigTransforms(); + } + } +} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta new file mode 100644 index 0000000..6c29288 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7653e967924f2e045a21d8596dc0f7c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 31c3b683f6b65a686a3d98ea5d87845348a75621 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sun, 19 Apr 2020 11:33:18 -0400 Subject: [PATCH 28/70] removed --- .../com.xrtk.oculus/Runtime/Providers.meta | 8 ------ .../Providers/OculusCameraDataProvider.cs | 26 ------------------- .../OculusCameraDataProvider.cs.meta | 11 -------- 3 files changed, 45 deletions(-) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta deleted file mode 100644 index 6c57f8f..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6b2b124285c4ed641bb7f8ff50265b16 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs deleted file mode 100644 index 2e7a77d..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using XRTK.Definitions.CameraSystem; -using XRTK.Interfaces.CameraSystem; -using XRTK.Providers.CameraSystem; - -namespace XRTK.Oculus.Providers.CameraSystem -{ - public class OculusCameraDataProvider : BaseCameraDataProvider - { - /// - public OculusCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile, IMixedRealityCameraSystem parentService) - : base(name, priority, profile, parentService) - { - } - - /// - protected override void ApplySettingsForDefaultHeadHeight() - { - HeadHeight = OculusApi.EyeHeight; - ResetRigTransforms(); - SyncRigTransforms(); - } - } -} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta deleted file mode 100644 index 6c29288..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7653e967924f2e045a21d8596dc0f7c3 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: From 4c8873da11d6fc9278022abf3128ba9c4e41a298 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sun, 19 Apr 2020 11:34:37 -0400 Subject: [PATCH 29/70] Added Oculus Camera Data Providers --- .../com.xrtk.oculus/Runtime/Providers.meta | 8 ++++++ .../Providers/OculusCameraDataProvider.cs | 26 +++++++++++++++++++ .../OculusCameraDataProvider.cs.meta | 11 ++++++++ 3 files changed, 45 insertions(+) create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta new file mode 100644 index 0000000..6c57f8f --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b2b124285c4ed641bb7f8ff50265b16 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs new file mode 100644 index 0000000..2e7a77d --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs @@ -0,0 +1,26 @@ +// Copyright (c) XRTK. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using XRTK.Definitions.CameraSystem; +using XRTK.Interfaces.CameraSystem; +using XRTK.Providers.CameraSystem; + +namespace XRTK.Oculus.Providers.CameraSystem +{ + public class OculusCameraDataProvider : BaseCameraDataProvider + { + /// + public OculusCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile, IMixedRealityCameraSystem parentService) + : base(name, priority, profile, parentService) + { + } + + /// + protected override void ApplySettingsForDefaultHeadHeight() + { + HeadHeight = OculusApi.EyeHeight; + ResetRigTransforms(); + SyncRigTransforms(); + } + } +} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta new file mode 100644 index 0000000..6c29288 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7653e967924f2e045a21d8596dc0f7c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 247f1a00c16d8fa46b55b32d64ed2c7f0953180f Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 20 Apr 2020 11:55:03 -0400 Subject: [PATCH 30/70] updated icons --- .../Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta | 2 +- .../Runtime/Providers/OculusCameraDataProvider.cs.meta | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta index b9f7dfb..171d685 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta index 6c29288..89003db 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {instanceID: 0} + icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} userData: assetBundleName: assetBundleVariant: From 65c585532c327338c13d1d6d4c27e33598c0264b Mon Sep 17 00:00:00 2001 From: "Simon (Darkside) Jackson" Date: Mon, 20 Apr 2020 17:38:42 +0100 Subject: [PATCH 31/70] Updated platform check for Version and check headset connected for runtime. (#59) Tested on platform --- .../Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs index 073b1c3..12dc1d4 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs @@ -4,8 +4,10 @@ namespace XRTK.Oculus { public class OculusPlatform : BasePlatform { + private static System.Version noVersion = new System.Version(); + /// - public override bool IsAvailable => !UnityEngine.Application.isEditor && OculusApi.Version != null && OculusApi.Initialized; + public override bool IsAvailable => !UnityEngine.Application.isEditor && OculusApi.Version > noVersion && OculusApi.Initialized; /// public override bool IsBuildTargetAvailable @@ -16,11 +18,11 @@ public override bool IsBuildTargetAvailable return (UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.Android || UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows || UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows64) && - OculusApi.Version != null && OculusApi.Initialized; + OculusApi.Version > noVersion; #else return false; #endif } } } -} +} \ No newline at end of file From b11afbf2ec3e7a8f42a92076e871e3ca054e9248 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 20 Apr 2020 13:26:00 -0400 Subject: [PATCH 32/70] Added platform overrides --- .../com.xrtk.oculus/Runtime/OculusPlatform.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs index 12dc1d4..44a16c9 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/OculusPlatform.cs @@ -1,13 +1,17 @@ -using XRTK.Definitions.Platforms; +// Copyright (c) XRTK. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +using XRTK.Definitions.Platforms; +using XRTK.Interfaces; namespace XRTK.Oculus { public class OculusPlatform : BasePlatform { - private static System.Version noVersion = new System.Version(); + private static readonly System.Version NoVersion = new System.Version(); /// - public override bool IsAvailable => !UnityEngine.Application.isEditor && OculusApi.Version > noVersion && OculusApi.Initialized; + public override bool IsAvailable => !UnityEngine.Application.isEditor && OculusApi.Version > NoVersion && OculusApi.Initialized; /// public override bool IsBuildTargetAvailable @@ -18,11 +22,18 @@ public override bool IsBuildTargetAvailable return (UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.Android || UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows || UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.StandaloneWindows64) && - OculusApi.Version > noVersion; + OculusApi.Version > NoVersion && OculusApi.Initialized; #else return false; #endif } } + + /// + public override IMixedRealityPlatform[] PlatformOverrides { get; } = + { + new WindowsStandalonePlatform(), + new AndroidPlatform() + }; } } \ No newline at end of file From 63c75de2936ff033b45abda5ddfe64aa69787d47 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 14:58:29 +0200 Subject: [PATCH 33/70] Resolve conflicts --- .../Packages/com.xrtk.oculus/CHANGELOG.md | 12 ---------- ...dControllerDataProviderProfileInspector.cs | 3 ++- .../OculusControllerDataProviderProfile.cs | 24 ------------------- .../com.xrtk.oculus/Runtime/Plugins.meta | 2 +- .../Runtime/Plugins/1.46.0.meta | 2 +- .../Runtime/Plugins/1.46.0/Win64.meta | 2 +- .../Plugins/1.46.0/Win64/OVRPlugin.dll.meta | 2 +- .../com.xrtk.oculus/Runtime/Profiles.meta | 2 +- ...culusControllerDataProviderProfile.cs.meta | 2 +- .../Runtime/Providers/CameraSystem.meta | 8 +++++++ .../OculusCameraDataProvider.cs | 0 .../OculusCameraDataProvider.cs.meta | 0 .../Runtime/Providers/InputSystem.meta | 8 +++++++ .../{ => InputSystem}/Controllers.meta | 0 .../Controllers/BaseOculusController.cs | 2 +- .../Controllers/BaseOculusController.cs.meta | 0 .../OculusControllerDataProvider.cs | 2 +- .../OculusControllerDataProvider.cs.meta | 0 .../Controllers/OculusGoController.cs | 2 +- .../Controllers/OculusGoController.cs.meta | 0 .../OculusHandControllerDataProvider.cs | 2 +- .../OculusHandControllerDataProvider.cs.meta | 0 .../Controllers/OculusRemoteController.cs | 2 +- .../OculusRemoteController.cs.meta | 0 .../Controllers/OculusTouchController.cs | 2 +- .../Controllers/OculusTouchController.cs.meta | 0 .../com.xrtk.oculus/Runtime/Utilities.meta | 8 +++++++ .../OculusHandDataConverter.cs | 3 ++- .../OculusHandDataConverter.cs.meta | 0 29 files changed, 40 insertions(+), 50 deletions(-) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem.meta rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => CameraSystem}/OculusCameraDataProvider.cs (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => CameraSystem}/OculusCameraDataProvider.cs.meta (100%) create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/BaseOculusController.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/BaseOculusController.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusControllerDataProvider.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusControllerDataProvider.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusGoController.cs (98%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusGoController.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusHandControllerDataProvider.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusHandControllerDataProvider.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusRemoteController.cs (97%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusRemoteController.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusTouchController.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{ => InputSystem}/Controllers/OculusTouchController.cs.meta (100%) create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities.meta rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/{Providers/Controllers => Utilities}/OculusHandDataConverter.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/{Providers/Controllers => Utilities}/OculusHandDataConverter.cs.meta (100%) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/CHANGELOG.md b/XRTK.Oculus/Packages/com.xrtk.oculus/CHANGELOG.md index a001779..e69de29 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/CHANGELOG.md +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/CHANGELOG.md @@ -1,12 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added - -- Hand tracking support for Oculus Quest. \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs index 1e64a93..651a748 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs @@ -5,9 +5,10 @@ using UnityEngine; using XRTK.Inspectors.Extensions; using XRTK.Inspectors.Profiles.InputSystem.Controllers; +using XRTK.Oculus.Plugins; using XRTK.Oculus.Profiles; -namespace XRTK.Oculus.Inspectors +namespace XRTK.Oculus.Editor { /// /// Default inspector for . diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs deleted file mode 100644 index 37aa856..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles/OculusControllerDataProviderProfile.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using XRTK.Definitions.Controllers; -using XRTK.Definitions.Utilities; -using XRTK.Oculus.Controllers; - -namespace XRTK.Oculus.Profiles -{ - public class OculusControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile - { - public override ControllerDefinition[] GetDefaultControllerOptions() - { - return new[] - { - new ControllerDefinition(typeof(OculusGoController), Handedness.Left), - new ControllerDefinition(typeof(OculusGoController), Handedness.Right), - new ControllerDefinition(typeof(OculusRemoteController)), - new ControllerDefinition(typeof(OculusTouchController), Handedness.Left), - new ControllerDefinition(typeof(OculusTouchController), Handedness.Right), - }; - } - } -} \ No newline at end of file diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins.meta index bb32e66..e500696 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dc3b84bd4ab074f4d9f6b938e418b794 +guid: 189d6c6741b451e40b5708ac6ae12fa3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0.meta index 1ad0396..c061b62 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a48ade78b9b02464eb296940ad0a4405 +guid: 960084ceae2e93040ae4ceaf0d9984a9 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64.meta index df0b35a..ca8df74 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 958d24db591ff3b4d9737e586e1aca18 +guid: 48d430f99f5440e4f80ec7633f91fac0 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64/OVRPlugin.dll.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64/OVRPlugin.dll.meta index db5a22e..c4c8259 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64/OVRPlugin.dll.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.46.0/Win64/OVRPlugin.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e23784ac8e369924c8751a3911a336ef +guid: bba0264b0d95a5044b88949986ee9073 PluginImporter: externalObjects: {} serializedVersion: 2 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles.meta index 02b9107..bedfb3f 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 63cd1f630a3d28f4a95eb15df714bd49 +guid: 752641a1dfaf7374db19043f00a59ff3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta index 2ea2082..a36fcf6 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f7c275ea0a537ee48b517e7c58643b53 +guid: cc1f37e374ed2e64689855559e5bffb9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem.meta new file mode 100644 index 0000000..73069a1 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20826da1c4ef8bc41b678f6abc0b1a41 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem/OculusCameraDataProvider.cs similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem/OculusCameraDataProvider.cs diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem/OculusCameraDataProvider.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/OculusCameraDataProvider.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/CameraSystem/OculusCameraDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta new file mode 100644 index 0000000..c97feb4 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05ad0e8d7677dce41912bcc06b967a3e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs index 5d628bc..febb4a7 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs @@ -13,7 +13,7 @@ using XRTK.Providers.Controllers; using XRTK.Services; -namespace XRTK.Oculus.Providers.Controllers +namespace XRTK.Oculus.Providers.InputSystem.Controllers { public abstract class BaseOculusController : BaseController { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs index 77e451d..a7e4452 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs @@ -12,7 +12,7 @@ using XRTK.Providers.Controllers; using XRTK.Services; -namespace XRTK.Oculus.Providers.Controllers +namespace XRTK.Oculus.Providers.InputSystem.Controllers { public class OculusControllerDataProvider : BaseControllerDataProvider { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs similarity index 98% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs index b634126..5e1c256 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs @@ -7,7 +7,7 @@ using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Plugins; -namespace XRTK.Oculus.Providers.Controllers +namespace XRTK.Oculus.Providers.InputSystem.Controllers { public class OculusGoController : BaseOculusController { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 96c684a..82fefa3 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -12,7 +12,7 @@ using XRTK.Providers.Controllers.Hands; using XRTK.Services; -namespace XRTK.Oculus.Providers.Controllers +namespace XRTK.Oculus.Providers.InputSystem.Controllers { public class OculusHandControllerDataProvider : BaseHandControllerDataProvider { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs similarity index 97% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs index 6247698..e692114 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs @@ -7,7 +7,7 @@ using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Plugins; -namespace XRTK.Oculus.Providers.Controllers +namespace XRTK.Oculus.Providers.InputSystem.Controllers { public class OculusRemoteController : BaseOculusController { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs index 6140fc3..5ed180d 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs @@ -7,7 +7,7 @@ using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Plugins; -namespace XRTK.Oculus.Providers.Controllers +namespace XRTK.Oculus.Providers.InputSystem.Controllers { public class OculusTouchController : BaseOculusController { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities.meta new file mode 100644 index 0000000..456aad9 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb296407c3d810d4888613a033f7244b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandDataConverter.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 3dfef9c..3285bb9 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -7,9 +7,10 @@ using XRTK.Definitions.Controllers.Hands; using XRTK.Definitions.Utilities; using XRTK.Oculus.Extensions; +using XRTK.Oculus.Plugins; using XRTK.Providers.Controllers.Hands; -namespace XRTK.Oculus.Controllers +namespace XRTK.Oculus.Utilities { /// /// Converts oculus hand data to . diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandDataConverter.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandDataConverter.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs.meta From 0079be14d633b26f8c04841c97b908aace6130fe Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 15:00:49 +0200 Subject: [PATCH 34/70] Fix namespace --- .../OculusHandControllerDataProviderProfileInspector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs index 651a748..c8aa8a0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/OculusHandControllerDataProviderProfileInspector.cs @@ -3,8 +3,8 @@ using UnityEditor; using UnityEngine; -using XRTK.Inspectors.Extensions; -using XRTK.Inspectors.Profiles.InputSystem.Controllers; +using XRTK.Editor.Extensions; +using XRTK.Editor.Profiles.InputSystem.Controllers; using XRTK.Oculus.Plugins; using XRTK.Oculus.Profiles; From f130273236952392be7e97981f0be991d6e8b39f Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 15:44:39 +0200 Subject: [PATCH 35/70] Fix usings --- .../Runtime/Profiles/OculusControllerDataProviderProfile.cs | 2 +- .../InputSystem/Controllers/OculusHandControllerDataProvider.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 1b58c08..dfc4f1f 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs @@ -3,7 +3,7 @@ using XRTK.Definitions.Controllers; using XRTK.Definitions.Utilities; -using XRTK.Oculus.Providers.Controllers; +using XRTK.Oculus.Providers.InputSystem.Controllers; namespace XRTK.Oculus.Profiles { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 82fefa3..6b768eb 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -9,6 +9,7 @@ using XRTK.Interfaces.InputSystem; using XRTK.Oculus.Plugins; using XRTK.Oculus.Profiles; +using XRTK.Oculus.Utilities; using XRTK.Providers.Controllers.Hands; using XRTK.Services; From 1127daad26a5ddc781469ac9fb5776d2c1a3b678 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 28 Apr 2020 22:00:41 +0200 Subject: [PATCH 36/70] Fix OculusControllerDataProviderProfile asset guid --- .../Profiles/OculusControllerDataProviderProfile.cs.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta index a36fcf6..2ea2082 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cc1f37e374ed2e64689855559e5bffb9 +guid: f7c275ea0a537ee48b517e7c58643b53 MonoImporter: externalObjects: {} serializedVersion: 2 From 29d35419b851807d1d29bd46e6d8428801317c47 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 2 May 2020 16:32:00 +0200 Subject: [PATCH 37/70] Pass hand state to converter for Oculus --- .../Controllers/OculusHandControllerDataProvider.cs | 4 ++-- .../Runtime/Utilities/OculusHandDataConverter.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 2322e3a..0402514 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -63,7 +63,7 @@ public override void Update() if (isLeftHandTracked) { var controller = GetOrAddController(Handedness.Left); - controller?.UpdateController(leftHandConverter.GetHandData()); + controller?.UpdateController(leftHandConverter.GetHandData(leftHandState)); } else { @@ -77,7 +77,7 @@ public override void Update() if (isRightHandTracked) { var controller = GetOrAddController(Handedness.Right); - controller?.UpdateController(rightHandConverter.GetHandData()); + controller?.UpdateController(rightHandConverter.GetHandData(rightHandState)); } else { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 3285bb9..43bb282 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -41,7 +41,7 @@ public OculusHandDataConverter(Handedness handedness, IReadOnlyList /// Updated hand data. - public HandData GetHandData() + public HandData GetHandData(OculusApi.HandState hand) { if (!isInitialized) { From c3440c26962d73f0a0ecd9f8ff501704927b8b80 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 2 May 2020 16:37:07 +0200 Subject: [PATCH 38/70] Use platform API for pointer pose --- .../Runtime/Utilities/OculusHandDataConverter.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 43bb282..7333974 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -9,6 +9,7 @@ using XRTK.Oculus.Extensions; using XRTK.Oculus.Plugins; using XRTK.Providers.Controllers.Hands; +using XRTK.Services; namespace XRTK.Oculus.Utilities { @@ -71,6 +72,8 @@ public HandData GetHandData(OculusApi.HandState hand) { updatedHandData.Mesh = new HandMeshData(); } + + updatedHandData.PointerPose = ComputePointerPose(hand); } PostProcess(updatedHandData); @@ -327,5 +330,18 @@ private Transform GetProxyTransform(OculusApi.BoneId boneId) return transform; } + + private MixedRealityPose ComputePointerPose(OculusApi.HandState hand) + { + var platformPointerPose = hand.PointerPose.ToMixedRealityPose(); + var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; + var pointerForward = playspaceTransform.TransformDirection(platformPointerPose.Forward); + var pointerUp = playspaceTransform.TransformDirection(platformPointerPose.Up); + + var pointerPosition = playspaceTransform.TransformPoint(platformPointerPose.Position); + var pointerRotation = Quaternion.LookRotation(pointerForward, pointerUp); + + return new MixedRealityPose(pointerPosition, pointerRotation); + } } } \ No newline at end of file From 4401675157cbda5138b28f12476e8a1a308b000e Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 2 May 2020 17:09:13 +0200 Subject: [PATCH 39/70] Fix default Oculus hand data provider profile --- .../OculusHandControllerDataProviderProfile.asset | 5 +++-- .../OculusPlatformServiceConfigurationsProfile.asset | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset index dcaeb81..1d028dd 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset @@ -14,10 +14,11 @@ MonoBehaviour: m_EditorClassIdentifier: hasSetupDefaults: 1 controllerMappingProfiles: - - {fileID: 11400000, guid: b43ff1b6f37e65946b1abc7e50af105f, type: 2} - - {fileID: 11400000, guid: 6c775257f26873e459a492f28125e129, type: 2} + - {fileID: 11400000, guid: e2ae1ca0318feab47a20524104ba0a94, type: 2} + - {fileID: 11400000, guid: fa146e915b7a500418bef3446a876138, type: 2} handMeshingEnabled: 0 handPhysicsEnabled: 0 useTriggers: 0 boundsMode: 0 + trackedPoses: [] minConfidenceRequired: 0 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset index 3b2f0e7..ca5a8c0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/OculusPlatformServiceConfigurationsProfile.asset @@ -25,6 +25,8 @@ MonoBehaviour: runtimePlatforms: - reference: c838c4f5-a87e-48c7-8742-09a4d85fc3bc - reference: db1acc26-ec8d-4bc6-afca-c51351b2da2e + - reference: c838c4f5-a87e-48c7-8742-09a4d85fc3bc + - reference: db1acc26-ec8d-4bc6-afca-c51351b2da2e profile: {fileID: 0} - instancedType: reference: 0de5da40-feb8-4891-b9b2-942eafd041b9 @@ -34,6 +36,8 @@ MonoBehaviour: runtimePlatforms: - reference: c838c4f5-a87e-48c7-8742-09a4d85fc3bc - reference: db1acc26-ec8d-4bc6-afca-c51351b2da2e + - reference: c838c4f5-a87e-48c7-8742-09a4d85fc3bc + - reference: db1acc26-ec8d-4bc6-afca-c51351b2da2e profile: {fileID: 11400000, guid: b849f3a28dc36b84a92d2ec4d8239cd6, type: 2} - instancedType: reference: ea666456-baef-4412-a829-a4c7132e98c3 @@ -43,4 +47,6 @@ MonoBehaviour: runtimePlatforms: - reference: c838c4f5-a87e-48c7-8742-09a4d85fc3bc - reference: db1acc26-ec8d-4bc6-afca-c51351b2da2e + - reference: c838c4f5-a87e-48c7-8742-09a4d85fc3bc + - reference: db1acc26-ec8d-4bc6-afca-c51351b2da2e profile: {fileID: 11400000, guid: d9b3b9f611dffee4883c089dc35e0ce7, type: 2} From 0ad19217e31383a98c4f995e62ee0696ec75b7d8 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 2 May 2020 18:52:03 +0200 Subject: [PATCH 40/70] Fix manifest merge error --- .../Editor/BuildTools/OculusManifestPreprocessor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/BuildTools/OculusManifestPreprocessor.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/BuildTools/OculusManifestPreprocessor.cs index 5d980a5..b4e2eba 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/BuildTools/OculusManifestPreprocessor.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Editor/BuildTools/OculusManifestPreprocessor.cs @@ -64,7 +64,7 @@ public static void GenerateManifestForSubmission() if (dofTextIndex != -1) { //Forces Quest configuration. Needs flip for Go/Gear viewer - const string headTrackingFeatureText = ""; + const string headTrackingFeatureText = ""; manifestText = manifestText.Insert(dofTextIndex, headTrackingFeatureText); } else @@ -83,7 +83,7 @@ public static void GenerateManifestForSubmission() // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (handTrackingEntryNeeded) { - string handTrackingFeatureText = $""; + string handTrackingFeatureText = $""; const string handTrackingPermissionText = ""; manifestText = manifestText.Insert(handTrackingTextIndex, handTrackingPermissionText); From 4aec0a98e12d2946c7dbf2a810fc28b350628962 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 2 May 2020 19:06:25 +0200 Subject: [PATCH 41/70] Fix duplicate plugin issue --- .../Runtime/Plugins/1.48.0/Android/OVRPlugin.aar.meta | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.48.0/Android/OVRPlugin.aar.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.48.0/Android/OVRPlugin.aar.meta index 5530ea4..4251e1b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.48.0/Android/OVRPlugin.aar.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/1.48.0/Android/OVRPlugin.aar.meta @@ -16,7 +16,7 @@ PluginImporter: second: enabled: 0 settings: - Exclude Android: 0 + Exclude Android: 1 Exclude Editor: 1 Exclude Linux: 1 Exclude Linux64: 1 @@ -30,7 +30,7 @@ PluginImporter: - first: Android: Android second: - enabled: 1 + enabled: 0 settings: CPU: ARMv7 - first: From 94177dada4deb7aacc36d258224f1f545d6971af Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 2 May 2020 20:02:01 +0200 Subject: [PATCH 42/70] Remove eye height in joint conversion --- .../Runtime/Plugins/OculusApi.cs | 2 +- .../Utilities/OculusHandDataConverter.cs | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/OculusApi.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/OculusApi.cs index 5b22a30..535f072 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/OculusApi.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Plugins/OculusApi.cs @@ -43,7 +43,7 @@ public static Version Version _version = new Version(pluginVersion); if (Debug.isDebugBuild && Application.isPlaying) { - Debug.Log($"Oculus API version detected was - [{_version.ToString()}]"); + Debug.Log($"Oculus API version detected is - [{_version.ToString()}]"); } } else diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 7333974..dc360cb 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -10,6 +10,7 @@ using XRTK.Oculus.Plugins; using XRTK.Providers.Controllers.Hands; using XRTK.Services; +using XRTK.Utilities; namespace XRTK.Oculus.Utilities { @@ -258,15 +259,14 @@ private MixedRealityPose EstimatePalmPose() private MixedRealityPose ComputeJointPose(OculusApi.Bone bone) { - // HACK: The Pinky and Thumb 1+ bones depend on the Pinky/Thumb 0 bone + // The Pinky/Thumb 1+ bones depend on the Pinky/Thumb 0 bone // to be availble, which the XRTK hand tracking does not use. We still gotta update them to // be able to resolve pose dependencies. if (bone.Id == OculusApi.BoneId.Hand_Thumb1) { ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb0]); } - - if (bone.Id == OculusApi.BoneId.Hand_Pinky1) + else if (bone.Id == OculusApi.BoneId.Hand_Pinky1) { ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); } @@ -277,7 +277,6 @@ private MixedRealityPose ComputeJointPose(OculusApi.Bone bone) if (parentProxyTransform == null) { Vector3 rootPosition = handState.RootPose.Position.FromFlippedZVector3f(); - rootPosition.y += OculusApi.EyeHeight; proxyTransform.position = rootPosition; proxyTransform.rotation = handState.RootPose.Orientation.FromFlippedZQuatf(); } @@ -331,6 +330,11 @@ private Transform GetProxyTransform(OculusApi.BoneId boneId) return transform; } + /// + /// Gets the hand's pointer pose mixed reality playspace coordinates. + /// + /// The hand state provided by native APIs. + /// Pointer pose in playspace tracking space. private MixedRealityPose ComputePointerPose(OculusApi.HandState hand) { var platformPointerPose = hand.PointerPose.ToMixedRealityPose(); @@ -343,5 +347,16 @@ private MixedRealityPose ComputePointerPose(OculusApi.HandState hand) return new MixedRealityPose(pointerPosition, pointerRotation); } + + private MixedRealityPose TranslateToCameraSpace(MixedRealityPose pose) + { + var cameraTransform = MixedRealityToolkit.CameraSystem != null + ? MixedRealityToolkit.CameraSystem.MainCameraRig.PlayerCamera.transform + : CameraCache.Main.transform; + + pose.Position = cameraTransform.TransformPoint(pose.Position); + + return pose; + } } } \ No newline at end of file From 5297b106c07328a46c86c174dcc2bd27ffb9ec1d Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 3 May 2020 11:13:21 +0200 Subject: [PATCH 43/70] Translate poses to camera space properly --- .../Runtime/Utilities/OculusHandDataConverter.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index dc360cb..a723ebc 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -288,7 +288,7 @@ private MixedRealityPose ComputeJointPose(OculusApi.Bone bone) } // Compute final bone pose. - return FixRotation(new MixedRealityPose(proxyTransform.position, proxyTransform.rotation)); + return TranslateToCameraSpace(FixRotation(new MixedRealityPose(proxyTransform.position, proxyTransform.rotation))); } private MixedRealityPose FixRotation(MixedRealityPose bonePose) @@ -345,7 +345,7 @@ private MixedRealityPose ComputePointerPose(OculusApi.HandState hand) var pointerPosition = playspaceTransform.TransformPoint(platformPointerPose.Position); var pointerRotation = Quaternion.LookRotation(pointerForward, pointerUp); - return new MixedRealityPose(pointerPosition, pointerRotation); + return TranslateToCameraSpace(new MixedRealityPose(pointerPosition, pointerRotation)); } private MixedRealityPose TranslateToCameraSpace(MixedRealityPose pose) @@ -354,7 +354,8 @@ private MixedRealityPose TranslateToCameraSpace(MixedRealityPose pose) ? MixedRealityToolkit.CameraSystem.MainCameraRig.PlayerCamera.transform : CameraCache.Main.transform; - pose.Position = cameraTransform.TransformPoint(pose.Position); + var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; + pose.Position = playspaceTransform.TransformPoint(pose.Position) + new Vector3(0, cameraTransform.position.y, 0f); return pose; } From 1a775bcee5f18c3cbda60153625f9dfba72047a5 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 3 May 2020 17:08:03 +0200 Subject: [PATCH 44/70] Update hand controller profile references --- .../Controllers/OculusHandControllerDataProviderProfile.asset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset index 1d028dd..c811428 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset @@ -14,8 +14,8 @@ MonoBehaviour: m_EditorClassIdentifier: hasSetupDefaults: 1 controllerMappingProfiles: - - {fileID: 11400000, guid: e2ae1ca0318feab47a20524104ba0a94, type: 2} - - {fileID: 11400000, guid: fa146e915b7a500418bef3446a876138, type: 2} + - {fileID: 11400000, guid: 777fb11f650654740825e1853e030405, type: 2} + - {fileID: 11400000, guid: 094680cae747ccb438c376af7ec85f32, type: 2} handMeshingEnabled: 0 handPhysicsEnabled: 0 useTriggers: 0 From 57a03e95935dfc26cf4591341e8e92714e0b7d6a Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 10 May 2020 09:51:41 +0200 Subject: [PATCH 45/70] Introduce hand rendering mode --- .../Controllers/OculusHandControllerDataProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 0402514..3d7b8e1 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using UnityEngine; using XRTK.Attributes; +using XRTK.Definitions.Controllers.Hands; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; using XRTK.Interfaces.InputSystem; @@ -45,8 +46,7 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo public override void Enable() { base.Enable(); - - OculusHandDataConverter.HandMeshingEnabled = HandMeshingEnabled; + OculusHandDataConverter.HandMeshingEnabled = RenderingMode == HandRenderingMode.Mesh; } /// From d03ef5060eecb8dafb61e132e1dc048a00870597 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 10 May 2020 09:56:39 +0200 Subject: [PATCH 46/70] Implement runtime rendering mode switch --- .../Controllers/OculusHandControllerDataProvider.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 3d7b8e1..46551ac 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -42,19 +42,13 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo /// public OculusApi.TrackingConfidence MinConfidenceRequired { get; } - /// - public override void Enable() - { - base.Enable(); - OculusHandDataConverter.HandMeshingEnabled = RenderingMode == HandRenderingMode.Mesh; - } - /// public override void Update() { base.Update(); var step = OculusApi.Step.Render; + OculusHandDataConverter.HandMeshingEnabled = RenderingMode == HandRenderingMode.Mesh; bool isLeftHandTracked = OculusApi.GetHandState(step, OculusApi.Hand.HandLeft, ref leftHandState) && leftHandState.HandConfidence >= MinConfidenceRequired && From b418613337d47d9666fae91701a3fe219d45f545 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Fri, 22 May 2020 08:45:21 +0200 Subject: [PATCH 47/70] Update converter to define platform capabilities --- .../Runtime/Utilities/OculusHandDataConverter.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index a723ebc..6a4866d 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -34,6 +34,18 @@ public OculusHandDataConverter(Handedness handedness, IReadOnlyList + protected override bool PlatformProvidesPointerPose => true; + + /// + protected override bool PlatformProvidesIsPinching => false; + + /// + protected override bool PlatformProvidesPinchStrength => false; + + /// + protected override bool PlatformProvidesIsPointing => false; + /// /// Gets or sets whether hand mesh data should be read and converted. /// @@ -77,7 +89,7 @@ public HandData GetHandData(OculusApi.HandState hand) updatedHandData.PointerPose = ComputePointerPose(hand); } - PostProcess(updatedHandData); + Finalize(updatedHandData); return updatedHandData; } From baffb2bb74df4070f220dbe30942ce457d26875b Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 26 May 2020 18:01:19 +0200 Subject: [PATCH 48/70] Remove the need for base converter --- .../OculusHandControllerDataProvider.cs | 16 +++++++- .../Utilities/OculusHandDataConverter.cs | 37 +++++++------------ 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 46551ac..b998173 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -28,10 +28,16 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo MinConfidenceRequired = (OculusApi.TrackingConfidence)profile.MinConfidenceRequired; leftHandConverter = new OculusHandDataConverter(Handedness.Left, TrackedPoses); rightHandConverter = new OculusHandDataConverter(Handedness.Right, TrackedPoses); + + postProcessor = new HandDataPostProcessor(TrackedPoses) + { + PlatformProvidesPointerPose = true + }; } private readonly OculusHandDataConverter leftHandConverter; private readonly OculusHandDataConverter rightHandConverter; + private readonly HandDataPostProcessor postProcessor; private readonly Dictionary activeControllers = new Dictionary(); private OculusApi.HandState leftHandState = default; @@ -57,7 +63,10 @@ public override void Update() if (isLeftHandTracked) { var controller = GetOrAddController(Handedness.Left); - controller?.UpdateController(leftHandConverter.GetHandData(leftHandState)); + var handData = leftHandConverter.GetHandData(leftHandState); + + postProcessor.PostProcess(handData); + controller?.UpdateController(handData); } else { @@ -71,7 +80,10 @@ public override void Update() if (isRightHandTracked) { var controller = GetOrAddController(Handedness.Right); - controller?.UpdateController(rightHandConverter.GetHandData(rightHandState)); + var handData = rightHandConverter.GetHandData(rightHandState); + + postProcessor.PostProcess(handData); + controller?.UpdateController(handData); } else { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 6a4866d..decdad7 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -17,35 +17,26 @@ namespace XRTK.Oculus.Utilities /// /// Converts oculus hand data to . /// - public sealed class OculusHandDataConverter : BaseHandDataConverter + public sealed class OculusHandDataConverter { /// /// Constructor. /// /// Handedness of the hand this converter is created for. /// The tracked poses collection to use for pose recognition. - public OculusHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) - { } + public OculusHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) + { + this.handedness = handedness; + } private readonly Dictionary boneProxyTransforms = new Dictionary(); + private readonly Handedness handedness; private bool isInitialized = false; private OculusApi.Skeleton handSkeleton = new OculusApi.Skeleton(); private OculusApi.HandState handState = new OculusApi.HandState(); private OculusApi.Mesh handMesh = new OculusApi.Mesh(); - /// - protected override bool PlatformProvidesPointerPose => true; - - /// - protected override bool PlatformProvidesIsPinching => false; - - /// - protected override bool PlatformProvidesPinchStrength => false; - - /// - protected override bool PlatformProvidesIsPointing => false; - /// /// Gets or sets whether hand mesh data should be read and converted. /// @@ -59,18 +50,19 @@ public HandData GetHandData(OculusApi.HandState hand) { if (!isInitialized) { - isInitialized = OculusApi.GetSkeleton(Handedness.ToSkeletonType(), out handSkeleton); + isInitialized = OculusApi.GetSkeleton(handedness.ToSkeletonType(), out handSkeleton); if (!isInitialized) { - Debug.LogError($"{GetType().Name} - {Handedness} failed to initialize."); + Debug.LogError($"{GetType().Name} - {handedness} failed to initialize."); return null; } } HandData updatedHandData = new HandData { - IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, Handedness.ToHand(), ref handState), - TimeStamp = DateTimeOffset.UtcNow.Ticks + IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, handedness.ToHand(), ref handState), + UpdatedAt = DateTimeOffset.UtcNow.Ticks, + Handedness = handedness }; if (updatedHandData.IsTracked) @@ -89,7 +81,6 @@ public HandData GetHandData(OculusApi.HandState hand) updatedHandData.PointerPose = ComputePointerPose(hand); } - Finalize(updatedHandData); return updatedHandData; } @@ -190,7 +181,7 @@ private void UpdateHandJoints(MixedRealityPose[] jointPoses) private bool TryGetUpdatedHandMeshData(out HandMeshData data) { - if (OculusApi.GetMesh(Handedness.ToMeshType(), out handMesh)) + if (OculusApi.GetMesh(handedness.ToMeshType(), out handMesh)) { Vector3[] vertices = new Vector3[handMesh.NumVertices]; @@ -307,7 +298,7 @@ private MixedRealityPose FixRotation(MixedRealityPose bonePose) { // WARNING THIS CODE IS SUBJECT TO CHANGE WITH THE OCULUS SDK // - This fix is a hack to fix broken and inconsistent rotations for hands. - if (Handedness == Handedness.Left) + if (handedness == Handedness.Left) { // Rotate bone 180 degrees on X to flip up. bonePose.Rotation *= Quaternion.Euler(180f, 0f, 0f); @@ -336,7 +327,7 @@ private Transform GetProxyTransform(OculusApi.BoneId boneId) return boneProxyTransforms[(int)boneId]; } - var transform = new GameObject($"Oculus Hand {Handedness} {boneId} Proxy").transform; + var transform = new GameObject($"Oculus Hand {handedness} {boneId} Proxy").transform; boneProxyTransforms.Add((int)boneId, transform); return transform; From a6c396e089e0012b75ffd42c222804613dee2827 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 26 May 2020 21:40:06 +0200 Subject: [PATCH 49/70] Fix build errors due to removal of base converter --- .../Controllers/OculusHandControllerDataProvider.cs | 4 ++-- .../Runtime/Utilities/OculusHandDataConverter.cs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index b998173..b27b54f 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -26,8 +26,8 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo : base(name, priority, profile, parentService) { MinConfidenceRequired = (OculusApi.TrackingConfidence)profile.MinConfidenceRequired; - leftHandConverter = new OculusHandDataConverter(Handedness.Left, TrackedPoses); - rightHandConverter = new OculusHandDataConverter(Handedness.Right, TrackedPoses); + leftHandConverter = new OculusHandDataConverter(Handedness.Left); + rightHandConverter = new OculusHandDataConverter(Handedness.Right); postProcessor = new HandDataPostProcessor(TrackedPoses) { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index decdad7..d1b24f0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -8,7 +8,6 @@ using XRTK.Definitions.Utilities; using XRTK.Oculus.Extensions; using XRTK.Oculus.Plugins; -using XRTK.Providers.Controllers.Hands; using XRTK.Services; using XRTK.Utilities; @@ -23,8 +22,7 @@ public sealed class OculusHandDataConverter /// Constructor. /// /// Handedness of the hand this converter is created for. - /// The tracked poses collection to use for pose recognition. - public OculusHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) + public OculusHandDataConverter(Handedness handedness) { this.handedness = handedness; } From d54faf72a2385e61303ed64ee966a4c944c88a32 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Wed, 27 May 2020 10:39:38 +0200 Subject: [PATCH 50/70] Rename joints --- .../Utilities/OculusHandDataConverter.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index d1b24f0..b1068a4 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -97,13 +97,13 @@ private void UpdateHandJoints(MixedRealityPose[] jointPoses) jointPoses[i] = EstimatePalmPose(); break; // Finger: Thumb - case TrackedHandJoint.ThumbMetacarpalJoint: + case TrackedHandJoint.ThumbMetacarpal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); break; - case TrackedHandJoint.ThumbProximalJoint: + case TrackedHandJoint.ThumbProximal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb2]); break; - case TrackedHandJoint.ThumbDistalJoint: + case TrackedHandJoint.ThumbDistal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb3]); break; case TrackedHandJoint.ThumbTip: @@ -113,13 +113,13 @@ private void UpdateHandJoints(MixedRealityPose[] jointPoses) case TrackedHandJoint.IndexMetacarpal: jointPoses[i] = EstimateIndexMetacarpal(); break; - case TrackedHandJoint.IndexKnuckle: + case TrackedHandJoint.IndexProximal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index1]); break; - case TrackedHandJoint.IndexMiddleJoint: + case TrackedHandJoint.IndexIntermediate: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index2]); break; - case TrackedHandJoint.IndexDistalJoint: + case TrackedHandJoint.IndexDistal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index3]); break; case TrackedHandJoint.IndexTip: @@ -129,13 +129,13 @@ private void UpdateHandJoints(MixedRealityPose[] jointPoses) case TrackedHandJoint.MiddleMetacarpal: jointPoses[i] = EstimateMiddleMetacarpal(); break; - case TrackedHandJoint.MiddleKnuckle: + case TrackedHandJoint.MiddleProximal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle1]); break; - case TrackedHandJoint.MiddleMiddleJoint: + case TrackedHandJoint.MiddleIntermediate: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle2]); break; - case TrackedHandJoint.MiddleDistalJoint: + case TrackedHandJoint.MiddleDistal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle3]); break; case TrackedHandJoint.MiddleTip: @@ -145,32 +145,32 @@ private void UpdateHandJoints(MixedRealityPose[] jointPoses) case TrackedHandJoint.RingMetacarpal: jointPoses[i] = EstimateRingMetacarpal(); break; - case TrackedHandJoint.RingKnuckle: + case TrackedHandJoint.RingProximal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring1]); break; - case TrackedHandJoint.RingMiddleJoint: + case TrackedHandJoint.RingIntermediate: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring2]); break; - case TrackedHandJoint.RingDistalJoint: + case TrackedHandJoint.RingDistal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring3]); break; case TrackedHandJoint.RingTip: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_RingTip]); break; // Finger: Pinky - case TrackedHandJoint.PinkyMetacarpal: + case TrackedHandJoint.LittleMetacarpal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); break; - case TrackedHandJoint.PinkyKnuckle: + case TrackedHandJoint.LittleProximal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky1]); break; - case TrackedHandJoint.PinkyMiddleJoint: + case TrackedHandJoint.LittleIntermediate: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky2]); break; - case TrackedHandJoint.PinkyDistalJoint: + case TrackedHandJoint.LittleDistal: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky3]); break; - case TrackedHandJoint.PinkyTip: + case TrackedHandJoint.LittleTip: jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_PinkyTip]); break; } From 0b656f53f79faec33f3bbb82b61c86bcfa28f158 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Wed, 27 May 2020 15:52:49 +0200 Subject: [PATCH 51/70] Point to new hand controller profiles --- .../OculusHandControllerDataProviderProfile.asset | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset index c811428..a401172 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusHandControllerDataProviderProfile.asset @@ -14,9 +14,9 @@ MonoBehaviour: m_EditorClassIdentifier: hasSetupDefaults: 1 controllerMappingProfiles: - - {fileID: 11400000, guid: 777fb11f650654740825e1853e030405, type: 2} - - {fileID: 11400000, guid: 094680cae747ccb438c376af7ec85f32, type: 2} - handMeshingEnabled: 0 + - {fileID: 11400000, guid: dd499836e4b82f14da2f414aad1fed8b, type: 2} + - {fileID: 11400000, guid: 78bf44d2b6970a74ea2721883b0b22bc, type: 2} + renderingMode: 1 handPhysicsEnabled: 0 useTriggers: 0 boundsMode: 0 From 247877a1f44858ed07e529375c12694a9434b935 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Fri, 29 May 2020 14:42:02 +0200 Subject: [PATCH 52/70] Remove handedness from hand data --- .../Runtime/Utilities/OculusHandDataConverter.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index b1068a4..5aed18e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -59,8 +59,7 @@ public HandData GetHandData(OculusApi.HandState hand) HandData updatedHandData = new HandData { IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, handedness.ToHand(), ref handState), - UpdatedAt = DateTimeOffset.UtcNow.Ticks, - Handedness = handedness + UpdatedAt = DateTimeOffset.UtcNow.Ticks }; if (updatedHandData.IsTracked) From 9b5f6f8604a0b431d2c91e0c0044bdaeab60f93b Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Fri, 29 May 2020 18:33:49 +0200 Subject: [PATCH 53/70] Pass handedness to recognizer --- .../Controllers/OculusHandControllerDataProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index b27b54f..cb2fa19 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -65,7 +65,7 @@ public override void Update() var controller = GetOrAddController(Handedness.Left); var handData = leftHandConverter.GetHandData(leftHandState); - postProcessor.PostProcess(handData); + postProcessor.PostProcess(Handedness.Left, handData); controller?.UpdateController(handData); } else @@ -82,7 +82,7 @@ public override void Update() var controller = GetOrAddController(Handedness.Right); var handData = rightHandConverter.GetHandData(rightHandState); - postProcessor.PostProcess(handData); + postProcessor.PostProcess(Handedness.Right, handData); controller?.UpdateController(handData); } else From 54d42ad85af650b07374470101e044434a97fdf6 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 6 Jun 2020 09:00:06 +0200 Subject: [PATCH 54/70] Change HandData to be a struct --- .../OculusHandControllerDataProvider.cs | 16 ++++------ .../Utilities/OculusHandDataConverter.cs | 30 ++++++++++--------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index cb2fa19..f1d4a1c 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -60,13 +60,11 @@ public override void Update() leftHandState.HandConfidence >= MinConfidenceRequired && (leftHandState.Status & OculusApi.HandStatus.HandTracked) != 0; - if (isLeftHandTracked) + if (isLeftHandTracked && leftHandConverter.TryGetHandData(leftHandState, out var leftHandData)) { var controller = GetOrAddController(Handedness.Left); - var handData = leftHandConverter.GetHandData(leftHandState); - - postProcessor.PostProcess(Handedness.Left, handData); - controller?.UpdateController(handData); + leftHandData = postProcessor.PostProcess(Handedness.Left, leftHandData); + controller?.UpdateController(leftHandData); } else { @@ -77,13 +75,11 @@ public override void Update() rightHandState.HandConfidence >= MinConfidenceRequired && (rightHandState.Status & OculusApi.HandStatus.HandTracked) != 0; - if (isRightHandTracked) + if (isRightHandTracked && rightHandConverter.TryGetHandData(rightHandState, out var rightHandData)) { var controller = GetOrAddController(Handedness.Right); - var handData = rightHandConverter.GetHandData(rightHandState); - - postProcessor.PostProcess(Handedness.Right, handData); - controller?.UpdateController(handData); + rightHandData = postProcessor.PostProcess(Handedness.Right, rightHandData); + controller?.UpdateController(rightHandData); } else { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 5aed18e..c74e5d4 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -44,7 +44,7 @@ public OculusHandDataConverter(Handedness handedness) /// Reads hand data for the current frame and converts it to agnostic hand data. /// /// Updated hand data. - public HandData GetHandData(OculusApi.HandState hand) + public bool TryGetHandData(OculusApi.HandState hand, out HandData handData) { if (!isInitialized) { @@ -52,37 +52,37 @@ public HandData GetHandData(OculusApi.HandState hand) if (!isInitialized) { Debug.LogError($"{GetType().Name} - {handedness} failed to initialize."); - return null; + handData = default; + return false; } } - HandData updatedHandData = new HandData - { - IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, handedness.ToHand(), ref handState), - UpdatedAt = DateTimeOffset.UtcNow.Ticks - }; + handData = new HandData(); + handData.IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, handedness.ToHand(), ref handState); + handData.UpdatedAt = DateTimeOffset.UtcNow.Ticks; - if (updatedHandData.IsTracked) + if (handData.IsTracked) { - UpdateHandJoints(updatedHandData.Joints); + handData.Joints = GetJointPoses(); if (HandMeshingEnabled && TryGetUpdatedHandMeshData(out HandMeshData data)) { - updatedHandData.Mesh = data; + handData.Mesh = data; } else { - updatedHandData.Mesh = new HandMeshData(); + handData.Mesh = new HandMeshData(); } - updatedHandData.PointerPose = ComputePointerPose(hand); + handData.PointerPose = ComputePointerPose(hand); } - return updatedHandData; + return true; } - private void UpdateHandJoints(MixedRealityPose[] jointPoses) + private MixedRealityPose[] GetJointPoses() { + var jointPoses = new MixedRealityPose[HandData.JointCount]; for (int i = 0; i < jointPoses.Length; i++) { TrackedHandJoint trackedHandJoint = (TrackedHandJoint)i; @@ -174,6 +174,8 @@ private void UpdateHandJoints(MixedRealityPose[] jointPoses) break; } } + + return jointPoses; } private bool TryGetUpdatedHandMeshData(out HandMeshData data) From 24cf36d99491716ca2d1bd721b19ba83e465304a Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 9 Jun 2020 16:20:12 +0200 Subject: [PATCH 55/70] Remove HandMeshingEnabled static property --- .../OculusHandControllerDataProvider.cs | 5 ++--- .../Runtime/Utilities/OculusHandDataConverter.cs | 14 ++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index f1d4a1c..6a46be4 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -54,13 +54,12 @@ public override void Update() base.Update(); var step = OculusApi.Step.Render; - OculusHandDataConverter.HandMeshingEnabled = RenderingMode == HandRenderingMode.Mesh; bool isLeftHandTracked = OculusApi.GetHandState(step, OculusApi.Hand.HandLeft, ref leftHandState) && leftHandState.HandConfidence >= MinConfidenceRequired && (leftHandState.Status & OculusApi.HandStatus.HandTracked) != 0; - if (isLeftHandTracked && leftHandConverter.TryGetHandData(leftHandState, out var leftHandData)) + if (isLeftHandTracked && leftHandConverter.TryGetHandData(leftHandState, RenderingMode == HandRenderingMode.Mesh, out var leftHandData)) { var controller = GetOrAddController(Handedness.Left); leftHandData = postProcessor.PostProcess(Handedness.Left, leftHandData); @@ -75,7 +74,7 @@ public override void Update() rightHandState.HandConfidence >= MinConfidenceRequired && (rightHandState.Status & OculusApi.HandStatus.HandTracked) != 0; - if (isRightHandTracked && rightHandConverter.TryGetHandData(rightHandState, out var rightHandData)) + if (isRightHandTracked && rightHandConverter.TryGetHandData(rightHandState, RenderingMode == HandRenderingMode.Mesh, out var rightHandData)) { var controller = GetOrAddController(Handedness.Right); rightHandData = postProcessor.PostProcess(Handedness.Right, rightHandData); diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index c74e5d4..039d6e0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -35,16 +35,14 @@ public OculusHandDataConverter(Handedness handedness) private OculusApi.HandState handState = new OculusApi.HandState(); private OculusApi.Mesh handMesh = new OculusApi.Mesh(); - /// - /// Gets or sets whether hand mesh data should be read and converted. - /// - public static bool HandMeshingEnabled { get; set; } - /// /// Reads hand data for the current frame and converts it to agnostic hand data. /// + /// The hand + /// If set, hand mesh information will be included in the hand data. + /// The output hand data. /// Updated hand data. - public bool TryGetHandData(OculusApi.HandState hand, out HandData handData) + public bool TryGetHandData(OculusApi.HandState hand, bool includeMeshData, out HandData handData) { if (!isInitialized) { @@ -65,7 +63,7 @@ public bool TryGetHandData(OculusApi.HandState hand, out HandData handData) { handData.Joints = GetJointPoses(); - if (HandMeshingEnabled && TryGetUpdatedHandMeshData(out HandMeshData data)) + if (includeMeshData && TryGetUpdatedHandMeshData(out HandMeshData data)) { handData.Mesh = data; } @@ -210,7 +208,7 @@ private bool TryGetUpdatedHandMeshData(out HandMeshData data) normals[i] = handMesh.VertexNormals[i].FromFlippedZVector3f(); } - data = new HandMeshData(vertices, triangles, normals, uvs, handState.RootPose.Position.FromFlippedZVector3f(), handState.RootPose.Orientation.FromFlippedZQuatf()); + data = new HandMeshData(vertices, triangles, normals, uvs); return true; } From 044c8d92a25d0391990edf82ebc47627212fb0a1 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 9 Jun 2020 16:31:17 +0200 Subject: [PATCH 56/70] Remove unnecessary parameter --- .../Runtime/Utilities/OculusHandDataConverter.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 039d6e0..5ea3e97 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -72,7 +72,7 @@ public bool TryGetHandData(OculusApi.HandState hand, bool includeMeshData, out H handData.Mesh = new HandMeshData(); } - handData.PointerPose = ComputePointerPose(hand); + handData.PointerPose = ComputePointerPose(); } return true; @@ -331,13 +331,15 @@ private Transform GetProxyTransform(OculusApi.BoneId boneId) } /// - /// Gets the hand's pointer pose mixed reality playspace coordinates. + /// Gets the hand's local pointer pose. /// - /// The hand state provided by native APIs. - /// Pointer pose in playspace tracking space. - private MixedRealityPose ComputePointerPose(OculusApi.HandState hand) + /// Pointer pose relative to . + private MixedRealityPose ComputePointerPose() { - var platformPointerPose = hand.PointerPose.ToMixedRealityPose(); + var platformPointerPose = new MixedRealityPose( + handState.PointerPose.Position.FromFlippedZVector3f(), + handState.PointerPose.Orientation.FromFlippedZQuatf()); + var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; var pointerForward = playspaceTransform.TransformDirection(platformPointerPose.Forward); var pointerUp = playspaceTransform.TransformDirection(platformPointerPose.Up); From b0296b436391565090aa8a6f9faea88ea57a83f9 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 11 Jun 2020 09:42:01 +0200 Subject: [PATCH 57/70] Remove hand state from data provider --- .../OculusHandControllerDataProvider.cs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 6a46be4..f6a78b0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -40,9 +40,6 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo private readonly HandDataPostProcessor postProcessor; private readonly Dictionary activeControllers = new Dictionary(); - private OculusApi.HandState leftHandState = default; - private OculusApi.HandState rightHandState = default; - /// /// The minimum required tracking confidence for hands to be registered. /// @@ -53,13 +50,7 @@ public override void Update() { base.Update(); - var step = OculusApi.Step.Render; - - bool isLeftHandTracked = OculusApi.GetHandState(step, OculusApi.Hand.HandLeft, ref leftHandState) && - leftHandState.HandConfidence >= MinConfidenceRequired && - (leftHandState.Status & OculusApi.HandStatus.HandTracked) != 0; - - if (isLeftHandTracked && leftHandConverter.TryGetHandData(leftHandState, RenderingMode == HandRenderingMode.Mesh, out var leftHandData)) + if (leftHandConverter.TryGetHandData(RenderingMode == HandRenderingMode.Mesh, MinConfidenceRequired, out var leftHandData)) { var controller = GetOrAddController(Handedness.Left); leftHandData = postProcessor.PostProcess(Handedness.Left, leftHandData); @@ -70,11 +61,7 @@ public override void Update() RemoveController(Handedness.Left); } - bool isRightHandTracked = OculusApi.GetHandState(step, OculusApi.Hand.HandRight, ref rightHandState) && - rightHandState.HandConfidence >= MinConfidenceRequired && - (rightHandState.Status & OculusApi.HandStatus.HandTracked) != 0; - - if (isRightHandTracked && rightHandConverter.TryGetHandData(rightHandState, RenderingMode == HandRenderingMode.Mesh, out var rightHandData)) + if (rightHandConverter.TryGetHandData(RenderingMode == HandRenderingMode.Mesh, MinConfidenceRequired, out var rightHandData)) { var controller = GetOrAddController(Handedness.Right); rightHandData = postProcessor.PostProcess(Handedness.Right, rightHandData); From 70eef444231073f47ccf0bd01ffa77770356efd6 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 11 Jun 2020 16:54:31 +0200 Subject: [PATCH 58/70] Move pose estimation to new utillities static class --- .../OculusHandControllerDataProvider.cs | 10 +- .../Utilities/OculusHandDataConverter.cs | 346 +++++++----------- 2 files changed, 130 insertions(+), 226 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index f6a78b0..2cc0bc2 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -26,8 +26,7 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo : base(name, priority, profile, parentService) { MinConfidenceRequired = (OculusApi.TrackingConfidence)profile.MinConfidenceRequired; - leftHandConverter = new OculusHandDataConverter(Handedness.Left); - rightHandConverter = new OculusHandDataConverter(Handedness.Right); + handDataProvider = new OculusHandDataConverter(); postProcessor = new HandDataPostProcessor(TrackedPoses) { @@ -35,8 +34,7 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo }; } - private readonly OculusHandDataConverter leftHandConverter; - private readonly OculusHandDataConverter rightHandConverter; + private readonly OculusHandDataConverter handDataProvider; private readonly HandDataPostProcessor postProcessor; private readonly Dictionary activeControllers = new Dictionary(); @@ -50,7 +48,7 @@ public override void Update() { base.Update(); - if (leftHandConverter.TryGetHandData(RenderingMode == HandRenderingMode.Mesh, MinConfidenceRequired, out var leftHandData)) + if (handDataProvider.TryGetHandData(Handedness.Left, RenderingMode == HandRenderingMode.Mesh, MinConfidenceRequired, out var leftHandData)) { var controller = GetOrAddController(Handedness.Left); leftHandData = postProcessor.PostProcess(Handedness.Left, leftHandData); @@ -61,7 +59,7 @@ public override void Update() RemoveController(Handedness.Left); } - if (rightHandConverter.TryGetHandData(RenderingMode == HandRenderingMode.Mesh, MinConfidenceRequired, out var rightHandData)) + if (handDataProvider.TryGetHandData(Handedness.Right, RenderingMode == HandRenderingMode.Mesh, MinConfidenceRequired, out var rightHandData)) { var controller = GetOrAddController(Handedness.Right); rightHandData = postProcessor.PostProcess(Handedness.Right, rightHandData); diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 5ea3e97..3637d0b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -18,165 +18,107 @@ namespace XRTK.Oculus.Utilities /// public sealed class OculusHandDataConverter { - /// - /// Constructor. - /// - /// Handedness of the hand this converter is created for. - public OculusHandDataConverter(Handedness handedness) - { - this.handedness = handedness; - } + private readonly Dictionary boneProxyTransforms = new Dictionary(); - private readonly Dictionary boneProxyTransforms = new Dictionary(); - private readonly Handedness handedness; - - private bool isInitialized = false; private OculusApi.Skeleton handSkeleton = new OculusApi.Skeleton(); private OculusApi.HandState handState = new OculusApi.HandState(); private OculusApi.Mesh handMesh = new OculusApi.Mesh(); /// - /// Reads hand data for the current frame and converts it to agnostic hand data. + /// Reads hand APIs for the current frame and converts it to agnostic . /// - /// The hand - /// If set, hand mesh information will be included in the hand data. - /// The output hand data. - /// Updated hand data. - public bool TryGetHandData(OculusApi.HandState hand, bool includeMeshData, out HandData handData) + /// The handedness of the hand to get for. + /// If set, hand mesh information will be included in . + /// The minimum required to consider hands tracked. + /// The output . + /// True, if data conversion was a success. + public bool TryGetHandData(Handedness handedness, bool includeMeshData, OculusApi.TrackingConfidence minTrackingConfidence, out HandData handData) { - if (!isInitialized) + // Here we check whether the hand is being tracked at all by the Oculus system. + if (!(OculusApi.GetHandState(OculusApi.Step.Render, handedness.ToHand(), ref handState) && + OculusApi.GetSkeleton(handedness.ToSkeletonType(), out handSkeleton))) { - isInitialized = OculusApi.GetSkeleton(handedness.ToSkeletonType(), out handSkeleton); - if (!isInitialized) - { - Debug.LogError($"{GetType().Name} - {handedness} failed to initialize."); - handData = default; - return false; - } + handData = default; + return false; } - handData = new HandData(); - handData.IsTracked = OculusApi.GetHandState(OculusApi.Step.Render, handedness.ToHand(), ref handState); - handData.UpdatedAt = DateTimeOffset.UtcNow.Ticks; + // The hand is being tracked, next we verify it meets our confidence requirements to consider + // it tracked. + handData = new HandData + { + IsTracked = handState.HandConfidence >= minTrackingConfidence && (handState.Status & OculusApi.HandStatus.HandTracked) != 0, + UpdatedAt = DateTimeOffset.UtcNow.Ticks + }; + // If the hand is tracked per requirements, we get updated joint data + // and other data needed for updating the hand controller's state. if (handData.IsTracked) { - handData.Joints = GetJointPoses(); + handData.RootPose = GetHandRootPose(handedness); + handData.Joints = GetJointPoses(handedness, handData.RootPose); - if (includeMeshData && TryGetUpdatedHandMeshData(out HandMeshData data)) + if (includeMeshData && TryGetUpdatedHandMeshData(handedness, out HandMeshData data)) { handData.Mesh = data; } else { - handData.Mesh = new HandMeshData(); + handData.Mesh = default; } - handData.PointerPose = ComputePointerPose(); + handData.PointerPose = ComputePointerPose(handedness); } + // Even if the hand is being tracked by the system but the confidence did not + // meet our requirements, we return true. This allows the hand controller and visualizers + // to react to tracking loss and keep the hand up for a given time before destroying the controller. return true; } - private MixedRealityPose[] GetJointPoses() + private MixedRealityPose[] GetJointPoses(Handedness handedness, MixedRealityPose handRootPose) { var jointPoses = new MixedRealityPose[HandData.JointCount]; - for (int i = 0; i < jointPoses.Length; i++) - { - TrackedHandJoint trackedHandJoint = (TrackedHandJoint)i; - switch (trackedHandJoint) - { - // Wrist and Palm - case TrackedHandJoint.Wrist: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]); - break; - case TrackedHandJoint.Palm: - jointPoses[i] = EstimatePalmPose(); - break; - // Finger: Thumb - case TrackedHandJoint.ThumbMetacarpal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); - break; - case TrackedHandJoint.ThumbProximal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb2]); - break; - case TrackedHandJoint.ThumbDistal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb3]); - break; - case TrackedHandJoint.ThumbTip: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_ThumbTip]); - break; - // Finger: Index - case TrackedHandJoint.IndexMetacarpal: - jointPoses[i] = EstimateIndexMetacarpal(); - break; - case TrackedHandJoint.IndexProximal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index1]); - break; - case TrackedHandJoint.IndexIntermediate: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index2]); - break; - case TrackedHandJoint.IndexDistal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index3]); - break; - case TrackedHandJoint.IndexTip: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_IndexTip]); - break; - // Finger: Middle - case TrackedHandJoint.MiddleMetacarpal: - jointPoses[i] = EstimateMiddleMetacarpal(); - break; - case TrackedHandJoint.MiddleProximal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle1]); - break; - case TrackedHandJoint.MiddleIntermediate: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle2]); - break; - case TrackedHandJoint.MiddleDistal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle3]); - break; - case TrackedHandJoint.MiddleTip: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_MiddleTip]); - break; - // Finger: Ring - case TrackedHandJoint.RingMetacarpal: - jointPoses[i] = EstimateRingMetacarpal(); - break; - case TrackedHandJoint.RingProximal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring1]); - break; - case TrackedHandJoint.RingIntermediate: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring2]); - break; - case TrackedHandJoint.RingDistal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring3]); - break; - case TrackedHandJoint.RingTip: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_RingTip]); - break; - // Finger: Pinky - case TrackedHandJoint.LittleMetacarpal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); - break; - case TrackedHandJoint.LittleProximal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky1]); - break; - case TrackedHandJoint.LittleIntermediate: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky2]); - break; - case TrackedHandJoint.LittleDistal: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky3]); - break; - case TrackedHandJoint.LittleTip: - jointPoses[i] = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_PinkyTip]); - break; - } - } + + jointPoses[(int)TrackedHandJoint.Wrist] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]); + + jointPoses[(int)TrackedHandJoint.ThumbMetacarpal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); + jointPoses[(int)TrackedHandJoint.ThumbProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb2]); + jointPoses[(int)TrackedHandJoint.ThumbDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb3]); + jointPoses[(int)TrackedHandJoint.ThumbTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_ThumbTip]); + + jointPoses[(int)TrackedHandJoint.IndexProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index1]); + jointPoses[(int)TrackedHandJoint.IndexIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index2]); + jointPoses[(int)TrackedHandJoint.IndexDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index3]); + jointPoses[(int)TrackedHandJoint.IndexTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_IndexTip]); + + jointPoses[(int)TrackedHandJoint.MiddleProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle1]); + jointPoses[(int)TrackedHandJoint.MiddleIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle2]); + jointPoses[(int)TrackedHandJoint.MiddleDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle3]); + jointPoses[(int)TrackedHandJoint.MiddleTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_MiddleTip]); + + jointPoses[(int)TrackedHandJoint.RingProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring1]); + jointPoses[(int)TrackedHandJoint.RingIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring2]); + jointPoses[(int)TrackedHandJoint.RingDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring3]); + jointPoses[(int)TrackedHandJoint.RingTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_RingTip]); + + jointPoses[(int)TrackedHandJoint.LittleMetacarpal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); + jointPoses[(int)TrackedHandJoint.LittleProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky1]); + jointPoses[(int)TrackedHandJoint.LittleIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky2]); + jointPoses[(int)TrackedHandJoint.LittleDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky3]); + jointPoses[(int)TrackedHandJoint.LittleTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_PinkyTip]); + + // Estimated: These joint poses are not provided by the Ouclus + // hand tracking implementation. But with the data we now have, we can + // estimate their poses fairly well. + jointPoses[(int)TrackedHandJoint.Palm] = HandUtilities.GetEstimatedPalmPose(jointPoses); + jointPoses[(int)TrackedHandJoint.IndexMetacarpal] = HandUtilities.GetEstimatedIndexMetacarpalPose(jointPoses); + jointPoses[(int)TrackedHandJoint.MiddleMetacarpal] = HandUtilities.GetEstimatedMiddleMetacarpalPose(jointPoses); + jointPoses[(int)TrackedHandJoint.RingMetacarpal] = HandUtilities.GetEstimatedRingMetacarpalPose(jointPoses); return jointPoses; } - private bool TryGetUpdatedHandMeshData(out HandMeshData data) + private bool TryGetUpdatedHandMeshData(Handedness handedness, out HandMeshData data) { if (OculusApi.GetMesh(handedness.ToMeshType(), out handMesh)) { @@ -217,149 +159,113 @@ private bool TryGetUpdatedHandMeshData(out HandMeshData data) return false; } - private MixedRealityPose EstimateIndexMetacarpal() - { - MixedRealityPose thumbMetacarpalPose = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); - MixedRealityPose pinkyMetacarpalPose = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); - Vector3 indexMetacarpalPosition = Vector3.Lerp(thumbMetacarpalPose.Position, pinkyMetacarpalPose.Position, .2f); - Quaternion indexMetacarpalRotation = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]).Rotation; - - return new MixedRealityPose(indexMetacarpalPosition, indexMetacarpalRotation); - } - - private MixedRealityPose EstimateRingMetacarpal() - { - MixedRealityPose thumbMetacarpalPose = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); - MixedRealityPose pinkyMetacarpalPose = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); - Vector3 ringMetacarpalPosition = Vector3.Lerp(thumbMetacarpalPose.Position, pinkyMetacarpalPose.Position, .8f); - Quaternion ringMetacarpalRotation = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]).Rotation; - - return new MixedRealityPose(ringMetacarpalPosition, ringMetacarpalRotation); - } - - private MixedRealityPose EstimateMiddleMetacarpal() - { - MixedRealityPose thumbMetacarpalPose = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); - MixedRealityPose pinkyMetacarpalPose = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); - Vector3 middleMetacarpalPosition = Vector3.Lerp(thumbMetacarpalPose.Position, pinkyMetacarpalPose.Position, .5f); - Quaternion middleMetacarpalRotation = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]).Rotation; - - return new MixedRealityPose(middleMetacarpalPosition, middleMetacarpalRotation); - } - - private MixedRealityPose EstimatePalmPose() - { - MixedRealityPose middleMetacarpalPose = EstimateMiddleMetacarpal(); - MixedRealityPose middleKnucklePose = ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle1]); - Vector3 palmPosition = Vector3.Lerp(middleMetacarpalPose.Position, middleKnucklePose.Position, .5f); - Quaternion palmRotation = middleMetacarpalPose.Rotation; - - return new MixedRealityPose(palmPosition, palmRotation); - } - - private MixedRealityPose ComputeJointPose(OculusApi.Bone bone) + private MixedRealityPose ComputeJointPose(Handedness handedness, MixedRealityPose handRootPose, OculusApi.Bone bone) { // The Pinky/Thumb 1+ bones depend on the Pinky/Thumb 0 bone - // to be availble, which the XRTK hand tracking does not use. We still gotta update them to + // to be available, which the XRTK hand tracking does not use. We still gotta update them to // be able to resolve pose dependencies. if (bone.Id == OculusApi.BoneId.Hand_Thumb1) { - ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb0]); + ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb0]); } else if (bone.Id == OculusApi.BoneId.Hand_Pinky1) { - ComputeJointPose(handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); + ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); } - Transform proxyTransform = GetProxyTransform(bone.Id); - Transform parentProxyTransform = GetProxyTransform((OculusApi.BoneId)bone.ParentBoneIndex); + var rootBoneTransform = GetProxyTransform(handedness, OculusApi.BoneId.Hand_Start); + var boneProxyTransform = GetProxyTransform(handedness, bone.Id); + var parentProxyTransform = GetProxyTransform(handedness, (OculusApi.BoneId)bone.ParentBoneIndex); - if (parentProxyTransform == null) - { - Vector3 rootPosition = handState.RootPose.Position.FromFlippedZVector3f(); - proxyTransform.position = rootPosition; - proxyTransform.rotation = handState.RootPose.Orientation.FromFlippedZQuatf(); - } - else - { - proxyTransform.parent = parentProxyTransform; - proxyTransform.localPosition = bone.Pose.Position.FromFlippedZVector3f(); - proxyTransform.localRotation = handState.BoneRotations[(int)bone.Id].FromFlippedZQuatf(); - } + boneProxyTransform.SetParent(parentProxyTransform, false); + boneProxyTransform.localPosition = bone.Pose.Position.FromFlippedZVector3f(); + boneProxyTransform.localRotation = handState.BoneRotations[(int)bone.Id].FromFlippedZQuatf(); - // Compute final bone pose. - return TranslateToCameraSpace(FixRotation(new MixedRealityPose(proxyTransform.position, proxyTransform.rotation))); + return FixRotation(handedness, new MixedRealityPose( + rootBoneTransform.InverseTransformPoint(boneProxyTransform.position), + Quaternion.Inverse(rootBoneTransform.rotation) * boneProxyTransform.rotation)); } - private MixedRealityPose FixRotation(MixedRealityPose bonePose) + /// + /// WARNING THIS CODE IS SUBJECT TO CHANGE WITH THE OCULUS SDK. + /// This fix is a hack to fix broken and inconsistent rotations for hands. + /// + /// Handedness of the hand the pose belongs to. + /// The joint pose to apply the fix to. + /// Joint pose with fixed rotation. + private MixedRealityPose FixRotation(Handedness handedness, MixedRealityPose jointPose) { - // WARNING THIS CODE IS SUBJECT TO CHANGE WITH THE OCULUS SDK - // - This fix is a hack to fix broken and inconsistent rotations for hands. if (handedness == Handedness.Left) { // Rotate bone 180 degrees on X to flip up. - bonePose.Rotation *= Quaternion.Euler(180f, 0f, 0f); + jointPose.Rotation *= Quaternion.Euler(180f, 0f, 0f); // Rotate bone 90 degrees on Y to align X with right. - bonePose.Rotation *= Quaternion.Euler(0f, 90f, 0f); + jointPose.Rotation *= Quaternion.Euler(0f, 90f, 0f); } else { // Rotate bone 90 degrees on Y to align X with left. - bonePose.Rotation *= Quaternion.Euler(0f, -90f, 0f); + jointPose.Rotation *= Quaternion.Euler(0f, -90f, 0f); } - return bonePose; + return jointPose; } - private Transform GetProxyTransform(OculusApi.BoneId boneId) + /// + /// THe oculus APIs return joint poses relative to their parent joint unlike + /// other platforms where joint poses are relative to the hand root. To convert + /// the joint-->parent-joint relation to hand-root-->joint relations proxy s + /// are used. The proxies are parented to their respective parent . + /// That way we can make use of Unity APIs to translate coordinate spaces. + /// + /// Handedness of the hand the proxy belongs to. + /// The Oculus bone ID to lookup the proxy for. + /// The proxy . + private Transform GetProxyTransform(Handedness handedness, OculusApi.BoneId boneId) { if (boneId == OculusApi.BoneId.Invalid) { - return null; + return MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; } - if (boneProxyTransforms.ContainsKey((int)boneId)) + if (boneProxyTransforms.ContainsKey(boneId)) { - return boneProxyTransforms[(int)boneId]; + return boneProxyTransforms[boneId]; } - var transform = new GameObject($"Oculus Hand {handedness} {boneId} Proxy").transform; - boneProxyTransforms.Add((int)boneId, transform); + var transform = new GameObject($"Oculus {handedness} Hand {boneId} Proxy").transform; + transform.gameObject.SetActive(false); + boneProxyTransforms.Add(boneId, transform); return transform; } + private MixedRealityPose GetHandRootPose(Handedness handedness) + { + var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; + var cameraTransform = MixedRealityToolkit.CameraSystem != null + ? MixedRealityToolkit.CameraSystem.MainCameraRig.PlayerCamera.transform + : CameraCache.Main.transform; + + var rootPosition = playspaceTransform.InverseTransformPoint(handState.RootPose.Position.FromFlippedZVector3f()); + var rootRotation = Quaternion.Inverse(playspaceTransform.rotation) * handState.RootPose.Orientation.FromFlippedZQuatf(); + + return FixRotation(handedness, new MixedRealityPose(rootPosition + new Vector3(0f, cameraTransform.localPosition.y, 0f), rootRotation)); + } + /// /// Gets the hand's local pointer pose. /// + /// Handedness of the hand the pose belongs to. /// Pointer pose relative to . - private MixedRealityPose ComputePointerPose() + private MixedRealityPose ComputePointerPose(Handedness handedness) { var platformPointerPose = new MixedRealityPose( handState.PointerPose.Position.FromFlippedZVector3f(), handState.PointerPose.Orientation.FromFlippedZQuatf()); - var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; - var pointerForward = playspaceTransform.TransformDirection(platformPointerPose.Forward); - var pointerUp = playspaceTransform.TransformDirection(platformPointerPose.Up); - - var pointerPosition = playspaceTransform.TransformPoint(platformPointerPose.Position); - var pointerRotation = Quaternion.LookRotation(pointerForward, pointerUp); - - return TranslateToCameraSpace(new MixedRealityPose(pointerPosition, pointerRotation)); - } - - private MixedRealityPose TranslateToCameraSpace(MixedRealityPose pose) - { - var cameraTransform = MixedRealityToolkit.CameraSystem != null - ? MixedRealityToolkit.CameraSystem.MainCameraRig.PlayerCamera.transform - : CameraCache.Main.transform; - - var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; - pose.Position = playspaceTransform.TransformPoint(pose.Position) + new Vector3(0, cameraTransform.position.y, 0f); - - return pose; + return FixRotation(handedness, platformPointerPose); } } } \ No newline at end of file From a5a366ff93180eb95de44ca6d348d3a7a36de06f Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 11 Jun 2020 20:14:32 +0200 Subject: [PATCH 59/70] Fix joint pose conversion --- .../Utilities/OculusHandDataConverter.cs | 171 +++++++++++++----- 1 file changed, 121 insertions(+), 50 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 3637d0b..a59668d 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -6,6 +6,7 @@ using UnityEngine; using XRTK.Definitions.Controllers.Hands; using XRTK.Definitions.Utilities; +using XRTK.Extensions; using XRTK.Oculus.Extensions; using XRTK.Oculus.Plugins; using XRTK.Services; @@ -18,7 +19,21 @@ namespace XRTK.Oculus.Utilities /// public sealed class OculusHandDataConverter { - private readonly Dictionary boneProxyTransforms = new Dictionary(); + /// + /// Destructor. + /// + ~OculusHandDataConverter() + { + if (!conversionProxyRootTransform.IsNull()) + { + conversionProxyTransforms.Clear(); + conversionProxyRootTransform.Destroy(); + } + } + + private Transform conversionProxyRootTransform; + private Transform pointerProxyTransform; + private readonly Dictionary conversionProxyTransforms = new Dictionary(); private OculusApi.Skeleton handSkeleton = new OculusApi.Skeleton(); private OculusApi.HandState handState = new OculusApi.HandState(); @@ -55,7 +70,8 @@ public bool TryGetHandData(Handedness handedness, bool includeMeshData, OculusAp if (handData.IsTracked) { handData.RootPose = GetHandRootPose(handedness); - handData.Joints = GetJointPoses(handedness, handData.RootPose); + handData.Joints = GetJointPoses(handedness); + handData.PointerPose = GetPointerPose(handedness); if (includeMeshData && TryGetUpdatedHandMeshData(handedness, out HandMeshData data)) { @@ -65,8 +81,6 @@ public bool TryGetHandData(Handedness handedness, bool includeMeshData, OculusAp { handData.Mesh = default; } - - handData.PointerPose = ComputePointerPose(handedness); } // Even if the hand is being tracked by the system but the confidence did not @@ -75,37 +89,42 @@ public bool TryGetHandData(Handedness handedness, bool includeMeshData, OculusAp return true; } - private MixedRealityPose[] GetJointPoses(Handedness handedness, MixedRealityPose handRootPose) + /// + /// Gets updated joint poses for all s. + /// + /// Handedness of the hand to read joint poses for. + /// Joint poses in order. + private MixedRealityPose[] GetJointPoses(Handedness handedness) { var jointPoses = new MixedRealityPose[HandData.JointCount]; - jointPoses[(int)TrackedHandJoint.Wrist] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]); + jointPoses[(int)TrackedHandJoint.Wrist] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]); - jointPoses[(int)TrackedHandJoint.ThumbMetacarpal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); - jointPoses[(int)TrackedHandJoint.ThumbProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb2]); - jointPoses[(int)TrackedHandJoint.ThumbDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb3]); - jointPoses[(int)TrackedHandJoint.ThumbTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_ThumbTip]); + jointPoses[(int)TrackedHandJoint.ThumbMetacarpal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); + jointPoses[(int)TrackedHandJoint.ThumbProximal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb2]); + jointPoses[(int)TrackedHandJoint.ThumbDistal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb3]); + jointPoses[(int)TrackedHandJoint.ThumbTip] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_ThumbTip]); - jointPoses[(int)TrackedHandJoint.IndexProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index1]); - jointPoses[(int)TrackedHandJoint.IndexIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index2]); - jointPoses[(int)TrackedHandJoint.IndexDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index3]); - jointPoses[(int)TrackedHandJoint.IndexTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_IndexTip]); + jointPoses[(int)TrackedHandJoint.IndexProximal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index1]); + jointPoses[(int)TrackedHandJoint.IndexIntermediate] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index2]); + jointPoses[(int)TrackedHandJoint.IndexDistal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Index3]); + jointPoses[(int)TrackedHandJoint.IndexTip] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_IndexTip]); - jointPoses[(int)TrackedHandJoint.MiddleProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle1]); - jointPoses[(int)TrackedHandJoint.MiddleIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle2]); - jointPoses[(int)TrackedHandJoint.MiddleDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle3]); - jointPoses[(int)TrackedHandJoint.MiddleTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_MiddleTip]); + jointPoses[(int)TrackedHandJoint.MiddleProximal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle1]); + jointPoses[(int)TrackedHandJoint.MiddleIntermediate] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle2]); + jointPoses[(int)TrackedHandJoint.MiddleDistal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Middle3]); + jointPoses[(int)TrackedHandJoint.MiddleTip] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_MiddleTip]); - jointPoses[(int)TrackedHandJoint.RingProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring1]); - jointPoses[(int)TrackedHandJoint.RingIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring2]); - jointPoses[(int)TrackedHandJoint.RingDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring3]); - jointPoses[(int)TrackedHandJoint.RingTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_RingTip]); + jointPoses[(int)TrackedHandJoint.RingProximal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring1]); + jointPoses[(int)TrackedHandJoint.RingIntermediate] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring2]); + jointPoses[(int)TrackedHandJoint.RingDistal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Ring3]); + jointPoses[(int)TrackedHandJoint.RingTip] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_RingTip]); - jointPoses[(int)TrackedHandJoint.LittleMetacarpal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); - jointPoses[(int)TrackedHandJoint.LittleProximal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky1]); - jointPoses[(int)TrackedHandJoint.LittleIntermediate] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky2]); - jointPoses[(int)TrackedHandJoint.LittleDistal] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky3]); - jointPoses[(int)TrackedHandJoint.LittleTip] = ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_PinkyTip]); + jointPoses[(int)TrackedHandJoint.LittleMetacarpal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); + jointPoses[(int)TrackedHandJoint.LittleProximal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky1]); + jointPoses[(int)TrackedHandJoint.LittleIntermediate] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky2]); + jointPoses[(int)TrackedHandJoint.LittleDistal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky3]); + jointPoses[(int)TrackedHandJoint.LittleTip] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_PinkyTip]); // Estimated: These joint poses are not provided by the Ouclus // hand tracking implementation. But with the data we now have, we can @@ -118,6 +137,12 @@ private MixedRealityPose[] GetJointPoses(Handedness handedness, MixedRealityPose return jointPoses; } + /// + /// Attempts to get updated hand mesh data. + /// + /// The handedness of the hand to get mesh data for. + /// Mesh information retrieved in case of success. + /// True, if mesh data could be loaded. private bool TryGetUpdatedHandMeshData(Handedness handedness, out HandMeshData data) { if (OculusApi.GetMesh(handedness.ToMeshType(), out handMesh)) @@ -159,35 +184,50 @@ private bool TryGetUpdatedHandMeshData(Handedness handedness, out HandMeshData d return false; } - private MixedRealityPose ComputeJointPose(Handedness handedness, MixedRealityPose handRootPose, OculusApi.Bone bone) + /// + /// Gets a single joint's pose relative to the hand root pose. + /// + /// Handedness of the hand the pose belongs to. + /// Bone data retrieved from Oculus API with pose information. + /// Converted joint pose in hand space. + private MixedRealityPose GetJointPose(Handedness handedness, OculusApi.Bone bone) { // The Pinky/Thumb 1+ bones depend on the Pinky/Thumb 0 bone - // to be available, which the XRTK hand tracking does not use. We still gotta update them to - // be able to resolve pose dependencies. + // to be available, which the XRTK hand tracking does not use. We still have to compute them to + // be able to resolve pose relation dependencies. if (bone.Id == OculusApi.BoneId.Hand_Thumb1) { - ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb0]); + GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb0]); } else if (bone.Id == OculusApi.BoneId.Hand_Pinky1) { - ComputeJointPose(handedness, handRootPose, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); + GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky0]); } - var rootBoneTransform = GetProxyTransform(handedness, OculusApi.BoneId.Hand_Start); var boneProxyTransform = GetProxyTransform(handedness, bone.Id); var parentProxyTransform = GetProxyTransform(handedness, (OculusApi.BoneId)bone.ParentBoneIndex); - boneProxyTransform.SetParent(parentProxyTransform, false); - boneProxyTransform.localPosition = bone.Pose.Position.FromFlippedZVector3f(); - boneProxyTransform.localRotation = handState.BoneRotations[(int)bone.Id].FromFlippedZQuatf(); + boneProxyTransform.parent = parentProxyTransform; + + if (bone.ParentBoneIndex == (int)OculusApi.BoneId.Invalid) + { + var rootPose = FixRotation(handedness, new MixedRealityPose(conversionProxyRootTransform.localPosition, conversionProxyRootTransform.localRotation)); + boneProxyTransform.localPosition = rootPose.Position; + boneProxyTransform.localRotation = rootPose.Rotation; + } + else + { + boneProxyTransform.localPosition = bone.Pose.Position.FromFlippedZVector3f(); + boneProxyTransform.localRotation = handState.BoneRotations[(int)bone.Id].FromFlippedZQuatf(); + } return FixRotation(handedness, new MixedRealityPose( - rootBoneTransform.InverseTransformPoint(boneProxyTransform.position), - Quaternion.Inverse(rootBoneTransform.rotation) * boneProxyTransform.rotation)); + conversionProxyRootTransform.InverseTransformPoint(boneProxyTransform.position), + Quaternion.Inverse(conversionProxyRootTransform.rotation) * boneProxyTransform.rotation)); } /// - /// WARNING THIS CODE IS SUBJECT TO CHANGE WITH THE OCULUS SDK. + /// WARNING: THIS CODE IS SUBJECT TO CHANGE WITH THE OCULUS SDK. /// This fix is a hack to fix broken and inconsistent rotations for hands. /// /// Handedness of the hand the pose belongs to. @@ -215,7 +255,7 @@ private MixedRealityPose FixRotation(Handedness handedness, MixedRealityPose joi /// /// THe oculus APIs return joint poses relative to their parent joint unlike /// other platforms where joint poses are relative to the hand root. To convert - /// the joint-->parent-joint relation to hand-root-->joint relations proxy s + /// the joint-->parent-joint relation to joint-->hand-root relations proxy s /// are used. The proxies are parented to their respective parent . /// That way we can make use of Unity APIs to translate coordinate spaces. /// @@ -224,23 +264,43 @@ private MixedRealityPose FixRotation(Handedness handedness, MixedRealityPose joi /// The proxy . private Transform GetProxyTransform(Handedness handedness, OculusApi.BoneId boneId) { + if (conversionProxyRootTransform.IsNull()) + { + conversionProxyRootTransform = new GameObject($"Oculus Hand Conversion Proxy").transform; + conversionProxyRootTransform.transform.SetParent(MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform, false); + conversionProxyRootTransform.gameObject.SetActive(false); + } + + // Depending on the handedness we are currently working on, we need to + // rotate the conversion root. Same dilemma as with FixRotation above. + conversionProxyRootTransform.localRotation = Quaternion.Euler(0f, handedness == Handedness.Right ? 180f : 0f, 0f); + if (boneId == OculusApi.BoneId.Invalid) { - return MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; + return conversionProxyRootTransform; } - if (boneProxyTransforms.ContainsKey(boneId)) + if (conversionProxyTransforms.ContainsKey(boneId)) { - return boneProxyTransforms[boneId]; + return conversionProxyTransforms[boneId]; } - var transform = new GameObject($"Oculus {handedness} Hand {boneId} Proxy").transform; - transform.gameObject.SetActive(false); - boneProxyTransforms.Add(boneId, transform); + var transform = new GameObject($"Oculus Hand {boneId} Proxy").transform; + + var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); + cube.transform.localScale = new Vector3(.01f, .01f, .01f); + cube.transform.SetParent(transform, false); + + conversionProxyTransforms.Add(boneId, transform); return transform; } + /// + /// Gets the hand's root pose. + /// + /// Handedness of the hand to get the pose for. + /// The hand root pose is the point of reference for all joint poses. private MixedRealityPose GetHandRootPose(Handedness handedness) { var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; @@ -259,13 +319,24 @@ private MixedRealityPose GetHandRootPose(Handedness handedness) /// /// Handedness of the hand the pose belongs to. /// Pointer pose relative to . - private MixedRealityPose ComputePointerPose(Handedness handedness) + private MixedRealityPose GetPointerPose(Handedness handedness) { - var platformPointerPose = new MixedRealityPose( + if (pointerProxyTransform.IsNull()) + { + pointerProxyTransform = new GameObject("Oculus Hand Pointer Pose Proxy").transform; + pointerProxyTransform.SetParent(conversionProxyRootTransform, false); + } + + var platformPointerPose = FixRotation(handedness, new MixedRealityPose( handState.PointerPose.Position.FromFlippedZVector3f(), - handState.PointerPose.Orientation.FromFlippedZQuatf()); + handState.PointerPose.Orientation.FromFlippedZQuatf())); + + pointerProxyTransform.localPosition = conversionProxyRootTransform.InverseTransformPoint(platformPointerPose.Position); + pointerProxyTransform.localRotation = platformPointerPose.Rotation; - return FixRotation(handedness, platformPointerPose); + return new MixedRealityPose( + pointerProxyTransform.localPosition, + pointerProxyTransform.localRotation); } } } \ No newline at end of file From 57635aadc036a8c51142536105c4bfa36e27524c Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 11 Jun 2020 20:45:56 +0200 Subject: [PATCH 60/70] Allow changing required tracking confidence in runtime --- .../InputSystem/Controllers/OculusHandControllerDataProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs index 2cc0bc2..b17b494 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs @@ -41,7 +41,7 @@ public OculusHandControllerDataProvider(string name, uint priority, OculusHandCo /// /// The minimum required tracking confidence for hands to be registered. /// - public OculusApi.TrackingConfidence MinConfidenceRequired { get; } + public OculusApi.TrackingConfidence MinConfidenceRequired { get; set; } /// public override void Update() From 9b5d6b5cbffccd0bf8d65fc82efc1f5b6b746299 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 14 Jun 2020 17:55:31 +0200 Subject: [PATCH 61/70] Fix hands starting position offset issue --- .../Utilities/OculusHandDataConverter.cs | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index a59668d..d45a3b7 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -32,7 +32,6 @@ public sealed class OculusHandDataConverter } private Transform conversionProxyRootTransform; - private Transform pointerProxyTransform; private readonly Dictionary conversionProxyTransforms = new Dictionary(); private OculusApi.Skeleton handSkeleton = new OculusApi.Skeleton(); @@ -79,7 +78,7 @@ public bool TryGetHandData(Handedness handedness, bool includeMeshData, OculusAp } else { - handData.Mesh = default; + handData.Mesh = HandMeshData.Empty; } } @@ -311,7 +310,7 @@ private MixedRealityPose GetHandRootPose(Handedness handedness) var rootPosition = playspaceTransform.InverseTransformPoint(handState.RootPose.Position.FromFlippedZVector3f()); var rootRotation = Quaternion.Inverse(playspaceTransform.rotation) * handState.RootPose.Orientation.FromFlippedZQuatf(); - return FixRotation(handedness, new MixedRealityPose(rootPosition + new Vector3(0f, cameraTransform.localPosition.y, 0f), rootRotation)); + return FixRotation(handedness, new MixedRealityPose(rootPosition + new Vector3(0f, OculusApi.EyeHeight, 0f), rootRotation)); } /// @@ -321,22 +320,14 @@ private MixedRealityPose GetHandRootPose(Handedness handedness) /// Pointer pose relative to . private MixedRealityPose GetPointerPose(Handedness handedness) { - if (pointerProxyTransform.IsNull()) - { - pointerProxyTransform = new GameObject("Oculus Hand Pointer Pose Proxy").transform; - pointerProxyTransform.SetParent(conversionProxyRootTransform, false); - } - - var platformPointerPose = FixRotation(handedness, new MixedRealityPose( - handState.PointerPose.Position.FromFlippedZVector3f(), - handState.PointerPose.Orientation.FromFlippedZQuatf())); + var platformRootPose = FixRotation(handedness, new MixedRealityPose( + handState.RootPose.Position.FromFlippedZVector3f(), + handState.RootPose.Orientation.FromFlippedZQuatf())); - pointerProxyTransform.localPosition = conversionProxyRootTransform.InverseTransformPoint(platformPointerPose.Position); - pointerProxyTransform.localRotation = platformPointerPose.Rotation; + var platformPointerPosition = handState.PointerPose.Position.FromFlippedZVector3f() - platformRootPose.Position; + var platformPointerRotation = platformRootPose.Rotation * handState.PointerPose.Orientation.FromFlippedZQuatf(); - return new MixedRealityPose( - pointerProxyTransform.localPosition, - pointerProxyTransform.localRotation); + return new MixedRealityPose(platformPointerPosition, platformPointerRotation); } } } \ No newline at end of file From 063923527e5db6c2a8559abfd98301768c311d66 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 14 Jun 2020 18:31:58 +0200 Subject: [PATCH 62/70] Use TrackingState instead of bool for tracking state --- .../Runtime/Utilities/OculusHandDataConverter.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index d45a3b7..ba1687a 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using UnityEngine; using XRTK.Definitions.Controllers.Hands; +using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; using XRTK.Extensions; using XRTK.Oculus.Extensions; @@ -60,13 +61,13 @@ public bool TryGetHandData(Handedness handedness, bool includeMeshData, OculusAp // it tracked. handData = new HandData { - IsTracked = handState.HandConfidence >= minTrackingConfidence && (handState.Status & OculusApi.HandStatus.HandTracked) != 0, + TrackingState = (handState.HandConfidence >= minTrackingConfidence && (handState.Status & OculusApi.HandStatus.HandTracked) != 0) ? TrackingState.Tracked : TrackingState.NotTracked, UpdatedAt = DateTimeOffset.UtcNow.Ticks }; // If the hand is tracked per requirements, we get updated joint data // and other data needed for updating the hand controller's state. - if (handData.IsTracked) + if (handData.TrackingState == TrackingState.Tracked) { handData.RootPose = GetHandRootPose(handedness); handData.Joints = GetJointPoses(handedness); @@ -303,10 +304,6 @@ private Transform GetProxyTransform(Handedness handedness, OculusApi.BoneId bone private MixedRealityPose GetHandRootPose(Handedness handedness) { var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; - var cameraTransform = MixedRealityToolkit.CameraSystem != null - ? MixedRealityToolkit.CameraSystem.MainCameraRig.PlayerCamera.transform - : CameraCache.Main.transform; - var rootPosition = playspaceTransform.InverseTransformPoint(handState.RootPose.Position.FromFlippedZVector3f()); var rootRotation = Quaternion.Inverse(playspaceTransform.rotation) * handState.RootPose.Orientation.FromFlippedZQuatf(); @@ -320,12 +317,16 @@ private MixedRealityPose GetHandRootPose(Handedness handedness) /// Pointer pose relative to . private MixedRealityPose GetPointerPose(Handedness handedness) { + var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; + var platformRootPose = FixRotation(handedness, new MixedRealityPose( handState.RootPose.Position.FromFlippedZVector3f(), handState.RootPose.Orientation.FromFlippedZQuatf())); var platformPointerPosition = handState.PointerPose.Position.FromFlippedZVector3f() - platformRootPose.Position; - var platformPointerRotation = platformRootPose.Rotation * handState.PointerPose.Orientation.FromFlippedZQuatf(); + + var platformPointerRotation = Quaternion.Inverse(playspaceTransform.rotation) * platformRootPose.Rotation; + //var platformPointerRotation = platformRootPose.Rotation * handState.PointerPose.Orientation.FromFlippedZQuatf(); return new MixedRealityPose(platformPointerPosition, platformPointerRotation); } From c2a8cf331a88cb11303413168bf1846551c42ffe Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 14 Jun 2020 19:03:26 +0200 Subject: [PATCH 63/70] Fix pointer pose --- .../Runtime/Utilities/OculusHandDataConverter.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index ba1687a..91f4cf7 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -300,7 +300,7 @@ private Transform GetProxyTransform(Handedness handedness, OculusApi.BoneId bone /// Gets the hand's root pose. /// /// Handedness of the hand to get the pose for. - /// The hand root pose is the point of reference for all joint poses. + /// The hands value. private MixedRealityPose GetHandRootPose(Handedness handedness) { var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; @@ -314,19 +314,15 @@ private MixedRealityPose GetHandRootPose(Handedness handedness) /// Gets the hand's local pointer pose. /// /// Handedness of the hand the pose belongs to. - /// Pointer pose relative to . + /// The hands value. private MixedRealityPose GetPointerPose(Handedness handedness) { var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; + var rootPose = GetHandRootPose(handedness); + var platformRootPosition = handState.RootPose.Position.FromFlippedZVector3f(); - var platformRootPose = FixRotation(handedness, new MixedRealityPose( - handState.RootPose.Position.FromFlippedZVector3f(), - handState.RootPose.Orientation.FromFlippedZQuatf())); - - var platformPointerPosition = handState.PointerPose.Position.FromFlippedZVector3f() - platformRootPose.Position; - - var platformPointerRotation = Quaternion.Inverse(playspaceTransform.rotation) * platformRootPose.Rotation; - //var platformPointerRotation = platformRootPose.Rotation * handState.PointerPose.Orientation.FromFlippedZQuatf(); + var platformPointerPosition = rootPose.Position + handState.PointerPose.Position.FromFlippedZVector3f() - platformRootPosition; + var platformPointerRotation = Quaternion.Inverse(playspaceTransform.rotation) * handState.PointerPose.Orientation.FromFlippedZQuatf(); return new MixedRealityPose(platformPointerPosition, platformPointerRotation); } From 3006e53c54c0e4b35efcf352e68f41bde521deeb Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 14 Jun 2020 19:47:51 +0200 Subject: [PATCH 64/70] Undo namespace change --- .../Profiles/OculusControllerDataProviderProfile.cs | 2 +- .../Runtime/Providers/{InputSystem => }/Controllers.meta | 0 .../{InputSystem => }/Controllers/BaseOculusController.cs | 2 +- .../Controllers/BaseOculusController.cs.meta | 0 .../Controllers/OculusControllerDataProvider.cs | 2 +- .../Controllers/OculusControllerDataProvider.cs.meta | 0 .../{InputSystem => }/Controllers/OculusGoController.cs | 2 +- .../Controllers/OculusGoController.cs.meta | 0 .../Controllers/OculusHandControllerDataProvider.cs | 2 +- .../Controllers/OculusHandControllerDataProvider.cs.meta | 0 .../Controllers/OculusRemoteController.cs | 2 +- .../Controllers/OculusRemoteController.cs.meta | 0 .../Controllers/OculusTouchController.cs | 2 +- .../Controllers/OculusTouchController.cs.meta | 0 .../com.xrtk.oculus/Runtime/Providers/InputSystem.meta | 8 -------- 15 files changed, 7 insertions(+), 15 deletions(-) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/BaseOculusController.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/BaseOculusController.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusControllerDataProvider.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusControllerDataProvider.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusGoController.cs (98%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusGoController.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusHandControllerDataProvider.cs (98%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusHandControllerDataProvider.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusRemoteController.cs (97%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusRemoteController.cs.meta (100%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusTouchController.cs (99%) rename XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/{InputSystem => }/Controllers/OculusTouchController.cs.meta (100%) delete mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta 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 dfc4f1f..1b58c08 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Profiles/OculusControllerDataProviderProfile.cs @@ -3,7 +3,7 @@ using XRTK.Definitions.Controllers; using XRTK.Definitions.Utilities; -using XRTK.Oculus.Providers.InputSystem.Controllers; +using XRTK.Oculus.Providers.Controllers; namespace XRTK.Oculus.Profiles { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs index 4d5f0ec..3eb6366 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs @@ -13,7 +13,7 @@ using XRTK.Providers.Controllers; using XRTK.Services; -namespace XRTK.Oculus.Providers.InputSystem.Controllers +namespace XRTK.Oculus.Providers.Controllers { public abstract class BaseOculusController : BaseController { diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/BaseOculusController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/BaseOculusController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs index 42139cc..f1372dd 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs @@ -13,7 +13,7 @@ using XRTK.Providers.Controllers; using XRTK.Services; -namespace XRTK.Oculus.Providers.InputSystem.Controllers +namespace XRTK.Oculus.Providers.Controllers { [RuntimePlatform(typeof(OculusPlatform))] [System.Runtime.InteropServices.Guid("0DE5DA40-FEB8-4891-B9B2-942EAFD041B9")] diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusControllerDataProvider.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusControllerDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs similarity index 98% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs index eb5e08d..1bdec97 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs @@ -7,7 +7,7 @@ using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Plugins; -namespace XRTK.Oculus.Providers.InputSystem.Controllers +namespace XRTK.Oculus.Providers.Controllers { [System.Runtime.InteropServices.Guid("A1417657-5FF3-402D-8376-D8E1689175A9")] public class OculusGoController : BaseOculusController diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusGoController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusGoController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs similarity index 98% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs index b17b494..6d0851b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs @@ -15,7 +15,7 @@ using XRTK.Providers.Controllers.Hands; using XRTK.Services; -namespace XRTK.Oculus.Providers.InputSystem.Controllers +namespace XRTK.Oculus.Providers.Controllers { [RuntimePlatform(typeof(OculusPlatform))] [System.Runtime.InteropServices.Guid("EA666456-BAEF-4412-A829-A4C7132E98C3")] diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusHandControllerDataProvider.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusHandControllerDataProvider.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs similarity index 97% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs index fd4cd35..fbb0fb0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs @@ -7,7 +7,7 @@ using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Plugins; -namespace XRTK.Oculus.Providers.InputSystem.Controllers +namespace XRTK.Oculus.Providers.Controllers { [System.Runtime.InteropServices.Guid("071048C6-31F3-460C-863F-5D3121F47654")] public class OculusRemoteController : BaseOculusController diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusRemoteController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusRemoteController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs similarity index 99% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs index a678792..ef022bb 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs @@ -7,7 +7,7 @@ using XRTK.Interfaces.Providers.Controllers; using XRTK.Oculus.Plugins; -namespace XRTK.Oculus.Providers.InputSystem.Controllers +namespace XRTK.Oculus.Providers.Controllers { [System.Runtime.InteropServices.Guid("1898974A-DBCD-4C88-8E03-726689848D52")] public class OculusTouchController : BaseOculusController diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs.meta similarity index 100% rename from XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem/Controllers/OculusTouchController.cs.meta rename to XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/Controllers/OculusTouchController.cs.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta deleted file mode 100644 index c97feb4..0000000 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Providers/InputSystem.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 05ad0e8d7677dce41912bcc06b967a3e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: From ee89d8c65779cc7916fd628e72ad3a5bca452d8e Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 16 Jun 2020 00:17:25 +0200 Subject: [PATCH 65/70] Fix positioning after teleport --- .../Runtime/Utilities/OculusHandDataConverter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 91f4cf7..b683f32 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -304,8 +304,8 @@ private Transform GetProxyTransform(Handedness handedness, OculusApi.BoneId bone private MixedRealityPose GetHandRootPose(Handedness handedness) { var playspaceTransform = MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform; - var rootPosition = playspaceTransform.InverseTransformPoint(handState.RootPose.Position.FromFlippedZVector3f()); - var rootRotation = Quaternion.Inverse(playspaceTransform.rotation) * handState.RootPose.Orientation.FromFlippedZQuatf(); + var rootPosition = playspaceTransform.InverseTransformPoint(playspaceTransform.position + playspaceTransform.rotation * handState.RootPose.Position.FromFlippedZVector3f()); + var rootRotation = Quaternion.Inverse(playspaceTransform.rotation) * playspaceTransform.rotation * handState.RootPose.Orientation.FromFlippedZQuatf(); return FixRotation(handedness, new MixedRealityPose(rootPosition + new Vector3(0f, OculusApi.EyeHeight, 0f), rootRotation)); } @@ -322,7 +322,7 @@ private MixedRealityPose GetPointerPose(Handedness handedness) var platformRootPosition = handState.RootPose.Position.FromFlippedZVector3f(); var platformPointerPosition = rootPose.Position + handState.PointerPose.Position.FromFlippedZVector3f() - platformRootPosition; - var platformPointerRotation = Quaternion.Inverse(playspaceTransform.rotation) * handState.PointerPose.Orientation.FromFlippedZQuatf(); + var platformPointerRotation = Quaternion.Inverse(playspaceTransform.rotation) * playspaceTransform.rotation * handState.PointerPose.Orientation.FromFlippedZQuatf(); return new MixedRealityPose(platformPointerPosition, platformPointerRotation); } From 63bad776afd23e93d18a6205dce94d6106004460 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 15 Jun 2020 23:23:01 -0400 Subject: [PATCH 66/70] fixed some typos --- .../Runtime/Utilities/OculusHandDataConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index b683f32..5867bbf 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -126,7 +126,7 @@ private MixedRealityPose[] GetJointPoses(Handedness handedness) jointPoses[(int)TrackedHandJoint.LittleDistal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Pinky3]); jointPoses[(int)TrackedHandJoint.LittleTip] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_PinkyTip]); - // Estimated: These joint poses are not provided by the Ouclus + // Estimated: These joint poses are not provided by the Oculus // hand tracking implementation. But with the data we now have, we can // estimate their poses fairly well. jointPoses[(int)TrackedHandJoint.Palm] = HandUtilities.GetEstimatedPalmPose(jointPoses); @@ -266,7 +266,7 @@ private Transform GetProxyTransform(Handedness handedness, OculusApi.BoneId bone { if (conversionProxyRootTransform.IsNull()) { - conversionProxyRootTransform = new GameObject($"Oculus Hand Conversion Proxy").transform; + conversionProxyRootTransform = new GameObject("Oculus Hand Conversion Proxy").transform; conversionProxyRootTransform.transform.SetParent(MixedRealityToolkit.CameraSystem.MainCameraRig.PlayspaceTransform, false); conversionProxyRootTransform.gameObject.SetActive(false); } From 44b49565551b55c42e7d6ae152b6ad04a4d138a5 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 21 Jun 2020 21:06:17 +0200 Subject: [PATCH 67/70] Cache joint poses array --- .../Runtime/Utilities/OculusHandDataConverter.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index 5867bbf..b646123 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -34,6 +34,7 @@ public sealed class OculusHandDataConverter private Transform conversionProxyRootTransform; private readonly Dictionary conversionProxyTransforms = new Dictionary(); + private readonly MixedRealityPose[] jointPoses = new MixedRealityPose[HandData.JointCount]; private OculusApi.Skeleton handSkeleton = new OculusApi.Skeleton(); private OculusApi.HandState handState = new OculusApi.HandState(); @@ -96,8 +97,6 @@ public bool TryGetHandData(Handedness handedness, bool includeMeshData, OculusAp /// Joint poses in order. private MixedRealityPose[] GetJointPoses(Handedness handedness) { - var jointPoses = new MixedRealityPose[HandData.JointCount]; - jointPoses[(int)TrackedHandJoint.Wrist] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_WristRoot]); jointPoses[(int)TrackedHandJoint.ThumbMetacarpal] = GetJointPose(handedness, handSkeleton.Bones[(int)OculusApi.BoneId.Hand_Thumb1]); From faf05132c1c96f9ee9ef2701cea4278cb81cd65b Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 1 Aug 2020 12:49:15 +0200 Subject: [PATCH 68/70] Remove debug code --- .../Runtime/Utilities/OculusHandDataConverter.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index b646123..c6e6abb 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -285,11 +285,6 @@ private Transform GetProxyTransform(Handedness handedness, OculusApi.BoneId bone } var transform = new GameObject($"Oculus Hand {boneId} Proxy").transform; - - var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); - cube.transform.localScale = new Vector3(.01f, .01f, .01f); - cube.transform.SetParent(transform, false); - conversionProxyTransforms.Add(boneId, transform); return transform; From cd634135b2e896842e907552e6ac62b7079a9cbe Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 17 Sep 2020 20:39:15 +0200 Subject: [PATCH 69/70] Fix typo in docs --- .../Runtime/Utilities/OculusHandDataConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs index c6e6abb..9e68547 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Runtime/Utilities/OculusHandDataConverter.cs @@ -252,7 +252,7 @@ private MixedRealityPose FixRotation(Handedness handedness, MixedRealityPose joi } /// - /// THe oculus APIs return joint poses relative to their parent joint unlike + /// The oculus APIs return joint poses relative to their parent joint unlike /// other platforms where joint poses are relative to the hand root. To convert /// the joint-->parent-joint relation to joint-->hand-root relations proxy s /// are used. The proxies are parented to their respective parent . From 47f2e3d1474c8ff89c3ff32b8bac7fb0c7ae9047 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Fri, 18 Sep 2020 19:20:15 +0200 Subject: [PATCH 70/70] Commit updated profile GUIDs --- .../Profiles~/Controllers/OculusTouchController.meta | 8 ++++++++ .../Profiles~/Controllers/OculusTouchController/Left.meta | 2 +- .../Left/Axis1D.PrimaryHandTriggerPressProfile.asset.meta | 2 +- .../Left/Axis1D.PrimaryHandTriggerProfile.asset.meta | 2 +- .../Axis1D.PrimaryIndexTriggerNearTouchProfile.asset.meta | 2 +- .../Axis1D.PrimaryIndexTriggerPressProfile.asset.meta | 2 +- .../Left/Axis1D.PrimaryIndexTriggerProfile.asset.meta | 2 +- .../Axis1D.PrimaryIndexTriggerTouchProfile.asset.meta | 2 +- .../Left/Axis2D.PrimaryThumbRestProfile.asset.meta | 2 +- .../Left/Axis2D.PrimaryThumbstickProfile.asset.meta | 2 +- .../Left/Button.FourPressProfile.asset.meta | 2 +- .../Left/Button.FourTouchProfile.asset.meta | 2 +- .../Button.PrimaryThumbstickNearTouchProfile.asset.meta | 2 +- .../Left/Button.PrimaryThumbstickPressProfile.asset.meta | 2 +- .../Left/Button.PrimaryThumbstickTouchProfile.asset.meta | 2 +- .../Left/Button.StartPressProfile.asset.meta | 2 +- .../Left/Button.ThreePressProfile.asset.meta | 2 +- .../Left/Button.ThreeTouchProfile.asset.meta | 2 +- .../Left/SpatialPointerProfile.asset.meta | 2 +- .../Touch.PrimaryThumbRestNearTouchProfile.asset.meta | 2 +- .../Left/Touch.PrimaryThumbRestTouchProfile.asset.meta | 2 +- .../Controllers/OculusTouchController/Right.meta | 2 +- .../Axis1D.SecondaryHandTriggerPressProfile.asset.meta | 2 +- .../Right/Axis1D.SecondaryHandTriggerProfile.asset.meta | 2 +- ...xis1D.SecondaryIndexTriggerNearTouchProfile.asset.meta | 2 +- .../Axis1D.SecondaryIndexTriggerPressProfile.asset.meta | 2 +- .../Right/Axis1D.SecondaryIndexTriggerProfile.asset.meta | 2 +- .../Axis1D.SecondaryIndexTriggerTouchProfile.asset.meta | 2 +- .../Right/Axis2D.SecondaryThumbRestProfile.asset.meta | 2 +- .../Right/Axis2D.SecondaryThumbstickProfile.asset.meta | 2 +- .../Right/Button.OnePressProfile.asset.meta | 2 +- .../Right/Button.OneTouchProfile.asset.meta | 2 +- .../Button.SecondaryThumbstickNearTouchProfile.asset.meta | 2 +- .../Button.SecondaryThumbstickPressProfile.asset.meta | 2 +- .../Button.SecondaryThumbstickTouchProfile.asset.meta | 2 +- .../Right/Button.TwoPressProfile.asset.meta | 2 +- .../Right/Button.TwoTouchProfile.asset.meta | 2 +- .../Right/SpatialPointerProfile.asset.meta | 2 +- .../Touch.SecondaryThumbRestNearTouchProfile.asset.meta | 2 +- .../Right/Touch.SecondaryThumbRestTouchProfile.asset.meta | 2 +- 40 files changed, 47 insertions(+), 39 deletions(-) create mode 100644 XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController.meta diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController.meta new file mode 100644 index 0000000..f851637 --- /dev/null +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1b4d2bf8adc9c1c42a2476f8cc716b09 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left.meta index 4fd38c5..a06d79b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 766b73f69c2ec87418a5c622ae4472e9 +guid: 7d3625a1084aca940a63c35a581cf412 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset.meta index 43c535c..9ae946f 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4e6ca112a89bc8a4da89d367f0972644 +guid: fdcc142fd435d81449934f1c47f2c7e6 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset.meta index d69bc2f..a387dd2 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryHandTriggerProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b62bdd20dc750f84e95524a5ed7d4a95 +guid: 15b05a8a0a9d281448ab94b8bf549e60 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerNearTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerNearTouchProfile.asset.meta index e93f420..a87adc6 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerNearTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerNearTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9eada80ad9c3f0c478db97cacea7f982 +guid: dd799fbfb54e7c84dae7323ba609276f NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerPressProfile.asset.meta index 891d181..e109bac 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6684da1c5537924408242aeb09a96722 +guid: 9947f38f310de894c9a897f071cade52 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerProfile.asset.meta index 146d2c4..1c86459 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 078df0b10d3e1074aa9976f4f928f38a +guid: 9bbed734892721644b6da3bd9c1f7b33 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerTouchProfile.asset.meta index 6486384..f24e824 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis1D.PrimaryIndexTriggerTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ba4b36566bff5d4458c382a5f8e2de42 +guid: d85c1e429b274984faa59055b93190ff NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbRestProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbRestProfile.asset.meta index e0dde89..e645cff 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbRestProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbRestProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5f2c3f2b7b17e8447b5cb3671f5089f4 +guid: fb9b971cf238bb4449528a3b93906c0a NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbstickProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbstickProfile.asset.meta index 025a3d6..cddda02 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbstickProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Axis2D.PrimaryThumbstickProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8d73d3132335ac94b88a13f1de60c5ec +guid: a62d36f527a475448bce7121320d2e65 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourPressProfile.asset.meta index 8cf6fed..97e6435 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 70d4b454d4d7bd54184fffbfc81f5218 +guid: 7bf684345285a0a4b86a5fd728f337b9 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourTouchProfile.asset.meta index 3a885b9..12f2530 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.FourTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 443ada4c65fe2ac4a875bcd77403e738 +guid: 38d92e59b53a61541beea419e3c9e65c NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickNearTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickNearTouchProfile.asset.meta index 9c20069..789dec8 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickNearTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickNearTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: eef5b794e9afa6d4588670577951c8cf +guid: fd37d827948d19e4287dc0cba0cee5fd NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickPressProfile.asset.meta index 92fd666..8323ca4 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 80f56a87a099e6f4281aaa6a6c6bdfaa +guid: 108fcaa8f8b1b334f9e7c962dc72e975 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickTouchProfile.asset.meta index 7aca38f..c4d21ac 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.PrimaryThumbstickTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 71af88ada0f87b6408b687dfe017f671 +guid: 5dacfe2e20ed1f74fb6b024adaa96243 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.StartPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.StartPressProfile.asset.meta index ca3d81d..9cd1b61 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.StartPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.StartPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0607425e4bb401441be2af20781aa40a +guid: 030560660c2f6d442a305ecc72e0b461 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreePressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreePressProfile.asset.meta index 117b484..c533786 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreePressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreePressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5d833127727b79d4dbc607a5a365a3f2 +guid: 733e04f2316e4fa448bbf1b605beb5e6 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreeTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreeTouchProfile.asset.meta index b311c76..c639776 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreeTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Button.ThreeTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1128cf02f922803459c393066239a212 +guid: 25da088bf8992fd44854880191082b59 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/SpatialPointerProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/SpatialPointerProfile.asset.meta index 5fe51dd..e61ec79 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/SpatialPointerProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/SpatialPointerProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 30554a684776dc64d832efa06d8879e6 +guid: d3c46e95cd50b9347b3ae2b984258b3c NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestNearTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestNearTouchProfile.asset.meta index 77bad1a..e11bb02 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestNearTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestNearTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e9709613c576c064dabe0b6962a09252 +guid: 4c2c7b74b24b9d946af40c80ee0d0e9a NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestTouchProfile.asset.meta index db8379b..6f71aee 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Left/Touch.PrimaryThumbRestTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9fa15f0e93480ee45b868c815ae0a531 +guid: a28ef8a54b31cd7429a330d53d37bda4 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right.meta index 5593555..70e971d 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dfdd9c1df9ffaae4e9c819543870a8c4 +guid: 0186bc4dba0b0d64987fb69d71c796bd folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset.meta index 438e976..d9973cf 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4c67768e5e360dc4abbbba8e0145cdf1 +guid: 393406af530d2214d9aa1993942f5ff7 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset.meta index 93ddc99..3898fb3 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryHandTriggerProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c4fd1955456798541b4464d923b5b7e5 +guid: df4722feeca5a33488b7c7a6addddee5 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerNearTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerNearTouchProfile.asset.meta index 61d6341..62a7bc2 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerNearTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerNearTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 154f225352d33ad4badc96d265a10380 +guid: 8e023d2fa54b8d348b7457ba537d8332 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerPressProfile.asset.meta index 557129f..9a39998 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5eb2d7a4736229049bdeee1927419c0d +guid: cba7d50e18cd90041adb4ce347621080 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerProfile.asset.meta index 118524b..bba86ca 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0d499af05ab248c4fa0b76ca57527b2a +guid: ae7b13680e4179749a28db707c1b0380 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerTouchProfile.asset.meta index bd152b1..96d4f73 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis1D.SecondaryIndexTriggerTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8ebab325de63c1440bbcd61f35ebd278 +guid: 4bcb3661197898d4292c18b99b333014 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbRestProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbRestProfile.asset.meta index 7af105a..99e19b0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbRestProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbRestProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 87792809226055e40a2b904857601712 +guid: dd3b05d4a1ecb1a4fb8223e48a0e2cd5 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbstickProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbstickProfile.asset.meta index d0dceea..1427878 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbstickProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Axis2D.SecondaryThumbstickProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 59c9da44d8d7ab54a83b905d5f4265e3 +guid: fae8482b0216de4469c1c7ebf0b3049e NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OnePressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OnePressProfile.asset.meta index d809233..5c440b0 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OnePressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OnePressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 888aed8e55b3f584188319372e7a8a55 +guid: 5f0ef58103b43f84cbbf4fc0aa96bde9 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OneTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OneTouchProfile.asset.meta index ad6f96f..6bf058e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OneTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.OneTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6f83c259404c1be489a7c9077ebb0b28 +guid: 9b0fbb1f88de9574b8b89e38f3678182 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickNearTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickNearTouchProfile.asset.meta index 5d952b4..412c0ab 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickNearTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickNearTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1c3202d2b268f8149899c7e1487b656b +guid: 3b6894b2217fe5846aa9a0e83bafb08b NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickPressProfile.asset.meta index 7a9318e..46baa44 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e7124493dc782cf4889645f9ec2c01bf +guid: aceecb4f01c85ae46bc76cb3dd39ebca NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickTouchProfile.asset.meta index b7b5c61..25e3649 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.SecondaryThumbstickTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 583a2a4a4d22a63478d0ada16f510874 +guid: 425e5d256fb0f5d4bbd7853c139a36c6 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoPressProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoPressProfile.asset.meta index 421e299..28ef908 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoPressProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoPressProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 505faf22e96b9404d837af78c42932b2 +guid: 75c8347d2665a56419afdfb036c06a63 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoTouchProfile.asset.meta index fdd3544..9337a4b 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Button.TwoTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5e8424acaef6b4f4f8d91b6e39808752 +guid: 771a9bda940dc984c80cbd0246277368 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/SpatialPointerProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/SpatialPointerProfile.asset.meta index dd9b945..a26d50e 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/SpatialPointerProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/SpatialPointerProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b3dda0b9a337a1b4f8b49b4abe228acb +guid: f647a94a748f32743840d17a974be2ef NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestNearTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestNearTouchProfile.asset.meta index ef311dd..86f5117 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestNearTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestNearTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 44d64e0bc9d128f42b8f4718a6a2484b +guid: a29c31e27b6a4dd478d0baffe9c452bf NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestTouchProfile.asset.meta b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestTouchProfile.asset.meta index c3bfd48..4f04cb4 100644 --- a/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestTouchProfile.asset.meta +++ b/XRTK.Oculus/Packages/com.xrtk.oculus/Profiles~/Controllers/OculusTouchController/Right/Touch.SecondaryThumbRestTouchProfile.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 881b2d5a2173e8c4e9921ed1e726b45c +guid: 8d874651626c3ec468f4807dc53538b0 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000