Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface IModeManagedInteractor
/// Returns the GameObject that this interactor belongs to. This GameObject is governed by the
/// interaction mode manager and is assigned an interaction mode. This GameObject represents the 'controller' that this interactor belongs to.
/// </summary>
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
public GameObject GetModeManagedController();

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace MixedReality.Toolkit
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("MRTK/Core/Controller Lookup")]
[Obsolete("Deprecated, please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
[Obsolete("ControllerLookup has been deprecated in version 4.0.0. Please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
public class ControllerLookup : MonoBehaviour
{
// Gaze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace MixedReality.Toolkit.Input
/// state will have no position and no rotation data. In this case, the controller may want to fallback to head pose.
/// </remarks>
[AddComponentMenu("MRTK/Input/XR Controller (Action-based with Fallbacks)")]
[Obsolete("Deprecated, please use MixedReality.Toolkit.Input.TrackedPoseDriverWithFallback")]
[Obsolete("ActionBasedControllerWithFallbacks has been deprecated in version 4.0.0. Please use MixedReality.Toolkit.Input.TrackedPoseDriverWithFallback")]
public class ActionBasedControllerWithFallbacks : ActionBasedController
{
#region Fallback actions values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace MixedReality.Toolkit.Input
/// This is able to support variable pinch select through the use of <see cref="HandsAggregatorSubsystem"/>.
/// </remarks>
[AddComponentMenu("MRTK/Input/XR Controller (Articulated Hand)")]
[Obsolete]
[Obsolete("ArticulatedHandController has been deprecated in version 4.0.0. Its functionality has been distributed into different components.")]
public class ArticulatedHandController : ActionBasedController
{
#region Associated hand select values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem.XR;
using UnityEngine.Serialization;
using UnityEngine.XR;

namespace MixedReality.Toolkit.Input
{
Expand All @@ -23,7 +21,7 @@ internal class FlatScreenModeDetector : MonoBehaviour, IInteractionModeDetector

public InteractionMode ModeOnDetection => flatScreenInteractionMode;

[Obsolete("Deprecated, please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
[Obsolete("This field has been deprecated in version 4.0.0. Please use MixedReality.Toolkit.Input.TrackedPoseDriverLookup instead.")]
protected ControllerLookup controllerLookup = null;

protected TrackedPoseDriverLookup trackedPoseDriverLookup = null;
Expand All @@ -40,22 +38,22 @@ protected void Awake()
trackedPoseDriverLookup = ComponentCache<TrackedPoseDriverLookup>.FindFirstActiveInstance();
}

/// <inheritdoc />
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
/// <inheritdoc />
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
public List<GameObject> GetControllers() => GetInteractorGroups();

/// <inheritdoc />
/// <inheritdoc />
public List<GameObject> GetInteractorGroups() => interactorGroups;

public bool IsModeDetected()
{
// Flat screen mode is only active if the Left and Right Hands aren't being tracked
#pragma warning disable CS0618 // Type or member is obsolete
#pragma warning disable CS0618 // Type or member is obsolete
if (controllerLookup != null)
{
return !controllerLookup.LeftHandController.currentControllerState.inputTrackingState.HasPositionAndRotation() && !controllerLookup.RightHandController.currentControllerState.inputTrackingState.HasPositionAndRotation();
}
#pragma warning restore CS0618
#pragma warning restore CS0618
else if (trackedPoseDriverLookup != null)
{
return !trackedPoseDriverLookup.LeftHandTrackedPoseDriver.GetInputTrackingState().HasPositionAndRotation() &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;


namespace MixedReality.Toolkit.Input
{
Expand All @@ -32,7 +30,7 @@ public interface IInteractionModeDetector
/// Get a list of the <see cref="GameObject"/> instances which represent the controllers that this interaction mode detector has jurisdiction over.
/// </summary>
/// <returns>The list of the <see cref="GameObject"/> instances which represent the controllers that this interaction mode detector has jurisdiction over.</returns>
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
List<GameObject> GetControllers();

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ private InteractionMode GetDetectedMode()
[Tooltip("List of GameObjects which represent the interactor groups that this interaction mode detector has jurisdiction over. Interaction modes will be set on all specified groups.")]
private List<GameObject> interactorGroups;

/// <inheritdoc />
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
/// <inheritdoc />
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
public List<GameObject> GetControllers() => GetInteractorGroups();

/// <inheritdoc />
/// <inheritdoc />
public List<GameObject> GetInteractorGroups() => interactorGroups;

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
using UnityEngine.XR.Interaction.Toolkit;
using UnityEngine.XR.Interaction.Toolkit.Interactors;

using TrackedPoseDriver = UnityEngine.InputSystem.XR.TrackedPoseDriver;

namespace MixedReality.Toolkit.Input
{
/// <summary>
Expand Down Expand Up @@ -72,7 +70,7 @@ public static InteractionModeManager Instance
/// <summary>
/// Editor only function for initializing the Interaction Mode Manager with the existing XR controllers in the scene
/// </summary>
[Obsolete("This method is obsolete. Please use InitializeInteractorGroups instead.")]
[Obsolete("This method has been deprecated in version 4.0.0. Please use InitializeInteractorGroups instead.")]
public void InitializeControllers()
{
foreach (XRBaseController xrController in FindObjectUtility.FindObjectsByType<XRBaseController>())
Expand Down Expand Up @@ -436,13 +434,10 @@ private void Update()
{
List<GameObject> groups = detector.GetInteractorGroups();

// For backwards compatibility, we will continue to support the obsolete "GetControllers()" function.
if (groups == null)
{
#pragma warning disable CS0618 // GetControllers is obsolete
groups = detector.GetControllers();
// For backwards compatibility, we will continue to support the obsolete "GetControllers()" function.
groups ??= detector.GetControllers();
#pragma warning restore CS0618 // GetControllers is obsolete
}

foreach (GameObject group in groups)
{
Expand Down Expand Up @@ -561,7 +556,7 @@ private GameObject FindInteractorGroupObject(XRBaseInteractor interactor)
GameObject interactorGroupObject = null;

// For backwards compatibility, we will continue to support the obsolete "controller-based" interactors,
// and group based on "controller" partents.
// and group based on "controller" parents.
#pragma warning disable CS0618 // xrController is obsolete
if (interactor is XRBaseInputInteractor controllerInteractor &&
controllerInteractor.xrController != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ProximityDetector : MonoBehaviour, IInteractionModeDetector
private List<GameObject> interactorGroups;

/// <inheritdoc />
[Obsolete("This function is obsolete and will be removed in a future version. Please use GetInteractorGroups instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in a future version. Please use GetInteractorGroups instead.")]
public List<GameObject> GetControllers() => GetInteractorGroups();

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,12 @@ public GameObject ModeManagedRoot
}

/// <inheritdoc/>
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
public GameObject GetModeManagedController()
{
// Legacy controller-based interactors should return null, so the legacy controller-based logic in the
// interaction mode manager is used instead.
#pragma warning disable CS0618 // forceDeprecatedInput is obsolete
if (forceDeprecatedInput)
{
return null;
}
#pragma warning restore CS0618 // forceDeprecatedInput is obsolete

return ModeManagedRoot;
return forceDeprecatedInput ? null : ModeManagedRoot;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public GameObject ModeManagedRoot

[SerializeField]
[Tooltip("The hand controller used to get the selection progress values")]
[Obsolete("Deprecated, please use this.TrackedPoseDriver instead.")]
[Obsolete("This field has been deprecated in version 4.0.0. Please use this.TrackedPoseDriver instead.")]
private ArticulatedHandController handController;

/// <summary>
Expand Down Expand Up @@ -327,11 +327,11 @@ public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase upda

/// <summary>
/// Given the specified interactable, this computes and applies the relevant
/// position and rotation to the attach transform.
/// position and rotation to the attach transform.
/// </summary>
/// <remarks>
/// If there is currently an active selection, the attach transform is computed
/// as an offset from selected object, where the offset vector is a function of
/// If there is currently an active selection, the attach transform is computed
/// as an offset from selected object, where the offset vector is a function of
/// the centroid between all currently participating <see cref="GazePinchInteractor"/>
/// objects. This models ray-like manipulations, but with virtual attach offsets
/// from object, modeled from the relationship between each participating hand.
Expand Down Expand Up @@ -485,7 +485,7 @@ private void ResetManipulationLogic(IXRSelectInteractable interactable)
interactorLocalAttachPoint = Quaternion.Inverse(noRollRay) * (virtualAttachTransform - aimPose.position);

// Record the distance from the controller to the body of the user, to use as reference for subsequent
// distance measurements.
// distance measurements.
bodyDistanceOnSelect = PoseUtilities.GetDistanceToBody(aimPose);
}

Expand Down Expand Up @@ -568,21 +568,16 @@ protected override void OnSelectExited(SelectExitEventArgs args)
#endregion ITrackedInteractor

#region IModeManagedInteractor

/// <inheritdoc/>
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
public GameObject GetModeManagedController()
{
// Legacy controller-based interactors should return null, so the legacy controller-based logic in the
// interaction mode manager is used instead.
#pragma warning disable CS0618 // Type or member is obsolete
if (forceDeprecatedInput)
{
return null;
}
#pragma warning restore CS0618 // Type or member is obsolete

return ModeManagedRoot;
return forceDeprecatedInput ? null : ModeManagedRoot;
}

#endregion IModeManagedInteractor

#region Private Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,16 @@ public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase upda
#endregion XRBaseInputInteractor

#region IModeManagedInteractor

/// <inheritdoc/>
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
public GameObject GetModeManagedController()
{
// Legacy controller-based interactors should return null, so the legacy controller-based logic in the
// interaction mode manager is used instead.
#pragma warning disable CS0618 // Type or member is obsolete
if (forceDeprecatedInput)
{
return null;
}
#pragma warning restore CS0618 // Type or member is obsolete

return ModeManagedRoot;
return forceDeprecatedInput ? null : ModeManagedRoot;
}

#endregion IModeManagedInteractor

#region Unity Event Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,21 +326,16 @@ public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase upda
#endregion ITrackedInteractor

#region IModeManagedInteractor

/// <inheritdoc/>
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
public GameObject GetModeManagedController()
{
// Legacy controller-based interactors should return null, so the legacy controller-based logic in the
// interaction mode manager is used instead.
#pragma warning disable CS0618 // Type or member is obsolete
if (forceDeprecatedInput)
{
return null;
}
#pragma warning restore CS0618 // Type or member is obsolete

return ModeManagedRoot;
return forceDeprecatedInput ? null : ModeManagedRoot;
}

#endregion IModeManagedInteractor
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,16 @@ protected override void OnSelectEntering(SelectEnterEventArgs args)
#endregion XRBaseInteractor

#region IModeManagedInteractor

/// <inheritdoc/>
[Obsolete("This function is obsolete and will be removed in the next major release. Use ModeManagedRoot instead.")]
[Obsolete("This function has been deprecated in version 4.0.0 and will be removed in the next major release. Use ModeManagedRoot instead.")]
public GameObject GetModeManagedController()
{
// Legacy controller-based interactors should return null, so the legacy controller-based logic in the
// interaction mode manager is used instead.
#pragma warning disable CS0618 // Type or member is obsolete
if (forceDeprecatedInput)
{
return null;
}
#pragma warning restore CS0618 // Type or member is obsolete

return ModeManagedRoot;
return forceDeprecatedInput ? null : ModeManagedRoot;
}

#endregion IModeManagedInteractor

#region Unity Event Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@ namespace MixedReality.Toolkit.Input
/// which successfully returns a pose.
/// </summary>
[Serializable]
public class FallbackCompositePoseSource : IPoseSource, ISerializationCallbackReceiver
public class FallbackCompositePoseSource : IPoseSource
{
[SerializeReference]
[InterfaceSelector]
[Tooltip("An ordered list of pose sources to query.")]
private IPoseSource[] poseSourceList;

[SerializeField]
[Tooltip("An ordered list of pose sources to query.")]
[Obsolete, HideInInspector]
private PoseSourceWrapper[] poseSources;

/// <summary>
/// An ordered list of pose sources to query.
/// </summary>
Expand All @@ -46,33 +41,5 @@ public bool TryGetPose(out Pose pose)
pose = Pose.identity;
return false;
}

[Obsolete]
void ISerializationCallbackReceiver.OnAfterDeserialize()
{
if (poseSources != null && poseSources.Length > 0)
{
poseSourceList = new IPoseSource[poseSources.Length];

for (int i = 0; i < poseSources.Length; i++)
{
PoseSourceWrapper poseSource = poseSources[i];
poseSourceList[i] = poseSource.source;
}

poseSources = null;
}
}

void ISerializationCallbackReceiver.OnBeforeSerialize() { }

[Serializable, Obsolete]
private struct PoseSourceWrapper
{
[SerializeReference]
[InterfaceSelector]
[Tooltip("The pose source we are trying to get the pose of")]
public IPoseSource source;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public XRInputButtonReader SelectInput
private List<XRDisplaySubsystem> displaySubsystems = new List<XRDisplaySubsystem>();

// The XRController that is used to determine the pinch strength (i.e., select value!)
[Obsolete("This field is obsolete and will be removed in a future version. Use the SelectInput property instead.")]
[Obsolete("This field has been deprecated in version 4.0.0 and will be removed in a future version. Use the SelectInput property instead.")]
private XRBaseController controller;

// The actual, physical, rigged joints that drive the skinned mesh.
Expand Down
Loading