From 27a6ef9b8bf2c665b7771c78119e0f8e034883ea Mon Sep 17 00:00:00 2001 From: Dino Fejzagic Date: Sat, 11 Apr 2020 14:33:31 +0200 Subject: [PATCH] Remove obsolete SetupDefaultInteractions (#515) --- .../Providers/Controllers/BaseController.cs | 6 ----- .../Controllers/Hands/BaseHandController.cs | 4 --- .../OpenVR/GenericOpenVRController.cs | 6 ----- .../OpenVR/OculusGoOpenVRController.cs | 6 ----- .../OpenVR/OculusRemoteOpenVRController.cs | 6 ----- .../OpenVR/OculusTouchOpenVRController.cs | 6 ----- .../OpenVR/ViveKnucklesOpenVRController.cs | 6 ----- .../OpenVR/ViveWandOpenVRController.cs | 6 ----- ...ndowsMixedRealityOpenVRMotionController.cs | 6 ----- .../Hands/SimulatedHandController.cs | 6 ----- .../UnityInput/GenericJoystickController.cs | 6 ----- .../Controllers/UnityInput/MouseController.cs | 6 ----- .../UnityInput/UnityTouchController.cs | 25 ------------------- .../Controllers/UnityInput/XboxController.cs | 6 ----- 14 files changed, 101 deletions(-) diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/BaseController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/BaseController.cs index 938215ced..ef2cb64c9 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/BaseController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/BaseController.cs @@ -132,12 +132,6 @@ protected BaseController(IMixedRealityControllerDataProvider controllerDataProvi /// public virtual void UpdateController() { } - /// - /// Assign the default interactions based on controller handedness if necessary. - /// - /// The handedness of the controller. - public abstract void SetupDefaultInteractions(Handedness controllerHandedness); - /// /// Load the Interaction mappings for this controller from the configured Controller Mapping profile /// diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Hands/BaseHandController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Hands/BaseHandController.cs index 8e4e34375..4068be119 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Hands/BaseHandController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Hands/BaseHandController.cs @@ -7,7 +7,6 @@ using XRTK.Definitions.Controllers.Hands; using XRTK.Definitions.Devices; using XRTK.Definitions.Utilities; -using XRTK.Interfaces.InputSystem; using XRTK.Interfaces.Providers.Controllers; using XRTK.Interfaces.Providers.Controllers.Hands; using XRTK.Services; @@ -392,9 +391,6 @@ public bool TryGetBounds(TrackedHandBounds handBounds, out Bounds[] newBounds) return false; } - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) { } - /// public virtual bool TryGetJointPose(TrackedHandJoint joint, out MixedRealityPose pose) => jointPoses.TryGetValue(joint, out pose); diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/GenericOpenVRController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/GenericOpenVRController.cs index ac41e34fa..c4445e56d 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/GenericOpenVRController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/GenericOpenVRController.cs @@ -158,12 +158,6 @@ public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions } } - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); - } - /// public override void UpdateController() { diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusGoOpenVRController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusGoOpenVRController.cs index c31d7028b..b490828c1 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusGoOpenVRController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusGoOpenVRController.cs @@ -31,11 +31,5 @@ public OculusGoOpenVRController(IMixedRealityControllerDataProvider controllerDa new MixedRealityInteractionMapping("PrimaryTouchpad Click", AxisType.Digital, DeviceInputType.TouchpadPress, KeyCode.JoystickButton9), new MixedRealityInteractionMapping("PrimaryTouchpad Axis", AxisType.DualAxis, DeviceInputType.DirectionalPad, ControllerMappingLibrary.AXIS_4, ControllerMappingLibrary.AXIS_5) }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusRemoteOpenVRController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusRemoteOpenVRController.cs index ef77a47af..94e76da41 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusRemoteOpenVRController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusRemoteOpenVRController.cs @@ -26,11 +26,5 @@ public OculusRemoteOpenVRController(IMixedRealityControllerDataProvider controll new MixedRealityInteractionMapping("Button.One", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton0), new MixedRealityInteractionMapping("Button.Two", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton1), }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } } } diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs index 3ff51c357..bfca866ff 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/OculusTouchOpenVRController.cs @@ -63,11 +63,5 @@ public OculusTouchOpenVRController(IMixedRealityControllerDataProvider controlle new MixedRealityInteractionMapping("Touch.SecondaryThumbRest Touch", AxisType.Digital, DeviceInputType.ThumbTouch, KeyCode.JoystickButton19), new MixedRealityInteractionMapping("Touch.SecondaryThumbRest Near Touch", AxisType.Digital, DeviceInputType.ThumbNearTouch, ControllerMappingLibrary.AXIS_18) }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); - } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveKnucklesOpenVRController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveKnucklesOpenVRController.cs index d7624ae5b..571c1ab35 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveKnucklesOpenVRController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveKnucklesOpenVRController.cs @@ -57,11 +57,5 @@ public ViveKnucklesOpenVRController(IMixedRealityControllerDataProvider controll new MixedRealityInteractionMapping("Ring Finger Cap Sensor", AxisType.SingleAxis, DeviceInputType.RingFinger, ControllerMappingLibrary.AXIS_25), new MixedRealityInteractionMapping("Pinky Finger Cap Sensor", AxisType.SingleAxis, DeviceInputType.PinkyFinger, ControllerMappingLibrary.AXIS_27), }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); - } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveWandOpenVRController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveWandOpenVRController.cs index b8dc638c8..cc4127178 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveWandOpenVRController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/ViveWandOpenVRController.cs @@ -46,11 +46,5 @@ public ViveWandOpenVRController(IMixedRealityControllerDataProvider controllerDa new MixedRealityInteractionMapping("Trackpad Press", AxisType.Digital, DeviceInputType.TouchpadPress, KeyCode.JoystickButton9), new MixedRealityInteractionMapping("Menu Button", AxisType.Digital, DeviceInputType.ButtonPress, KeyCode.JoystickButton0), }; - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); - } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/WindowsMixedRealityOpenVRMotionController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/WindowsMixedRealityOpenVRMotionController.cs index 0f9fd554f..71c8aeb55 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/WindowsMixedRealityOpenVRMotionController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/OpenVR/WindowsMixedRealityOpenVRMotionController.cs @@ -73,11 +73,5 @@ public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions }; } } - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(controllerHandedness == Handedness.Left ? DefaultLeftHandedInteractions : DefaultRightHandedInteractions); - } } } \ No newline at end of file diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Simulation/Hands/SimulatedHandController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Simulation/Hands/SimulatedHandController.cs index 1bb218f5e..5c5fb4c34 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Simulation/Hands/SimulatedHandController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/Simulation/Hands/SimulatedHandController.cs @@ -159,12 +159,6 @@ private Vector3 DeltaPosition /// public override MixedRealityInteractionMapping[] DefaultRightHandedInteractions => DefaultInteractions; - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } - /// /// Gets the hands position in screen space. /// diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/GenericJoystickController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/GenericJoystickController.cs index 6df34632f..5c8b2b5fe 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/GenericJoystickController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/GenericJoystickController.cs @@ -35,12 +35,6 @@ public GenericJoystickController(IMixedRealityControllerDataProvider controllerD protected MixedRealityPose LastControllerPose = MixedRealityPose.ZeroIdentity; protected MixedRealityPose CurrentControllerPose = MixedRealityPose.ZeroIdentity; - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - // Generic unity controller's will not have default interactions - } - /// /// Update the controller data from Unity's Input Manager /// diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/MouseController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/MouseController.cs index 57c230ecc..1c2333bbb 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/MouseController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/MouseController.cs @@ -50,12 +50,6 @@ public override MixedRealityInteractionMapping[] DefaultInteractions } } - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } - private MixedRealityPose controllerPose = MixedRealityPose.ZeroIdentity; private Vector2 mouseDelta; diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/UnityTouchController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/UnityTouchController.cs index b2e8ffeb9..4ad4f9048 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/UnityTouchController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/UnityTouchController.cs @@ -63,31 +63,6 @@ public UnityTouchController(IMixedRealityControllerDataProvider controllerDataPr private bool isManipulating; private MixedRealityPose lastPose = MixedRealityPose.ZeroIdentity; - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - - if (MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled && - MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.GesturesProfile != null) - { - for (int i = 0; i < MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.GesturesProfile.Gestures.Length; i++) - { - var gesture = MixedRealityToolkit.Instance.ActiveProfile.InputSystemProfile.GesturesProfile.Gestures[i]; - - switch (gesture.GestureType) - { - case GestureInputType.Hold: - holdingAction = gesture.Action; - break; - case GestureInputType.Manipulation: - manipulationAction = gesture.Action; - break; - } - } - } - } - /// /// Start the touch. /// diff --git a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/XboxController.cs b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/XboxController.cs index 22548c0b1..0290aa4fb 100644 --- a/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/XboxController.cs +++ b/XRTK-Core/Packages/com.xrtk.core/Providers/Controllers/UnityInput/XboxController.cs @@ -51,11 +51,5 @@ public override MixedRealityInteractionMapping[] DefaultInteractions }; } } - - /// - public override void SetupDefaultInteractions(Handedness controllerHandedness) - { - AssignControllerMappings(DefaultInteractions); - } } } \ No newline at end of file