From feeadb610f5d876075d10dafb52ae14ad35708a7 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 6 Apr 2020 13:46:54 -0400 Subject: [PATCH 01/52] updated lumin controller data provider --- .../Controllers/LuminController.cs | 18 +++++----- ...MotionControllerMappingProfileInspector.cs | 14 -------- ...nControllerMappingProfileInspector.cs.meta | 11 ------ ...uminMotionControllerDataProviderProfile.cs | 17 +++++++++ ...tionControllerDataProviderProfile.cs.meta} | 0 .../LuminMotionControllerMappingProfile.cs | 36 ------------------- 6 files changed, 26 insertions(+), 70 deletions(-) delete mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs delete mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs.meta create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs rename XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/{LuminMotionControllerMappingProfile.cs.meta => LuminMotionControllerDataProviderProfile.cs.meta} (100%) delete mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerMappingProfile.cs diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index 27f96e2..1566215 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -25,15 +25,15 @@ public LuminController(TrackingState trackingState, Handedness controllerHandedn public override MixedRealityInteractionMapping[] DefaultInteractions => new[] { - new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(1, "Trigger Position", AxisType.SingleAxis, DeviceInputType.Trigger, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(2, "Trigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(3, "Trigger Press (Select)", AxisType.Digital, DeviceInputType.Select, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(4, "Bumper Press", AxisType.Digital, DeviceInputType.ButtonPress, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(5, "Home Press", AxisType.Digital, DeviceInputType.ButtonPress, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(6, "Touchpad Position", AxisType.DualAxis, DeviceInputType.Touchpad, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(7, "Touchpad Press", AxisType.SingleAxis, DeviceInputType.TouchpadPress, MixedRealityInputAction.None), - new MixedRealityInteractionMapping(8, "Touchpad Touch", AxisType.SingleAxis, DeviceInputType.TouchpadTouch, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Trigger Position", AxisType.SingleAxis, DeviceInputType.Trigger, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Trigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Trigger Press (Select)", AxisType.Digital, DeviceInputType.Select, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Bumper Press", AxisType.Digital, DeviceInputType.ButtonPress, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Home Press", AxisType.Digital, DeviceInputType.ButtonPress, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Touchpad Position", AxisType.DualAxis, DeviceInputType.Touchpad, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Touchpad Press", AxisType.SingleAxis, DeviceInputType.TouchpadPress, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Touchpad Touch", AxisType.SingleAxis, DeviceInputType.TouchpadTouch, MixedRealityInputAction.None), }; /// diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs deleted file mode 100644 index b8ed105..0000000 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs +++ /dev/null @@ -1,14 +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.Lumin.Profiles; - -namespace XRTK.Lumin.Inspectors -{ - [CustomEditor(typeof(LuminMotionControllerMappingProfile))] - public class LuminMotionControllerMappingProfileInspector : BaseMixedRealityControllerMappingProfileInspector - { - } -} \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs.meta deleted file mode 100644 index aa0a263..0000000 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminMotionControllerMappingProfileInspector.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 9c124191003df5642906d0a9f2882a4e -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs new file mode 100644 index 0000000..97f50d1 --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.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.Lumin.Profiles +{ + public class LuminMotionControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile + { + public override ControllerDefinition[] GetControllerDefinitions() + { + // new MixedRealityControllerMapping("Lumin Motion Controller Left", typeof(LuminController), Handedness.Left), + // new MixedRealityControllerMapping("Lumin Motion Controller Right", typeof(LuminController), Handedness.Right), + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerMappingProfile.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs.meta similarity index 100% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerMappingProfile.cs.meta rename to XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerMappingProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerMappingProfile.cs deleted file mode 100644 index df4e63b..0000000 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerMappingProfile.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.Lumin.Controllers; -using XRTK.Definitions.Controllers; -using XRTK.Providers.Controllers; - -namespace XRTK.Lumin.Profiles -{ - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Mappings/Lumin Controller Mapping Profile", fileName = "LuminControllerMappingProfile")] - public class LuminMotionControllerMappingProfile : BaseMixedRealityControllerMappingProfile - { - /// - public override SupportedControllerType ControllerType => SupportedControllerType.Lumin; - - /// - public override string TexturePath => $"{base.TexturePath}LuminController"; - - protected override void Awake() - { - if (!HasSetupDefaults) - { - ControllerMappings = new[] - { - new MixedRealityControllerMapping("Lumin Motion Controller Left", typeof(LuminController), Handedness.Left), - new MixedRealityControllerMapping("Lumin Motion Controller Right", typeof(LuminController), Handedness.Right), - }; - } - - base.Awake(); - } - } -} From 1f655263d3b541d98c8eaf2eec7493da652080aa Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 6 Apr 2020 22:49:39 -0400 Subject: [PATCH 02/52] added controller data provider reference to the controller --- .../com.xrtk.lumin/Controllers/LuminController.cs | 8 ++++++-- .../Controllers/LuminControllerDataProvider.cs | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index 27f96e2..d0fedb3 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -5,6 +5,7 @@ using XRTK.Definitions.InputSystem; using XRTK.Definitions.Utilities; using XRTK.Interfaces.InputSystem; +using XRTK.Interfaces.Providers.Controllers; using XRTK.Providers.Controllers; #if PLATFORM_LUMIN @@ -18,11 +19,13 @@ namespace XRTK.Lumin.Controllers { public class LuminController : BaseController { - public LuminController(TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) - : base(trackingState, controllerHandedness, inputSource, interactions) + /// + public LuminController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) + : base(controllerDataProvider, trackingState, controllerHandedness, inputSource, interactions) { } + /// public override MixedRealityInteractionMapping[] DefaultInteractions => new[] { new MixedRealityInteractionMapping(0, "Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), @@ -42,6 +45,7 @@ public LuminController(TrackingState trackingState, Handedness controllerHandedn /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => DefaultInteractions; + /// public override void SetupDefaultInteractions(Handedness controllerHandedness) { AssignControllerMappings(DefaultInteractions); diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs index 8113796..cbf2ced 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs @@ -142,7 +142,7 @@ private LuminController GetController(byte controllerId, bool addController = tr var pointers = mlController.Type == MLInputControllerType.Control ? RequestPointers(typeof(LuminController), controllingHand) : null; var inputSource = MixedRealityToolkit.InputSystem?.RequestNewGenericInputSource($"Lumin Controller {controllingHand}", pointers); - var detectedController = new LuminController(TrackingState.NotTracked, controllingHand, inputSource); + var detectedController = new LuminController(this, TrackingState.NotTracked, controllingHand, inputSource); if (!detectedController.SetupConfiguration(typeof(LuminController))) { From 8817174240521e51bdeb909c15ce0c243d0b588e Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 00:29:20 -0400 Subject: [PATCH 03/52] updated references --- .../Packages/com.xrtk.lumin/Controllers/LuminController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index 55e91c4..aa82557 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -1,18 +1,20 @@ // 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.InputSystem; using XRTK.Definitions.Utilities; using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; -using XRTK.Providers.Controllers; #if PLATFORM_LUMIN + using UnityEngine; using UnityEngine.XR.MagicLeap; using XRTK.Extensions; using XRTK.Services; + #endif namespace XRTK.Lumin.Controllers From 0e2b150efaee682537bbef05788f9bb52be9656a Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 00:38:18 -0400 Subject: [PATCH 04/52] updated profile reference --- .../com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs | 4 ++-- ...oviderProfile.cs => LuminControllerDataProviderProfile.cs} | 2 +- ...ile.cs.meta => LuminControllerDataProviderProfile.cs.meta} | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/{LuminMotionControllerDataProviderProfile.cs => LuminControllerDataProviderProfile.cs} (85%) rename XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/{LuminMotionControllerDataProviderProfile.cs.meta => LuminControllerDataProviderProfile.cs.meta} (100%) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs index cbf2ced..2ee065a 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs @@ -1,7 +1,7 @@ // 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.Lumin.Profiles; using XRTK.Providers.Controllers; #if PLATFORM_LUMIN @@ -25,7 +25,7 @@ public class LuminControllerDataProvider : BaseControllerDataProvider /// /// /// - public LuminControllerDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile) + public LuminControllerDataProvider(string name, uint priority, LuminControllerDataProviderProfile profile) : base(name, priority, profile) { } diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs similarity index 85% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs rename to XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs index 97f50d1..666b9d6 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs @@ -5,7 +5,7 @@ namespace XRTK.Lumin.Profiles { - public class LuminMotionControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile + public class LuminControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile { public override ControllerDefinition[] GetControllerDefinitions() { diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs.meta similarity index 100% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminMotionControllerDataProviderProfile.cs.meta rename to XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs.meta From bf15e215ca526916851e5b37af1d84a42954ca5e Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 13:42:17 -0400 Subject: [PATCH 05/52] updated references --- .../Profiles/LuminHandControllerDataProviderProfile.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs index 0e0009b..74ac21b 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.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; @@ -29,5 +30,10 @@ public class LuminHandControllerDataProviderProfile : BaseHandControllerDataProv /// Configured level of filtering for static poses. /// public int PoseFilterLevel => poseFilterLevel; + + public override ControllerDefinition[] GetControllerDefinitions() + { + throw new System.NotImplementedException(); + } } } \ No newline at end of file From 733e9bb9a2f6f33835229d53b2447c62dc65c3af Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 7 Apr 2020 15:14:11 -0400 Subject: [PATCH 06/52] Added default controller definitions --- .../Profiles/LuminControllerDataProviderProfile.cs | 12 ++++++++---- .../LuminHandControllerDataProviderProfile.cs | 6 ------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs index 666b9d6..9d4e110 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs @@ -2,16 +2,20 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using XRTK.Definitions.Controllers; +using XRTK.Definitions.Utilities; +using XRTK.Lumin.Controllers; namespace XRTK.Lumin.Profiles { public class LuminControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile { - public override ControllerDefinition[] GetControllerDefinitions() + public override ControllerDefinition[] GetDefaultControllerOptions() { - // new MixedRealityControllerMapping("Lumin Motion Controller Left", typeof(LuminController), Handedness.Left), - // new MixedRealityControllerMapping("Lumin Motion Controller Right", typeof(LuminController), Handedness.Right), - throw new System.NotImplementedException(); + return new[] + { + new ControllerDefinition(typeof(LuminController), Handedness.Left), + new ControllerDefinition(typeof(LuminController), Handedness.Right) + }; } } } \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs index 74ac21b..0e0009b 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.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; @@ -30,10 +29,5 @@ public class LuminHandControllerDataProviderProfile : BaseHandControllerDataProv /// Configured level of filtering for static poses. /// public int PoseFilterLevel => poseFilterLevel; - - public override ControllerDefinition[] GetControllerDefinitions() - { - throw new System.NotImplementedException(); - } } } \ No newline at end of file From 180461986eb61359aaeb6f14e5087378c8ebd30d Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Wed, 8 Apr 2020 22:59:59 -0400 Subject: [PATCH 07/52] removed redundant action assignments in mappings --- .../Controllers/LuminController.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index fdf9417..a1c0727 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -30,15 +30,15 @@ public LuminController(IMixedRealityControllerDataProvider controllerDataProvide /// public override MixedRealityInteractionMapping[] DefaultInteractions => new[] { - new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Trigger Position", AxisType.SingleAxis, DeviceInputType.Trigger, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Trigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Trigger Press (Select)", AxisType.Digital, DeviceInputType.Select, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Bumper Press", AxisType.Digital, DeviceInputType.ButtonPress, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Home Press", AxisType.Digital, DeviceInputType.ButtonPress, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Touchpad Position", AxisType.DualAxis, DeviceInputType.Touchpad, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Touchpad Press", AxisType.SingleAxis, DeviceInputType.TouchpadPress, MixedRealityInputAction.None), - new MixedRealityInteractionMapping("Touchpad Touch", AxisType.SingleAxis, DeviceInputType.TouchpadTouch, MixedRealityInputAction.None), + new MixedRealityInteractionMapping("Spatial Pointer", AxisType.SixDof, DeviceInputType.SpatialPointer), + new MixedRealityInteractionMapping("Trigger Position", AxisType.SingleAxis, DeviceInputType.Trigger), + new MixedRealityInteractionMapping("Trigger Touch", AxisType.Digital, DeviceInputType.TriggerTouch), + new MixedRealityInteractionMapping("Trigger Press (Select)", AxisType.Digital, DeviceInputType.Select), + new MixedRealityInteractionMapping("Bumper Press", AxisType.Digital, DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Home Press", AxisType.Digital, DeviceInputType.ButtonPress), + new MixedRealityInteractionMapping("Touchpad Position", AxisType.DualAxis, DeviceInputType.Touchpad), + new MixedRealityInteractionMapping("Touchpad Press", AxisType.SingleAxis, DeviceInputType.TouchpadPress), + new MixedRealityInteractionMapping("Touchpad Touch", AxisType.SingleAxis, DeviceInputType.TouchpadTouch), }; /// From f184f70a76b025c0272033c27a6b3f50a1fbf72c Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 03:02:34 -0400 Subject: [PATCH 08/52] updated references --- .../Packages/com.xrtk.lumin/Controllers/LuminController.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index a1c0727..b974940 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -1,12 +1,11 @@ // 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.InputSystem; using XRTK.Definitions.Utilities; using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; +using XRTK.Providers.Controllers; #if PLATFORM_LUMIN From f36d06db8b424139b8f6d4a4ad455536fa5d81cb Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 09:52:08 -0400 Subject: [PATCH 09/52] added axis processor check --- .../Packages/com.xrtk.lumin/Controllers/LuminController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index b974940..e1551d0 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -202,7 +202,8 @@ private void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMapp case DeviceInputType.Trigger: case DeviceInputType.TriggerPress: case DeviceInputType.TouchpadPress: - interactionMapping.BoolData = interactionMapping.FloatData.Equals(interactionMapping.InvertXAxis ? -1f : 1f); + var processor = interactionMapping.GetInputProcessors(); + interactionMapping.BoolData = interactionMapping.FloatData.Equals(processor.Invert ? -1f : 1f); break; case DeviceInputType.TriggerTouch: case DeviceInputType.TouchpadTouch: From 71021734662361a52a71c48252db27826b4a25a4 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 10:03:12 -0400 Subject: [PATCH 10/52] Fixed inspector --- .../LuminHandControllerDataProviderProfileInspector.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs index f6869a0..f68c70a 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs @@ -32,11 +32,8 @@ protected override void OnEnable() public override void OnInspectorGUI() { - RenderHeader(); - - EditorGUILayout.LabelField("Lumin Hand Controller Data Provider Settings", EditorStyles.boldLabel); - base.OnInspectorGUI(); + serializedObject.Update(); EditorGUILayout.Space(); From b960bb9f64a23d41f704b6c431eb9b71354a1934 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 13:07:02 -0400 Subject: [PATCH 11/52] updated controller instance creation --- .../Controllers/LuminController.cs | 6 ++--- .../LuminControllerDataProvider.cs | 23 ++++++++----------- .../LuminHandControllerDataProvider.cs | 19 ++++++--------- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index e1551d0..6d24ee1 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.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; using XRTK.Providers.Controllers; @@ -21,8 +21,8 @@ namespace XRTK.Lumin.Controllers public class LuminController : BaseController { /// - public LuminController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, IMixedRealityInputSource inputSource = null, MixedRealityInteractionMapping[] interactions = null) - : base(controllerDataProvider, trackingState, controllerHandedness, inputSource, interactions) + public LuminController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile) + : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile) { } diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs index 4bc9bda..b6f6536 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs @@ -6,6 +6,7 @@ #if PLATFORM_LUMIN +using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.MagicLeap; @@ -114,35 +115,31 @@ private LuminController GetController(byte controllerId, bool addController = tr if (mlController.Type == MLInputControllerType.None) { return null; } - var controllingHand = Handedness.Any; + var handedness = Handedness.Any; if (mlController.Type == MLInputControllerType.Control) { switch (mlController.Hand) { case MLInput.Hand.Left: - controllingHand = Handedness.Left; + handedness = Handedness.Left; break; case MLInput.Hand.Right: - controllingHand = Handedness.Right; + handedness = Handedness.Right; break; } } - var pointers = mlController.Type == MLInputControllerType.Control ? RequestPointers(typeof(LuminController), controllingHand) : null; - var inputSource = MixedRealityToolkit.InputSystem?.RequestNewGenericInputSource($"Lumin Controller {controllingHand}", pointers); - var detectedController = new LuminController(this, TrackingState.NotTracked, controllingHand, inputSource); + LuminController detectedController; - if (!detectedController.SetupConfiguration(typeof(LuminController))) + try { - // Controller failed to be setup correctly. - // Return null so we don't raise the source detected. - return null; + detectedController = new LuminController(this, TrackingState.NotTracked, handedness, GetControllerMappingProfile(typeof(LuminController), 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(LuminController)}!\n{e}"); + return null; } detectedController.MlControllerReference = mlController; diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs index d42591d..3c9dd71 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs @@ -116,24 +116,19 @@ 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); + MixedRealityHandController detectedController; - if (!detectedController.SetupConfiguration(controllerType)) + 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)); activeControllers.Add(handedness, detectedController); AddController(detectedController); From 82e5af41612537c1de600f8a3d950cd21c16cbe6 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Thu, 9 Apr 2020 18:34:01 -0400 Subject: [PATCH 12/52] added a default constructor --- .../Packages/com.xrtk.lumin/Controllers/LuminController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index 6d24ee1..159b32d 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -20,6 +20,8 @@ namespace XRTK.Lumin.Controllers { public class LuminController : BaseController { + public LuminController() : base() { } + /// public LuminController(IMixedRealityControllerDataProvider controllerDataProvider, TrackingState trackingState, Handedness controllerHandedness, MixedRealityControllerMappingProfile controllerMappingProfile) : base(controllerDataProvider, trackingState, controllerHandedness, controllerMappingProfile) From d82b617e4bb2062af194544eb8b8cd8f63379f24 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Fri, 10 Apr 2020 18:33:36 -0400 Subject: [PATCH 13/52] fixed TryRenderControllerModel call --- .../Controllers/LuminHandControllerDataProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs index 3c9dd71..fecb12b 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs @@ -128,7 +128,7 @@ private MixedRealityHandController GetOrAddController(Handedness handedness) return null; } - detectedController.TryRenderControllerModel(typeof(MixedRealityHandController)); + detectedController.TryRenderControllerModel(); activeControllers.Add(handedness, detectedController); AddController(detectedController); From d098d9f5be679e27af0b6690cfe889f03ad91386 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 00:38:52 -0400 Subject: [PATCH 14/52] removed unused reference --- .../com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs index 716de66..cb1cc9c 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs @@ -13,7 +13,7 @@ using UnityEngine.XR.MagicLeap; using XRTK.Definitions.SpatialAwarenessSystem; using XRTK.Services; -using XRTK.Utilities; + #endif // PLATFORM_LUMIN namespace XRTK.Lumin.SpatialObservers From dea329bc89d2e3007893d0415c0b039385205e09 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 02:20:10 -0400 Subject: [PATCH 15/52] removed asset menu --- .../Profiles/LuminHandControllerDataProviderProfile.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs index 0e0009b..77d524c 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs @@ -3,11 +3,9 @@ using UnityEngine; using XRTK.Definitions.Controllers.Hands; -using XRTK.Definitions.Utilities; namespace XRTK.Lumin.Profiles { - [CreateAssetMenu(menuName = "Mixed Reality Toolkit/Input System/Controller Data Providers/Lumin Hand", fileName = "LuminHandControllerDataProviderProfile", order = (int)CreateProfileMenuItemIndices.Input)] public class LuminHandControllerDataProviderProfile : BaseHandControllerDataProviderProfile { [Header("Lumin Platform Settings")] From 9dd28d076103f9864bb7b3187a0580c6b004ca6f Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 11 Apr 2020 14:31:19 +0200 Subject: [PATCH 16/52] Remove obsolete SetupDefaultInteractions (#59) --- .../Packages/com.xrtk.lumin/Controllers/LuminController.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index 159b32d..8a7aab9 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -48,12 +48,6 @@ public LuminController(IMixedRealityControllerDataProvider controllerDataProvide /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => DefaultInteractions; - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } - #if PLATFORM_LUMIN internal MLInputController MlControllerReference { get; set; } From 5e8e7579f8eb7e432db89f3d473f56783c875989 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 10:57:22 -0400 Subject: [PATCH 17/52] removed reference to input processor --- .../Packages/com.xrtk.lumin/Controllers/LuminController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs index 8a7aab9..a997149 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminController.cs @@ -198,8 +198,8 @@ private void UpdateSingleAxisData(MixedRealityInteractionMapping interactionMapp case DeviceInputType.Trigger: case DeviceInputType.TriggerPress: case DeviceInputType.TouchpadPress: - var processor = interactionMapping.GetInputProcessors(); - interactionMapping.BoolData = interactionMapping.FloatData.Equals(processor.Invert ? -1f : 1f); + interactionMapping.BoolData = interactionMapping.FloatData.Approximately(1f, 0.001f) || + interactionMapping.FloatData.Approximately(-1f, 0.001f); break; case DeviceInputType.TriggerTouch: case DeviceInputType.TouchpadTouch: From 982009e07ef970a1c4b3f6a94722d50c90954df0 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 15:09:22 -0400 Subject: [PATCH 18/52] updated reference to camera rig --- .../SpatialObservers/LuminSpatialMeshObserver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs index 716de66..434441a 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs @@ -104,8 +104,8 @@ public override void Update() // Update the observer location if it is not stationary if (!IsStationaryObserver) { - ObserverOrigin = MixedRealityToolkit.CameraSystem.CameraRig.CameraTransform.position; - ObserverOrientation = MixedRealityToolkit.CameraSystem.CameraRig.CameraTransform.rotation; + ObserverOrigin = MixedRealityToolkit.CameraSystem.MainCameraRig.CameraTransform.position; + ObserverOrientation = MixedRealityToolkit.CameraSystem.MainCameraRig.CameraTransform.rotation; } ConfigureObserverVolume(); From 108a804024dd92fd0545db5ded5e7d9e46e9ac4f Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 17:44:16 -0400 Subject: [PATCH 19/52] updated platform flag to only be true on device If we want any modules to run in the editor then we need to flip that flag --- XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs index 2767798..f25b690 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs @@ -14,7 +14,7 @@ public override bool IsAvailable get { #if PLATFORM_LUMIN - return true; + return !UnityEngine.Application.isEditor; #else return false; #endif From 6ee1a551a649f73363ef2ab393abd62ea6c16e42 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 11 Apr 2020 20:28:23 -0400 Subject: [PATCH 20/52] updated hand inspector --- ...HandControllerDataProviderProfileInspector.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs index f68c70a..b2c62ed 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs @@ -1,13 +1,15 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -#if PLATFORM_LUMIN using UnityEditor; using UnityEngine; using XRTK.Inspectors.Profiles.InputSystem.Controllers; using XRTK.Lumin.Profiles; + +#if PLATFORM_LUMIN using UnityEngine.XR.MagicLeap; +#endif // PLATFORM_LUMIN namespace XRTK.Lumin.Inspectors { @@ -36,14 +38,16 @@ public override void OnInspectorGUI() serializedObject.Update(); - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Lumin Hand Settings"); - + EditorGUILayout.LabelField("Oculus Hand Settings", EditorStyles.boldLabel); +#if PLATFORM_LUMIN keyPointFilterLevel.intValue = (int)(MLKeyPointFilterLevel)EditorGUILayout.EnumPopup(keyPointContent, (MLKeyPointFilterLevel)keyPointFilterLevel.intValue); poseFilterLevel.intValue = (int)(MLPoseFilterLevel)EditorGUILayout.EnumPopup(poseFilterContent, (MLPoseFilterLevel)poseFilterLevel.intValue); +#else + EditorGUILayout.PropertyField(keyPointFilterLevel); + EditorGUILayout.PropertyField(poseFilterLevel); +#endif // PLATFORM_LUMIN serializedObject.ApplyModifiedProperties(); } } -} -#endif // PLATFORM_LUMIN +} \ No newline at end of file From 7ae8d559434dc71623878dded38f81a2ae3572b1 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sun, 12 Apr 2020 20:30:03 -0400 Subject: [PATCH 21/52] Added Lumin camera data provider --- .../Packages/com.xrtk.lumin/Runtime.meta | 8 ++++++++ .../com.xrtk.lumin/Runtime/Providers.meta | 8 ++++++++ .../Runtime/Providers/CameraSystem.meta | 8 ++++++++ .../CameraSystem/LuminCameraDataProvider.cs | 20 +++++++++++++++++++ .../LuminCameraDataProvider.cs.meta | 11 ++++++++++ 5 files changed, 55 insertions(+) create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Runtime.meta create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers.meta create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem.meta create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime.meta new file mode 100644 index 0000000..f2b3569 --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 14955915aae10304e839fe0988609b1b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers.meta new file mode 100644 index 0000000..9942b7e --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50ab3baaaeccf3f42ba9b78b24a99990 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem.meta new file mode 100644 index 0000000..122787c --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 21bda8c13b0ad9c43b837a6587dca84f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs new file mode 100644 index 0000000..5a09e7e --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs @@ -0,0 +1,20 @@ +// 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.Providers.CameraSystem; + +namespace XRTK.Lumin.Providers.CameraSystem +{ + public class LuminCameraDataProvider : BaseCameraDataProvider + { + /// + public LuminCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile) + : base(name, priority, profile) + { + } + + /// + public override bool IsOpaque => false; + } +} \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs.meta new file mode 100644 index 0000000..32366af --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c580b5fb064386f46b31875245d73922 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 69a2e929e9149d494ddf1e00d6e762b1aaccb620 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sun, 12 Apr 2020 20:30:41 -0400 Subject: [PATCH 22/52] updated lumin platform definition --- .../Packages/com.xrtk.lumin/LuminPlatform.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs index f25b690..4b5cd68 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs @@ -9,7 +9,7 @@ namespace XRTK.Definitions.Platforms public class LuminPlatform : BasePlatform { /// - public override bool IsAvailable + public override bool IsActive { get { @@ -17,6 +17,19 @@ public override bool IsAvailable return !UnityEngine.Application.isEditor; #else return false; +#endif + } + } + + /// + public override bool IsBuildTargetAvailable + { + get + { +#if UNITY_EDITOR + return UnityEditor.EditorUserBuildSettings.activeBuildTarget == UnityEditor.BuildTarget.Lumin; +#else + return false; #endif } } From c5efa56b18b0611e893a4eab8b3ed2c25ceec88f Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 13 Apr 2020 12:13:43 -0400 Subject: [PATCH 23/52] updated icon --- .../Providers/CameraSystem/LuminCameraDataProvider.cs.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs.meta index 32366af..09b24d1 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.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 9673700145bf095a698e3e8212558cef5cca73ff Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 13 Apr 2020 12:51:49 -0400 Subject: [PATCH 24/52] Added default lumin camera data provider profile --- .../com.xrtk.lumin/DefaultProfiles.meta | 8 ++++++ .../DefaultProfiles/CameraSystem.meta | 8 ++++++ .../DefaultLuminCameraDataProvider.asset | 28 +++++++++++++++++++ .../DefaultLuminCameraDataProvider.asset.meta | 8 ++++++ 4 files changed, 52 insertions(+) create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles.meta create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem.meta create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles.meta new file mode 100644 index 0000000..20d8ab5 --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50ddbddf7ed68784b98b64c93f6082a3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem.meta new file mode 100644 index 0000000..444db54 --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5bf4c3ae15a7a84f9f90f760e649a0f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset new file mode 100644 index 0000000..53dcb86 --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset @@ -0,0 +1,28 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 00d813fd5a164e19a160f322b2926006, type: 3} + m_Name: DefaultLuminCameraDataProvider + m_EditorClassIdentifier: + isCameraPersistent: 1 + nearClipPlaneOpaqueDisplay: 0.1 + cameraClearFlagsOpaqueDisplay: 1 + backgroundColorOpaqueDisplay: {r: 0, g: 0, b: 0, a: 1} + opaqueQualityLevel: 0 + nearClipPlaneTransparentDisplay: 0.85 + cameraClearFlagsTransparentDisplay: 2 + backgroundColorTransparentDisplay: {r: 0, g: 0, b: 0, a: 0} + transparentQualityLevel: 0 + cameraRigType: + reference: XRTK.Services.CameraSystem.DefaultCameraRig, XRTK + defaultHeadHeight: 0 + bodyAdjustmentAngle: 60 + bodyAdjustmentSpeed: 1 diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset.meta new file mode 100644 index 0000000..68b16ab --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 10c5453922d4a744595e0415ef57dda4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From d0e7b2610b7ec8c1b601574f3c758805a228d981 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Mon, 13 Apr 2020 18:35:36 -0400 Subject: [PATCH 25/52] reverted name change --- XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs index 4b5cd68..6115942 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/LuminPlatform.cs @@ -9,7 +9,7 @@ namespace XRTK.Definitions.Platforms public class LuminPlatform : BasePlatform { /// - public override bool IsActive + public override bool IsAvailable { get { From 3298634cce3c506e3a5a8dd22027b0f68ca72bb5 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 14 Apr 2020 00:08:09 -0400 Subject: [PATCH 26/52] Updated constructors for data providers --- .../Controllers/LuminControllerDataProvider.cs | 12 ++++-------- .../Controllers/LuminHandControllerDataProvider.cs | 12 ++++-------- .../SpatialObservers/LuminSpatialMeshObserver.cs | 11 ++++------- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs index de3571a..5ac22ac 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using XRTK.Definitions.Controllers; +using XRTK.Interfaces.InputSystem; using XRTK.Providers.Controllers; #if PLATFORM_LUMIN @@ -19,14 +20,9 @@ namespace XRTK.Lumin.Controllers { public class LuminControllerDataProvider : BaseControllerDataProvider { - /// - /// Constructor. - /// - /// - /// - /// - public LuminControllerDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile) - : base(name, priority, profile) + /// + public LuminControllerDataProvider(string name, uint priority, BaseMixedRealityControllerDataProviderProfile profile, IMixedRealityInputSystem parentService) + : base(name, priority, profile, parentService) { } diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs index d42591d..75eaed4 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.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 XRTK.Interfaces.InputSystem; using XRTK.Lumin.Profiles; using XRTK.Providers.Controllers.Hands; @@ -22,14 +23,9 @@ namespace XRTK.Lumin.Controllers { public class LuminHandControllerDataProvider : BaseHandControllerDataProvider { - /// - /// Creates a new instance of the data provider. - /// - /// Name of the data provider as assigned in the configuration profile. - /// Data provider priority controls the order in the service registry. - /// Hand controller data provider profile assigned to the provider instance in the configuration inspector. - public LuminHandControllerDataProvider(string name, uint priority, LuminHandControllerDataProviderProfile profile) - : base(name, priority, profile) + /// + public LuminHandControllerDataProvider(string name, uint priority, LuminHandControllerDataProviderProfile profile, IMixedRealityInputSystem parentService) + : base(name, priority, profile, parentService) { #if PLATFORM_LUMIN keyPointFilterLevel = (MLKeyPointFilterLevel)profile.KeyPointFilterLevel; diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs index 716de66..18a78ca 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/SpatialObservers/LuminSpatialMeshObserver.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 XRTK.Interfaces.SpatialAwarenessSystem; using XRTK.Lumin.Profiles; using XRTK.Providers.SpatialObservers; @@ -23,13 +24,9 @@ namespace XRTK.Lumin.SpatialObservers /// public class LuminSpatialMeshObserver : BaseMixedRealitySpatialMeshObserver { - /// - /// Constructor. - /// - /// - /// - /// - public LuminSpatialMeshObserver(string name, uint priority, LuminSpatialMeshObserverProfile profile) : base(name, priority, profile) + /// + public LuminSpatialMeshObserver(string name, uint priority, LuminSpatialMeshObserverProfile profile, IMixedRealitySpatialAwarenessSystem parentService) + : base(name, priority, profile, parentService) { } From 91f4ae02cf1f0763629b1cfa00e0e7b98eb417cb Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 14 Apr 2020 10:51:54 -0400 Subject: [PATCH 27/52] Added service parent reference --- .../Providers/CameraSystem/LuminCameraDataProvider.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs index 5a09e7e..5675bac 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs @@ -2,6 +2,7 @@ // 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.Lumin.Providers.CameraSystem @@ -9,8 +10,8 @@ namespace XRTK.Lumin.Providers.CameraSystem public class LuminCameraDataProvider : BaseCameraDataProvider { /// - public LuminCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile) - : base(name, priority, profile) + public LuminCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile, IMixedRealityCameraSystem parentService) + : base(name, priority, profile, parentService) { } From 1b2b33dceec7068f966f44cbb9fcbd72fff1ebfc Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 14 Apr 2020 11:03:39 -0400 Subject: [PATCH 28/52] cleaned up referenece --- .../com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs index 84c27b4..e5829c1 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminControllerDataProvider.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE in the project root for license information. using XRTK.Lumin.Profiles; -using XRTK.Definitions.Controllers; using XRTK.Interfaces.InputSystem; using XRTK.Providers.Controllers; From 667a65d306925f7517ec0ece169d6889856b284b Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Tue, 14 Apr 2020 15:29:17 -0400 Subject: [PATCH 29/52] updated nearclip distance --- .../CameraSystem/DefaultLuminCameraDataProvider.asset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset index 53dcb86..6d1f09e 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset @@ -17,7 +17,7 @@ MonoBehaviour: cameraClearFlagsOpaqueDisplay: 1 backgroundColorOpaqueDisplay: {r: 0, g: 0, b: 0, a: 1} opaqueQualityLevel: 0 - nearClipPlaneTransparentDisplay: 0.85 + nearClipPlaneTransparentDisplay: 0.1 cameraClearFlagsTransparentDisplay: 2 backgroundColorTransparentDisplay: {r: 0, g: 0, b: 0, a: 0} transparentQualityLevel: 0 From da9ed106754a1bb8908e32f0d788cc232f19ccce Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Wed, 15 Apr 2020 14:38:00 +0200 Subject: [PATCH 30/52] Change requests for controller provider inspectors (#63) * Update indent levels for Lumin settings * Cache GUIContent in OnEnable * Remove blank line * Use static readonly --- ...dControllerDataProviderProfileInspector.cs | 26 ++++++++++++++----- .../LuminHandControllerDataProviderProfile.cs | 2 -- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs index b2c62ed..f90685b 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Inspectors/LuminHandControllerDataProviderProfileInspector.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 UnityEditor; using UnityEngine; +using XRTK.Inspectors.Extensions; using XRTK.Inspectors.Profiles.InputSystem.Controllers; using XRTK.Lumin.Profiles; @@ -19,17 +19,26 @@ public class LuminHandControllerDataProviderProfileInspector : BaseMixedRealityH private SerializedProperty poseFilterLevel; private SerializedProperty keyPointFilterLevel; + private static readonly GUIContent handTrackingFoldoutHeader = new GUIContent("Lumin Hand Tracking Settings"); + +#if PLATFORM_LUMIN private GUIContent keyPointContent; private GUIContent poseFilterContent; +#endif // PLATFORM_LUMIN + + private bool showLuminHandTrackingSettings = true; protected override void OnEnable() { base.OnEnable(); keyPointFilterLevel = serializedObject.FindProperty(nameof(keyPointFilterLevel)); - keyPointContent = new GUIContent(keyPointFilterLevel.displayName, keyPointFilterLevel.tooltip); poseFilterLevel = serializedObject.FindProperty(nameof(poseFilterLevel)); + +#if PLATFORM_LUMIN + keyPointContent = new GUIContent(keyPointFilterLevel.displayName, keyPointFilterLevel.tooltip); poseFilterContent = new GUIContent(poseFilterLevel.displayName, poseFilterLevel.tooltip); +#endif // PLATFORM_LUMIN } public override void OnInspectorGUI() @@ -38,14 +47,19 @@ public override void OnInspectorGUI() serializedObject.Update(); - EditorGUILayout.LabelField("Oculus Hand Settings", EditorStyles.boldLabel); + showLuminHandTrackingSettings = EditorGUILayoutExtensions.FoldoutWithBoldLabel(showLuminHandTrackingSettings, handTrackingFoldoutHeader, true); + if (showLuminHandTrackingSettings) + { + EditorGUI.indentLevel++; #if PLATFORM_LUMIN keyPointFilterLevel.intValue = (int)(MLKeyPointFilterLevel)EditorGUILayout.EnumPopup(keyPointContent, (MLKeyPointFilterLevel)keyPointFilterLevel.intValue); poseFilterLevel.intValue = (int)(MLPoseFilterLevel)EditorGUILayout.EnumPopup(poseFilterContent, (MLPoseFilterLevel)poseFilterLevel.intValue); #else - EditorGUILayout.PropertyField(keyPointFilterLevel); - EditorGUILayout.PropertyField(poseFilterLevel); -#endif // PLATFORM_LUMIN + EditorGUILayout.PropertyField(keyPointFilterLevel); + EditorGUILayout.PropertyField(poseFilterLevel); +#endif // PLATFORM_LUMIN + EditorGUI.indentLevel--; + } serializedObject.ApplyModifiedProperties(); } diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs index 77d524c..aaa0b1f 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminHandControllerDataProviderProfile.cs @@ -8,8 +8,6 @@ namespace XRTK.Lumin.Profiles { public class LuminHandControllerDataProviderProfile : BaseHandControllerDataProviderProfile { - [Header("Lumin Platform Settings")] - [SerializeField] [Tooltip("Configured level for keypoints filtering of keypoints and hand centers.")] private int keyPointFilterLevel = 0; From 431c5990cb9c6b21dcd8daf5bb56de0b288a743b Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Thu, 16 Apr 2020 15:25:54 +0200 Subject: [PATCH 31/52] Adjust to latest changes in Core --- .../LuminHandControllerDataProvider.cs | 9 +++--- .../LuminHandDataConverter.cs | 31 +++++++++++-------- .../LuminHandDataConverter.cs.meta | 0 .../Packages/com.xrtk.lumin/Utilities.meta | 8 ----- 4 files changed, 23 insertions(+), 25 deletions(-) rename XRTK.Lumin/Packages/com.xrtk.lumin/{Utilities => Controllers}/LuminHandDataConverter.cs (93%) rename XRTK.Lumin/Packages/com.xrtk.lumin/{Utilities => Controllers}/LuminHandDataConverter.cs.meta (100%) delete mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Utilities.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs index 401b44e..5d8b728 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandControllerDataProvider.cs @@ -11,10 +11,8 @@ using System; using System.Collections.Generic; using UnityEngine; -using UnityEngine.XR.MagicLeap; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; -using XRTK.Lumin.Utilities; using XRTK.Services; #endif // PLATFORM_LUMIN @@ -30,12 +28,15 @@ public LuminHandControllerDataProvider(string name, uint priority, LuminHandCont #if PLATFORM_LUMIN keyPointFilterLevel = (MLKeyPointFilterLevel)profile.KeyPointFilterLevel; poseFilterLevel = (MLPoseFilterLevel)profile.PoseFilterLevel; + + leftHandConverter = new LuminHandDataConverter(Handedness.Left, TrackedPoses); + rightHandConverter = new LuminHandDataConverter(Handedness.Right, TrackedPoses); } private readonly MLPoseFilterLevel poseFilterLevel; private readonly MLKeyPointFilterLevel keyPointFilterLevel; - private readonly LuminHandDataConverter leftHandConverter = new LuminHandDataConverter(Handedness.Left); - private readonly LuminHandDataConverter rightHandConverter = new LuminHandDataConverter(Handedness.Right); + private readonly LuminHandDataConverter leftHandConverter; + private readonly LuminHandDataConverter rightHandConverter; private readonly MLHandKeyPose[] keyPoses = Enum.GetValues(typeof(MLHandKeyPose)).Cast().ToArray(); private readonly Dictionary activeControllers = new Dictionary(); diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Utilities/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs similarity index 93% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Utilities/LuminHandDataConverter.cs rename to XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs index 5147300..b119442 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Utilities/LuminHandDataConverter.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs @@ -1,31 +1,34 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System.Collections.Generic; +using XRTK.Definitions.Controllers.Hands; +using XRTK.Definitions.Utilities; +using XRTK.Providers.Controllers.Hands; + #if PLATFORM_LUMIN using System; using UnityEngine; -using UnityEngine.XR.MagicLeap; -using XRTK.Definitions.Controllers.Hands; -using XRTK.Definitions.Utilities; -namespace XRTK.Lumin.Utilities +#endif // PLATFORM_LUMIN + +namespace XRTK.Lumin.Controllers { /// /// Converts oculus hand data to . /// - public sealed class LuminHandDataConverter + public sealed class LuminHandDataConverter : BaseHandDataConverter { /// /// Constructor. /// /// Handedness of the hand this converter is created for. - public LuminHandDataConverter(Handedness handedness) - { - this.handedness = handedness; - } + /// The tracked poses collection to use for pose recognition. + public LuminHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) + { } - private readonly Handedness handedness; +#if PLATFORM_LUMIN /// /// Gets or sets whether hand mesh data should be read and converted. @@ -38,7 +41,7 @@ public LuminHandDataConverter(Handedness handedness) /// Platform agnostics hand data. public HandData GetHandData() { - var hand = ToMagicLeapHand(handedness); + var hand = ToMagicLeapHand(Handedness); var updatedHandData = new HandData { IsTracked = hand.IsVisible, @@ -51,6 +54,7 @@ public HandData GetHandData() UpdateHandMesh(hand, updatedHandData.Mesh); } + PostProcess(updatedHandData); return updatedHandData; } @@ -215,6 +219,7 @@ private static MixedRealityPose ComputeJointPose(MLKeyPoint keyPoint) return pose; } + +#endif // PLATFORM_LUMIN } -} -#endif // PLATFORM_LUMIN \ No newline at end of file +} \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Utilities/LuminHandDataConverter.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs.meta similarity index 100% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Utilities/LuminHandDataConverter.cs.meta rename to XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Utilities.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Utilities.meta deleted file mode 100644 index d4a8e82..0000000 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Utilities.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 14fb9301f77d904429c2851db462d235 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: From 4a504c6525ae80a023a0c9d43c9ee2e3df8a2996 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 18 Apr 2020 23:15:47 -0400 Subject: [PATCH 32/52] updated lumin camera settings --- .../CameraSystem/DefaultLuminCameraDataProvider.asset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset index 6d1f09e..fe66a0f 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/DefaultProfiles/CameraSystem/DefaultLuminCameraDataProvider.asset @@ -23,6 +23,6 @@ MonoBehaviour: transparentQualityLevel: 0 cameraRigType: reference: XRTK.Services.CameraSystem.DefaultCameraRig, XRTK - defaultHeadHeight: 0 + defaultHeadHeight: 1.6 bodyAdjustmentAngle: 60 bodyAdjustmentSpeed: 1 From cef1965a11c6a338f228cda1a34fd49b4bf2b571 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sat, 18 Apr 2020 23:58:44 -0400 Subject: [PATCH 33/52] updated lumin camera data provider --- .../CameraSystem/LuminCameraDataProvider.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs index 5675bac..7279d0a 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.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 UnityEngine; using XRTK.Definitions.CameraSystem; using XRTK.Interfaces.CameraSystem; using XRTK.Providers.CameraSystem; @@ -9,6 +10,7 @@ namespace XRTK.Lumin.Providers.CameraSystem { public class LuminCameraDataProvider : BaseCameraDataProvider { + /// public LuminCameraDataProvider(string name, uint priority, BaseMixedRealityCameraDataProviderProfile profile, IMixedRealityCameraSystem parentService) : base(name, priority, profile, parentService) @@ -17,5 +19,33 @@ public LuminCameraDataProvider(string name, uint priority, BaseMixedRealityCamer /// public override bool IsOpaque => false; + + private float headHeight; + + /// + public override float HeadHeight + { + get => headHeight; + set + { + if (value.Equals(headHeight)) + { + return; + } + + headHeight = value; + } + } + + /// + protected override void ResetRigTransforms() + { + CameraRig.CameraTransform.position = Vector3.zero; + CameraRig.CameraTransform.rotation = Quaternion.identity; + CameraRig.BodyTransform.position = Vector3.zero; + CameraRig.BodyTransform.rotation = Quaternion.identity; + CameraRig.PlayspaceTransform.position = new Vector3(0f, HeadHeight, 0f); + CameraRig.PlayspaceTransform.rotation = Quaternion.identity; + } } } \ No newline at end of file From bcfcbf39ec033e4b9720865466fcdd6cb0889a53 Mon Sep 17 00:00:00 2001 From: Stephen Hodgson Date: Sun, 19 Apr 2020 00:44:36 -0400 Subject: [PATCH 34/52] only reset local positions --- .../Providers/CameraSystem/LuminCameraDataProvider.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs index 7279d0a..5fd2d47 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/CameraSystem/LuminCameraDataProvider.cs @@ -40,12 +40,12 @@ public override float HeadHeight /// protected override void ResetRigTransforms() { - CameraRig.CameraTransform.position = Vector3.zero; - CameraRig.CameraTransform.rotation = Quaternion.identity; - CameraRig.BodyTransform.position = Vector3.zero; - CameraRig.BodyTransform.rotation = Quaternion.identity; CameraRig.PlayspaceTransform.position = new Vector3(0f, HeadHeight, 0f); CameraRig.PlayspaceTransform.rotation = Quaternion.identity; + CameraRig.CameraTransform.localPosition = Vector3.zero; + CameraRig.CameraTransform.localRotation = Quaternion.identity; + CameraRig.BodyTransform.localPosition = Vector3.zero; + CameraRig.BodyTransform.localRotation = Quaternion.identity; } } } \ No newline at end of file From 6a0859a787f1e5357aeebf7f31405d4278cdb201 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 12:52:30 +0200 Subject: [PATCH 35/52] Resolve conflicts --- .../Controllers/LuminHandDataConverter.cs | 225 ------------------ .../LuminHandDataConverter.cs.meta | 11 - .../LuminControllerDataProviderProfile.cs | 21 -- .../com.xrtk.lumin/Runtime/Profiles.meta | 2 +- ...LuminControllerDataProviderProfile.cs.meta | 2 +- .../Runtime/Providers/Controllers.meta | 2 +- .../Utilities/LuminHandDataConverter.cs | 31 ++- 7 files changed, 21 insertions(+), 273 deletions(-) delete mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs delete mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs.meta delete mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs deleted file mode 100644 index b119442..0000000 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) XRTK. All rights reserved. -// Licensed under the MIT License. See LICENSE in the project root for license information. - -using System.Collections.Generic; -using XRTK.Definitions.Controllers.Hands; -using XRTK.Definitions.Utilities; -using XRTK.Providers.Controllers.Hands; - -#if PLATFORM_LUMIN - -using System; -using UnityEngine; - -#endif // PLATFORM_LUMIN - -namespace XRTK.Lumin.Controllers -{ - /// - /// Converts oculus hand data to . - /// - public sealed class LuminHandDataConverter : BaseHandDataConverter - { - /// - /// Constructor. - /// - /// Handedness of the hand this converter is created for. - /// The tracked poses collection to use for pose recognition. - public LuminHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) - { } - -#if PLATFORM_LUMIN - - /// - /// Gets or sets whether hand mesh data should be read and converted. - /// - public static bool HandMeshingEnabled { get; set; } - - /// - /// Gets updated hand data for the current frame. - /// - /// Platform agnostics hand data. - public HandData GetHandData() - { - var hand = ToMagicLeapHand(Handedness); - var updatedHandData = new HandData - { - IsTracked = hand.IsVisible, - TimeStamp = DateTimeOffset.UtcNow.Ticks - }; - - if (updatedHandData.IsTracked) - { - UpdateHandJoints(hand, updatedHandData.Joints); - UpdateHandMesh(hand, updatedHandData.Mesh); - } - - PostProcess(updatedHandData); - return updatedHandData; - } - - /// - /// Gets the magic leap hand reference for the given handedness. - /// - /// Handedness to convert. - /// Magic Leap hand reference. - private static MLHand ToMagicLeapHand(Handedness handedness) - { - switch (handedness) - { - case Handedness.Left: - return MLHands.Left; - case Handedness.Right: - return MLHands.Right; - default: - return null; - } - } - - private static void UpdateHandJoints(MLHand hand, MixedRealityPose[] jointPoses) - { - var ring = hand.Ring; - var pinky = hand.Pinky; - var index = hand.Index; - var thumb = hand.Thumb; - var wrist = hand.Wrist; - var middle = hand.Middle; - - for (int i = 0; i < jointPoses.Length; i++) - { - var trackedHandJoint = (TrackedHandJoint)i; - - switch (trackedHandJoint) - { - // Wrist and Palm - case TrackedHandJoint.Wrist: - jointPoses[i] = ComputeJointPose(wrist.Center); - break; - case TrackedHandJoint.Palm: - jointPoses[i] = EstimatePalmPose(wrist.Center, middle.MCP); - break; - // Finger: Thumb - case TrackedHandJoint.ThumbMetacarpalJoint: - jointPoses[i] = ComputeJointPose(thumb.MCP); - break; - case TrackedHandJoint.ThumbProximalJoint: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.ThumbDistalJoint: - jointPoses[i] = ComputeJointPose(thumb.IP); - break; - case TrackedHandJoint.ThumbTip: - jointPoses[i] = ComputeJointPose(thumb.Tip); - break; - // Finger: Index - case TrackedHandJoint.IndexMetacarpal: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.IndexKnuckle: - jointPoses[i] = ComputeJointPose(index.MCP); - break; - case TrackedHandJoint.IndexMiddleJoint: - jointPoses[i] = ComputeJointPose(index.PIP); - break; - case TrackedHandJoint.IndexDistalJoint: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.IndexTip: - jointPoses[i] = ComputeJointPose(index.Tip); - break; - // Finger: Middle - case TrackedHandJoint.MiddleMetacarpal: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.MiddleKnuckle: - jointPoses[i] = ComputeJointPose(middle.MCP); - break; - case TrackedHandJoint.MiddleMiddleJoint: - jointPoses[i] = ComputeJointPose(middle.PIP); - break; - case TrackedHandJoint.MiddleDistalJoint: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.MiddleTip: - jointPoses[i] = ComputeJointPose(middle.Tip); - break; - // Finger: Ring - case TrackedHandJoint.RingMetacarpal: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.RingKnuckle: - jointPoses[i] = ComputeJointPose(ring.MCP); - break; - case TrackedHandJoint.RingMiddleJoint: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.RingDistalJoint: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.RingTip: - jointPoses[i] = ComputeJointPose(ring.Tip); - break; - // Finger: Pinky - case TrackedHandJoint.PinkyMetacarpal: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.PinkyKnuckle: - jointPoses[i] = ComputeJointPose(pinky.MCP); - break; - case TrackedHandJoint.PinkyMiddleJoint: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.PinkyDistalJoint: - // TODO: Estimate? - jointPoses[i] = MixedRealityPose.ZeroIdentity; - break; - case TrackedHandJoint.PinkyTip: - jointPoses[i] = ComputeJointPose(pinky.Tip); - break; - } - } - } - - private void UpdateHandMesh(MLHand hand, HandMeshData handMeshData) - { - // TODO: Get hand mesh data and convert. - } - - private static MixedRealityPose EstimatePalmPose(MLKeyPoint wrist, MLKeyPoint middleDistal) - { - var wristRootPose = ComputeJointPose(wrist); - var middleDistalPose = ComputeJointPose(middleDistal); - var palmPosition = Vector3.Lerp(wristRootPose.Position, middleDistalPose.Position, .5f); - var palmRotation = wristRootPose.Rotation; - - return new MixedRealityPose(palmPosition, palmRotation); - } - - private static MixedRealityPose ComputeJointPose(MLKeyPoint keyPoint) - { - var pose = MixedRealityPose.ZeroIdentity; - - if (keyPoint.IsValid) - { - pose.Position = keyPoint.Position; - - // Joint rotation tracking is not supported on Lumin, - // so we gotta live with Quaternion.identity here. - } - - return pose; - } - -#endif // PLATFORM_LUMIN - } -} \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs.meta deleted file mode 100644 index 7280c1d..0000000 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Controllers/LuminHandDataConverter.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: dd099a0a3d609ed4db07d0408d75f51d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} - userData: - assetBundleName: - assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs deleted file mode 100644 index 9d4e110..0000000 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles/LuminControllerDataProviderProfile.cs +++ /dev/null @@ -1,21 +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.Lumin.Controllers; - -namespace XRTK.Lumin.Profiles -{ - public class LuminControllerDataProviderProfile : BaseMixedRealityControllerDataProviderProfile - { - public override ControllerDefinition[] GetDefaultControllerOptions() - { - return new[] - { - new ControllerDefinition(typeof(LuminController), Handedness.Left), - new ControllerDefinition(typeof(LuminController), Handedness.Right) - }; - } - } -} \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta index 0dbfb79..b3e2c4f 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3f3200395f93cdc4c8e4b2df042c8430 +guid: 02da3807e14483f4e9f23942da74330a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta index 191044b..22bd3b2 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8edcd6f437a8f024190e49cc25f4734e +guid: 121e4851a321a224f8bdab107a934c48 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta index e4ab775..8c41dca 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d76559f92c920b84bbb6d26422bf44ae +guid: 64a742e2a2e11ac49a627cb6f6c42e03 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs index 5147300..b119442 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs @@ -1,31 +1,34 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. +using System.Collections.Generic; +using XRTK.Definitions.Controllers.Hands; +using XRTK.Definitions.Utilities; +using XRTK.Providers.Controllers.Hands; + #if PLATFORM_LUMIN using System; using UnityEngine; -using UnityEngine.XR.MagicLeap; -using XRTK.Definitions.Controllers.Hands; -using XRTK.Definitions.Utilities; -namespace XRTK.Lumin.Utilities +#endif // PLATFORM_LUMIN + +namespace XRTK.Lumin.Controllers { /// /// Converts oculus hand data to . /// - public sealed class LuminHandDataConverter + public sealed class LuminHandDataConverter : BaseHandDataConverter { /// /// Constructor. /// /// Handedness of the hand this converter is created for. - public LuminHandDataConverter(Handedness handedness) - { - this.handedness = handedness; - } + /// The tracked poses collection to use for pose recognition. + public LuminHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) + { } - private readonly Handedness handedness; +#if PLATFORM_LUMIN /// /// Gets or sets whether hand mesh data should be read and converted. @@ -38,7 +41,7 @@ public LuminHandDataConverter(Handedness handedness) /// Platform agnostics hand data. public HandData GetHandData() { - var hand = ToMagicLeapHand(handedness); + var hand = ToMagicLeapHand(Handedness); var updatedHandData = new HandData { IsTracked = hand.IsVisible, @@ -51,6 +54,7 @@ public HandData GetHandData() UpdateHandMesh(hand, updatedHandData.Mesh); } + PostProcess(updatedHandData); return updatedHandData; } @@ -215,6 +219,7 @@ private static MixedRealityPose ComputeJointPose(MLKeyPoint keyPoint) return pose; } + +#endif // PLATFORM_LUMIN } -} -#endif // PLATFORM_LUMIN \ No newline at end of file +} \ No newline at end of file From c9944a5fc7d720fd8a11e7bd139e47f2b5ccd3d2 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 12:57:00 +0200 Subject: [PATCH 36/52] Undo meta changes --- .../Editor/LuminHandControllerDataProviderProfileInspector.cs | 4 ++-- XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta | 2 +- .../com.xrtk.lumin/Runtime/Providers/Controllers.meta | 2 +- .../Providers/Controllers/LuminControllerDataProvider.cs.meta | 2 +- .../Runtime/Utilities/LuminHandDataConverter.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.cs index f90685b..16f437e 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.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.Lumin.Profiles; #if PLATFORM_LUMIN diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta index b3e2c4f..fa3a84b 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta @@ -5,4 +5,4 @@ DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta index 8c41dca..71ce57f 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta @@ -5,4 +5,4 @@ DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta index 2c81f30..cb6deb4 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} + icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} userData: assetBundleName: assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs index b119442..a149a4d 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs @@ -13,7 +13,7 @@ #endif // PLATFORM_LUMIN -namespace XRTK.Lumin.Controllers +namespace XRTK.Lumin.Utilities { /// /// Converts oculus hand data to . From dff222c562646797980d5e4b09da876f0ecbcb2c Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 14:04:17 +0200 Subject: [PATCH 37/52] Update copyright year --- XRTK.Lumin/Packages/com.xrtk.lumin/LICENSE.md | 2 +- XRTK.Lumin/Packages/com.xrtk.lumin/README.md | 1 + XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta | 2 +- .../Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta | 2 +- .../Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta | 2 +- .../Providers/Controllers/LuminControllerDataProvider.cs.meta | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/LICENSE.md b/XRTK.Lumin/Packages/com.xrtk.lumin/LICENSE.md index 9ba57df..ae38a2f 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/LICENSE.md +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 XRTK +Copyright (c) 2020 XRTK Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/README.md b/XRTK.Lumin/Packages/com.xrtk.lumin/README.md index 4b935d1..5356f70 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/README.md +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/README.md @@ -1,2 +1,3 @@ # Lumin + The Lumin platform components for the [XRTK - Mixed Reality Toolkit](https://github.com/XRTK/XRTK-Core) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta index fa3a84b..4948f29 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 02da3807e14483f4e9f23942da74330a +guid: 3f3200395f93cdc4c8e4b2df042c8430 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta index 22bd3b2..191044b 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 121e4851a321a224f8bdab107a934c48 +guid: 8edcd6f437a8f024190e49cc25f4734e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta index 71ce57f..0327b02 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 64a742e2a2e11ac49a627cb6f6c42e03 +guid: d76559f92c920b84bbb6d26422bf44ae folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta index cb6deb4..2c81f30 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta @@ -5,7 +5,7 @@ MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 - icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} + icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} userData: assetBundleName: assetBundleVariant: From f451340c1a34a9fd9162f471db22eb197bb1f5e8 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 14:06:29 +0200 Subject: [PATCH 38/52] Fix namespace --- .../Editor/LuminHandControllerDataProviderProfileInspector.cs | 2 +- XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta | 3 +-- .../Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.cs index 16f437e..bf54687 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Editor/LuminHandControllerDataProviderProfileInspector.cs @@ -11,7 +11,7 @@ using UnityEngine.XR.MagicLeap; #endif // PLATFORM_LUMIN -namespace XRTK.Lumin.Inspectors +namespace XRTK.Lumin.Editor { [CustomEditor(typeof(LuminHandControllerDataProviderProfile))] public class LuminHandControllerDataProviderProfileInspector : BaseMixedRealityHandControllerDataProviderProfileInspector diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta index 4948f29..8ff2b23 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta @@ -4,5 +4,4 @@ folderAsset: yes DefaultImporter: externalObjects: {} userData: - assetBundleName: - assetBundleVariant: \ No newline at end of file + assetBundleName: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta index 0327b02..da5ceb5 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta @@ -4,5 +4,4 @@ folderAsset: yes DefaultImporter: externalObjects: {} userData: - assetBundleName: - assetBundleVariant: \ No newline at end of file + assetBundleName: \ No newline at end of file From c0566ca4171843ad8151bf0bce7c064411f092bd Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 14:08:25 +0200 Subject: [PATCH 39/52] Reset meta --- XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta | 3 ++- .../Profiles/LuminControllerDataProviderProfile.cs.meta | 2 +- .../Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta | 3 ++- .../Providers/Controllers/LuminControllerDataProvider.cs.meta | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta index 8ff2b23..4948f29 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta @@ -4,4 +4,5 @@ folderAsset: yes DefaultImporter: externalObjects: {} userData: - assetBundleName: \ No newline at end of file + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta index 191044b..d5c7ed2 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta @@ -8,4 +8,4 @@ MonoImporter: icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} userData: assetBundleName: - assetBundleVariant: + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta index da5ceb5..0327b02 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta @@ -4,4 +4,5 @@ folderAsset: yes DefaultImporter: externalObjects: {} userData: - assetBundleName: \ No newline at end of file + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta index 2c81f30..62d3946 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta @@ -8,4 +8,4 @@ MonoImporter: icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} userData: assetBundleName: - assetBundleVariant: + assetBundleVariant: \ No newline at end of file From 120d65db609c121c153bb12b1bdfd223b375445a Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 14:09:06 +0200 Subject: [PATCH 40/52] Cleanup --- XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta | 3 ++- .../Profiles/LuminControllerDataProviderProfile.cs.meta | 3 ++- .../Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta | 3 ++- .../Providers/Controllers/LuminControllerDataProvider.cs.meta | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta index 4948f29..989fc10 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta @@ -5,4 +5,5 @@ DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: \ No newline at end of file + assetBundleVariant: + \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta index d5c7ed2..310a6ad 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta @@ -8,4 +8,5 @@ MonoImporter: icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} userData: assetBundleName: - assetBundleVariant: \ No newline at end of file + assetBundleVariant: + \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta index 0327b02..f989fd8 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta @@ -5,4 +5,5 @@ DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: \ No newline at end of file + assetBundleVariant: + \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta index 62d3946..8b4e136 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta @@ -8,4 +8,5 @@ MonoImporter: icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} userData: assetBundleName: - assetBundleVariant: \ No newline at end of file + assetBundleVariant: + \ No newline at end of file From 4e89c2a8baf1046af8fa5ef7f62e071e76a603ee Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 14:10:45 +0200 Subject: [PATCH 41/52] Undo --- XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta | 3 +-- .../Profiles/LuminControllerDataProviderProfile.cs.meta | 3 +-- .../Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta | 3 +-- .../Providers/Controllers/LuminControllerDataProvider.cs.meta | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta index 989fc10..4948f29 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles.meta @@ -5,5 +5,4 @@ DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: - \ No newline at end of file + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta index 310a6ad..d5c7ed2 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs.meta @@ -8,5 +8,4 @@ MonoImporter: icon: {fileID: 2800000, guid: 6e2e9d716bbb4d8382bd53f11996b90e, type: 3} userData: assetBundleName: - assetBundleVariant: - \ No newline at end of file + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta index f989fd8..0327b02 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta @@ -5,5 +5,4 @@ DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: - \ No newline at end of file + assetBundleVariant: \ No newline at end of file diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta index 8b4e136..62d3946 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta @@ -8,5 +8,4 @@ MonoImporter: icon: {fileID: 2800000, guid: 8ac5213854cf4dbabd140decf8df1946, type: 3} userData: assetBundleName: - assetBundleVariant: - \ No newline at end of file + assetBundleVariant: \ No newline at end of file From 84301b2eed244710a260d09df1dd37622ada4a01 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 14:29:29 +0200 Subject: [PATCH 42/52] Fix controller providers namespace and location --- .../com.xrtk.lumin/Runtime/Providers/InputSystem.meta | 8 ++++++++ .../Runtime/Providers/{ => InputSystem}/Controllers.meta | 0 .../{ => InputSystem}/Controllers/LuminController.cs | 2 +- .../{ => InputSystem}/Controllers/LuminController.cs.meta | 0 .../Controllers/LuminControllerDataProvider.cs | 2 +- .../Controllers/LuminControllerDataProvider.cs.meta | 0 .../Controllers/LuminHandControllerDataProvider.cs | 2 +- .../Controllers/LuminHandControllerDataProvider.cs.meta | 0 8 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem.meta rename XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/{ => InputSystem}/Controllers.meta (100%) rename XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/{ => InputSystem}/Controllers/LuminController.cs (99%) rename XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/{ => InputSystem}/Controllers/LuminController.cs.meta (100%) rename XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/{ => InputSystem}/Controllers/LuminControllerDataProvider.cs (99%) rename XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/{ => InputSystem}/Controllers/LuminControllerDataProvider.cs.meta (100%) rename XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/{ => InputSystem}/Controllers/LuminHandControllerDataProvider.cs (99%) rename XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/{ => InputSystem}/Controllers/LuminHandControllerDataProvider.cs.meta (100%) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem.meta new file mode 100644 index 0000000..7e2334b --- /dev/null +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40ebabdd1f7dcc245994a17c6f3af616 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers.meta similarity index 100% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers.meta rename to XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminController.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminController.cs similarity index 99% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminController.cs rename to XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminController.cs index c18553c..72a4fd8 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminController.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminController.cs @@ -16,7 +16,7 @@ #endif -namespace XRTK.Lumin.Providers.Controllers +namespace XRTK.Lumin.Providers.InputSystem.Controllers { public class LuminController : BaseController { diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminController.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminController.cs.meta similarity index 100% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminController.cs.meta rename to XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminController.cs.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminControllerDataProvider.cs similarity index 99% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs rename to XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminControllerDataProvider.cs index 3b79160..dda08bc 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminControllerDataProvider.cs @@ -17,7 +17,7 @@ #endif // PLATFORM_LUMIN -namespace XRTK.Lumin.Providers.Controllers +namespace XRTK.Lumin.Providers.InputSystem.Controllers { public class LuminControllerDataProvider : BaseControllerDataProvider { diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminControllerDataProvider.cs.meta similarity index 100% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminControllerDataProvider.cs.meta rename to XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminControllerDataProvider.cs.meta diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminHandControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs similarity index 99% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminHandControllerDataProvider.cs rename to XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs index 972853f..d30bc8e 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminHandControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs @@ -17,7 +17,7 @@ #endif // PLATFORM_LUMIN -namespace XRTK.Lumin.Providers.Controllers +namespace XRTK.Lumin.Providers.InputSystem.Controllers { public class LuminHandControllerDataProvider : BaseHandControllerDataProvider { diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminHandControllerDataProvider.cs.meta b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs.meta similarity index 100% rename from XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/Controllers/LuminHandControllerDataProvider.cs.meta rename to XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs.meta From bad9d2071f81e87fb28c5f5e8038e330adec0225 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Mon, 27 Apr 2020 15:44:55 +0200 Subject: [PATCH 43/52] Fix usings --- .../Runtime/Profiles/LuminControllerDataProviderProfile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs index d4e8773..977a1f9 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Profiles/LuminControllerDataProviderProfile.cs @@ -3,7 +3,7 @@ using XRTK.Definitions.Controllers; using XRTK.Definitions.Utilities; -using XRTK.Lumin.Providers.Controllers; +using XRTK.Lumin.Providers.InputSystem.Controllers; namespace XRTK.Lumin.Profiles { From ee8e8b12bbb8184913ca5507f3ac0f97a6a3fddd Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 2 May 2020 17:09:58 +0200 Subject: [PATCH 44/52] Fix default Lumin hand data provider profile --- .../Controllers/LuminHandControllerDataProviderProfile.asset | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset index b88871e..2565259 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset @@ -14,11 +14,12 @@ 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: [] keyPointFilterLevel: 0 poseFilterLevel: 0 From e8bb655fb8f53a5acb92746e0d6c0a631b13db51 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 3 May 2020 17:24:17 +0200 Subject: [PATCH 45/52] Update profile references --- .../Controllers/LuminHandControllerDataProviderProfile.asset | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset index 2565259..9cccf5c 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.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 7ccdf8299aae7741d1f3a59887f8f366ccd282cf Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 10 May 2020 09:51:49 +0200 Subject: [PATCH 46/52] Introduce hand rendering mode --- .../InputSystem/Controllers/LuminHandControllerDataProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs index 11bf439..c9e9015 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs @@ -16,6 +16,7 @@ using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; using XRTK.Services; +using XRTK.Definitions.Controllers.Hands; #endif // PLATFORM_LUMIN @@ -77,7 +78,7 @@ public override void Enable() Debug.LogError($"Error: Failed {nameof(MLHands.KeyPoseManager.SetPoseFilterLevel)}."); } - LuminHandDataConverter.HandMeshingEnabled = HandMeshingEnabled; + LuminHandDataConverter.HandMeshingEnabled = RenderingMode == HandRenderingMode.Mesh; } /// From 0bc7d6bf2610f5acad99bb2f34e8513b84ab2dd2 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sun, 10 May 2020 09:56:43 +0200 Subject: [PATCH 47/52] Implement runtime rendering mode switch --- .../Controllers/LuminHandControllerDataProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs index c9e9015..871c1ff 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Providers/InputSystem/Controllers/LuminHandControllerDataProvider.cs @@ -77,8 +77,6 @@ public override void Enable() { Debug.LogError($"Error: Failed {nameof(MLHands.KeyPoseManager.SetPoseFilterLevel)}."); } - - LuminHandDataConverter.HandMeshingEnabled = RenderingMode == HandRenderingMode.Mesh; } /// @@ -86,6 +84,8 @@ public override void Update() { base.Update(); + LuminHandDataConverter.HandMeshingEnabled = RenderingMode == HandRenderingMode.Mesh; + if (isEnabled) { GetOrAddController(Handedness.Left).UpdateController(leftHandConverter.GetHandData()); From ca87650259b0fd1c5927528044891ead75e7446b Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Fri, 22 May 2020 08:45:27 +0200 Subject: [PATCH 48/52] Update converter to define platform capabilities --- .../Runtime/Utilities/LuminHandDataConverter.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs index a149a4d..d685b75 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs @@ -28,6 +28,18 @@ public sealed class LuminHandDataConverter : BaseHandDataConverter public LuminHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) { } + /// + protected override bool PlatformProvidesPointerPose => false; + + /// + protected override bool PlatformProvidesIsPinching => false; + + /// + protected override bool PlatformProvidesPinchStrength => false; + + /// + protected override bool PlatformProvidesIsPointing => false; + #if PLATFORM_LUMIN /// From 167072329b2397a5e7beef4ae2ec8bd8a8a14ad0 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 26 May 2020 17:59:16 +0200 Subject: [PATCH 49/52] Remove the need for base converter --- .../Runtime/Utilities/LuminHandDataConverter.cs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs index d685b75..ec7cff1 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs @@ -18,28 +18,16 @@ namespace XRTK.Lumin.Utilities /// /// Converts oculus hand data to . /// - public sealed class LuminHandDataConverter : BaseHandDataConverter + public sealed class LuminHandDataConverter { /// /// Constructor. /// /// Handedness of the hand this converter is created for. /// The tracked poses collection to use for pose recognition. - public LuminHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) : base(handedness, trackedPoses) + public LuminHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) { } - /// - protected override bool PlatformProvidesPointerPose => false; - - /// - protected override bool PlatformProvidesIsPinching => false; - - /// - protected override bool PlatformProvidesPinchStrength => false; - - /// - protected override bool PlatformProvidesIsPointing => false; - #if PLATFORM_LUMIN /// From 6e030cc96f7e95284fd5eb84fbabe904ab3fb826 Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Tue, 26 May 2020 21:40:20 +0200 Subject: [PATCH 50/52] Fix build errors due to removal of base converter --- .../Runtime/Utilities/LuminHandDataConverter.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs index ec7cff1..8e98ee9 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs @@ -1,10 +1,8 @@ // Copyright (c) XRTK. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -using System.Collections.Generic; using XRTK.Definitions.Controllers.Hands; using XRTK.Definitions.Utilities; -using XRTK.Providers.Controllers.Hands; #if PLATFORM_LUMIN @@ -24,9 +22,12 @@ public sealed class LuminHandDataConverter /// Constructor. /// /// Handedness of the hand this converter is created for. - /// The tracked poses collection to use for pose recognition. - public LuminHandDataConverter(Handedness handedness, IReadOnlyList trackedPoses) - { } + public LuminHandDataConverter(Handedness handedness) + { + this.handedness = handedness; + } + + private readonly Handedness handedness; #if PLATFORM_LUMIN @@ -41,7 +42,7 @@ public LuminHandDataConverter(Handedness handedness, IReadOnlyListPlatform agnostics hand data. public HandData GetHandData() { - var hand = ToMagicLeapHand(Handedness); + var hand = ToMagicLeapHand(handedness); var updatedHandData = new HandData { IsTracked = hand.IsVisible, From 6608a6d9910e396a7416be1188b2f00b057cf45e Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Wed, 27 May 2020 10:46:28 +0200 Subject: [PATCH 51/52] Rename joints --- .../Utilities/LuminHandDataConverter.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs index 8e98ee9..b06c309 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Runtime/Utilities/LuminHandDataConverter.cs @@ -100,14 +100,14 @@ private static void UpdateHandJoints(MLHand hand, MixedRealityPose[] jointPoses) jointPoses[i] = EstimatePalmPose(wrist.Center, middle.MCP); break; // Finger: Thumb - case TrackedHandJoint.ThumbMetacarpalJoint: + case TrackedHandJoint.ThumbMetacarpal: jointPoses[i] = ComputeJointPose(thumb.MCP); break; - case TrackedHandJoint.ThumbProximalJoint: + case TrackedHandJoint.ThumbProximal: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.ThumbDistalJoint: + case TrackedHandJoint.ThumbDistal: jointPoses[i] = ComputeJointPose(thumb.IP); break; case TrackedHandJoint.ThumbTip: @@ -118,13 +118,13 @@ private static void UpdateHandJoints(MLHand hand, MixedRealityPose[] jointPoses) // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.IndexKnuckle: + case TrackedHandJoint.IndexProximal: jointPoses[i] = ComputeJointPose(index.MCP); break; - case TrackedHandJoint.IndexMiddleJoint: + case TrackedHandJoint.IndexIntermediate: jointPoses[i] = ComputeJointPose(index.PIP); break; - case TrackedHandJoint.IndexDistalJoint: + case TrackedHandJoint.IndexDistal: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; @@ -136,13 +136,13 @@ private static void UpdateHandJoints(MLHand hand, MixedRealityPose[] jointPoses) // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.MiddleKnuckle: + case TrackedHandJoint.MiddleProximal: jointPoses[i] = ComputeJointPose(middle.MCP); break; - case TrackedHandJoint.MiddleMiddleJoint: + case TrackedHandJoint.MiddleIntermediate: jointPoses[i] = ComputeJointPose(middle.PIP); break; - case TrackedHandJoint.MiddleDistalJoint: + case TrackedHandJoint.MiddleDistal: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; @@ -154,14 +154,14 @@ private static void UpdateHandJoints(MLHand hand, MixedRealityPose[] jointPoses) // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.RingKnuckle: + case TrackedHandJoint.RingProximal: jointPoses[i] = ComputeJointPose(ring.MCP); break; - case TrackedHandJoint.RingMiddleJoint: + case TrackedHandJoint.RingIntermediate: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.RingDistalJoint: + case TrackedHandJoint.RingDistal: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; @@ -169,22 +169,22 @@ private static void UpdateHandJoints(MLHand hand, MixedRealityPose[] jointPoses) jointPoses[i] = ComputeJointPose(ring.Tip); break; // Finger: Pinky - case TrackedHandJoint.PinkyMetacarpal: + case TrackedHandJoint.LittleMetacarpal: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.PinkyKnuckle: + case TrackedHandJoint.LittleProximal: jointPoses[i] = ComputeJointPose(pinky.MCP); break; - case TrackedHandJoint.PinkyMiddleJoint: + case TrackedHandJoint.LittleIntermediate: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.PinkyDistalJoint: + case TrackedHandJoint.LittleDistal: // TODO: Estimate? jointPoses[i] = MixedRealityPose.ZeroIdentity; break; - case TrackedHandJoint.PinkyTip: + case TrackedHandJoint.LittleTip: jointPoses[i] = ComputeJointPose(pinky.Tip); break; } From f4b22918d915c17ac2d5ce565b1512a29a6d42fc Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Wed, 27 May 2020 15:53:27 +0200 Subject: [PATCH 52/52] Point to new hand controller profiles --- .../LuminHandControllerDataProviderProfile.asset | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset index 9cccf5c..0eb8054 100644 --- a/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.asset +++ b/XRTK.Lumin/Packages/com.xrtk.lumin/Profiles~/Controllers/LuminHandControllerDataProviderProfile.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