Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding more summary comments to MRTK3 types and members #11622

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -8,7 +8,7 @@
namespace Microsoft.MixedReality.Toolkit.Subsystems
{
/// <summary>
/// A subsystem that enables dictation.
/// A Unity subsystem that enables dictation.
/// </summary>
[Preserve]
public class DictationSubsystem :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MRTKRayReticleVisual : BaseReticleVisual
private Vector3 reticleNormal;

/// <summary>
/// Determines whether a reticle should appear on all surfaces hit by the interactor or interactables only
/// Determines whether a reticle should appear on all surfaces hit by the interactor or interactables only.
/// </summary>
public ReticleVisibilitySettings VisibilitySettings
{
Expand Down Expand Up @@ -173,9 +173,20 @@ private void LocateTargetHitPoint(SelectEnterEventArgs args)
}
}

/// <summary>
/// An enumeration used to control when a <see cref="Microsoft.MixedReality.Toolkit.Input.MRTKRayReticleVisual">MRTKRayReticleVisual</see>
/// is visible.
/// </summary>
public enum ReticleVisibilitySettings
{
/// <summary>
/// The reticle is only visible when it intersects an interactable object.
/// </summary>
InteractablesOnly,

/// <summary>
/// The reticle is visible anytime it intersects with another object, regardless of it being interactable.
/// </summary>
AllValidSurfaces
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,18 @@ public ControllerAnchorPoint AnchorPoint
[Tooltip("The input action used to toggle between using the default or Secondary Handshape settings.")]
private InputActionReference toggleSecondaryHandshapes;

[Obsolete("Use ChangeNeutralHandshape instead")]
/// <summary>
/// The input action used to toggle between using the default or Secondary Handshape settings.
/// </summary>
/// <remarks>
/// This property is deprecated, use <see cref="ToggleSecondaryHandshapes"/> instead.
/// </remarks>
[Obsolete("This property is deprecated, use ToggleSecondaryHandshapes instead.")]
public InputActionReference ChangeNeutralPose => ToggleSecondaryHandshapes;

/// <summary>
/// The input action used to toggle between using the default or Secondary Handshape settings.
/// </summary>
public InputActionReference ToggleSecondaryHandshapes
{
get => toggleSecondaryHandshapes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// A configuration object for the <see cref="Microsoft.MixedReality.Toolkit.Input.SyntheticHandsSubsystem">SyntheticHandsSubsystem</see>
/// class. This class defines the Unity input actions that <see cref="Microsoft.MixedReality.Toolkit.Input.SyntheticHandsSubsystem">SyntheticHandsSubsystem</see>
/// uses when simulating articulated hands.
/// </summary>
[CreateAssetMenu(fileName = "MRTKSyntheticHandsConfig.asset", menuName = "MRTK/Subsystems/MRTK Synthetic Hands Config")]
public class SyntheticHandsConfig : BaseSubsystemConfig
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

namespace Microsoft.MixedReality.Toolkit.Input
{
/// <summary>
/// A Unity subsystem that enables articulated hand simulation.
/// </summary>
[Preserve]
[MRTKSubsystem(
Name = "com.microsoft.mixedreality.synthhands",
Expand All @@ -25,6 +28,10 @@ namespace Microsoft.MixedReality.Toolkit.Input
public class SyntheticHandsSubsystem : HandsSubsystem
{
private SyntheticHandsProvider syntheticProvider;

/// <summary>
/// Get the subsystem provider for this object.
/// </summary>
private SyntheticHandsProvider SyntheticProvider
{
get
Expand Down Expand Up @@ -392,6 +399,10 @@ private static void MirrorJoint(ref HandJointPose pose)
}
}

/// <summary>
/// A subsystem provider for <see cref="SyntheticHandsSubsystem"/> that provides methods for getting and setting
/// the simulated hand poses, as well as methods for obtain hand joint poses.
/// </summary>
[Preserve]
class SyntheticHandsProvider : Provider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for setting the min/max scale values for ObjectManipulator
/// or BoundsControl
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// or BoundsControl.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class FixedDistanceConstraint : TransformConstraint
{
#region Properties
Expand All @@ -27,6 +30,7 @@ public Transform ConstraintTransform
set => constraintTransform = value;
}

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Move;

private float distanceAtManipulationStart;
Expand All @@ -35,7 +39,7 @@ public Transform ConstraintTransform

#region MonoBehaviour Methods

public void Start()
private void Start()
{
EnsureConstraintTransform();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for fixing the rotation of a manipulated object relative to the user
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// Component for fixing the rotation of a manipulated object relative to the user.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class FixedRotationToUserConstraint : TransformConstraint
{
#region Properties

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Rotate;

private Quaternion startObjectRotationCameraSpace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for fixing the rotation of a manipulated object relative to the world
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// Component for fixing the rotation of a manipulated object relative to the world.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class FixedRotationToWorldConstraint : TransformConstraint
{
#region Properties

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Rotate;

#endregion Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for setting the min/max scale values for ObjectManipulator
/// or BoundsControl
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// or BoundsControl.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class MaintainApparentSizeConstraint : TransformConstraint
{
#region Properties

private float initialDist;

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Scale;

#endregion Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ namespace Microsoft.MixedReality.Toolkit.SpatialManipulation
{
/// <summary>
/// Component for limiting the translation axes for ObjectManipulator
/// or BoundsControl
/// We're looking to rework this system in the future. These existing components will be deprecated then.
/// or BoundsControl.
/// </summary>
/// <remarks>
/// MRTK's constraint system might be redesigned in the near future. When
/// this occurs, the old constraint components will be deprecated.
/// </remarks>
public class MoveAxisConstraint : TransformConstraint
{
#region Properties
Expand Down Expand Up @@ -41,6 +44,7 @@ public bool UseLocalSpaceForConstraint
set => useLocalSpaceForConstraint = value;
}

/// <inheritdoc />
public override TransformFlags ConstraintType => TransformFlags.Move;

#endregion Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public int ExecutionPriority
/// </summary>
protected MixedRealityTransform InitialWorldPose;

/// <summary>
/// Get flags that describe the type of transformations this constraint applies to.
/// </summary>
public abstract TransformFlags ConstraintType { get; }

#endregion Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
namespace Microsoft.MixedReality.Toolkit.UX
{
/// <summary>
/// A simple visuals script to provide a visual layer on top of
/// <see cref="PressableButton"/>.
/// A simple visuals script to provide a visual layer on top of a
/// <see cref="Microsoft.MixedReality.Toolkit.UX.PressableButton">PressableButton</see>.
/// </summary>
[RequireComponent(typeof(PressableButton))]
[ExecuteAlways]
Expand All @@ -17,23 +17,27 @@ public class BasicPressableButtonVisuals : MonoBehaviour
private PressableButton buttonState;

[SerializeField]
[Tooltip("The front plate object that will move with the button displacement.")]
private Transform movingVisuals;

/// <summary>
/// The "front plate" object that will move with the button displacement.
/// </summary>
public Transform MovingVisuals => movingVisuals;

protected void Awake()
private void Awake()
{
buttonState = GetComponent<PressableButton>();
}

protected void LateUpdate()
private void LateUpdate()
{
UpdateMovingVisualsPosition();
}

/// <summary>
/// Update the local position of the specified <see cref="MovingVisuals"/> transform.
/// </summary>
protected virtual void UpdateMovingVisualsPosition()
{
if (movingVisuals != null)
Expand Down
9 changes: 8 additions & 1 deletion com.microsoft.mrtk.uxcore/Button/PressableButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ public class PressableButton : StatefulInteractable
public bool SmoothSelectedness { get => smoothSelectedness; set => smoothSelectedness = value; }

/// <summary>
/// Enum for defining space of plane distances.
/// An enumeration defining the coordinate space of plane distances.
/// </summary>
public enum SpaceMode
{
/// <summary>
/// The world coordinate space system should be used.
// </summary>
World,

/// <summary>
/// The button's local coordinate space system should be used.
// </summary>
Local
}

Expand Down
11 changes: 6 additions & 5 deletions com.microsoft.mrtk.uxcore/Dialog/DialogEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ public abstract class BaseDialogEventArgs
}

/// <summary>
/// Button events emit these parameters. For subclassed dialogs
/// with custom buttons or other types of events, return
/// a <see cref="DialogButtonType.Other"/> with some additional
/// context in a subclassed <see cref="DialogButtonEventArgs" type.
/// Event arguments used when buttons in a <see cref="Microsoft.MixedReality.Toolkit.UX.IDialog">IDialog</see>
/// are clicked or activated.
/// </summary>
public class DialogButtonEventArgs : BaseDialogEventArgs
{
Expand All @@ -45,6 +43,10 @@ public class DialogButtonEventArgs : BaseDialogEventArgs
public string ButtonText { get; set; }
}

/// <summary>
/// Event arguments used a <see cref="Microsoft.MixedReality.Toolkit.UX.IDialog">IDialog</see>
/// is dismissed or closed.
/// </summary>
public class DialogDismissedEventArgs : BaseDialogEventArgs
{
/// <summary>
Expand All @@ -53,5 +55,4 @@ public class DialogDismissedEventArgs : BaseDialogEventArgs
/// </summary>
public DialogButtonEventArgs Choice { get; set; }
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@
namespace Microsoft.MixedReality.Toolkit.UX
{
/// <summary>
/// A simple proxy interactor which will select + hover things on our behalf, for canvas input.
/// A simple proxy interactor which will select and hover things on MRTK's behalf, for canvas input.
/// </summary>
[AddComponentMenu("MRTK/UX/Canvas Proxy Interactor")]
public class CanvasProxyInteractor : XRBaseInteractor, IProxyInteractor, IModeManagedInteractor
{
/// <summary>
/// The hash set containing a collection of valid interactable targets for this this interactor.
/// </summary>
protected HashSet<IXRInteractable> validTargets = new HashSet<IXRInteractable>();

/// <summary>
/// The last target selected using the <see cref="StartSelect"/> method. This value will
/// be cleared when <see cref="EndSelect"/> is called.
/// </summary>
protected IXRSelectInteractable manualSelectTarget;

// We set this flag whenever we're cancelling an interaction. This will suppress
Expand Down
11 changes: 9 additions & 2 deletions com.microsoft.mrtk.uxcore/LegacyDialog/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ namespace Microsoft.MixedReality.Toolkit.UX.Deprecated
/// <summary>
/// Abstract class that presents a Dialog object.
/// </summary>
[Obsolete("Legacy Dialog is deprecated. Please migrate to the new Dialog. See uxcore/LegacyDialog/README.md")]
/// <remarks>
/// The <see cref="Microsoft.MixedReality.Toolkit.UX.Deprecated.Dialog>Legacy Dialog</see> is deprecated. Please migrate to the
/// new <see cref="Microsoft.MixedReality.Toolkit.UX.Dialog">Dialog</see>. If you'd like to continue using the
/// <see cref="Microsoft.MixedReality.Toolkit.UX.Deprecated.Dialog">Legacy Dialog</see> implementation, it is recommend that the legacy code
/// be copied to the application's code base, and maintained independently by the application developer. Otherwise, it is strongly recommended
/// that the application be updated to use the new <see cref="Microsoft.MixedReality.Toolkit.UX.Dialog">Dialog</see> system.
/// </remarks>
[Obsolete("Legacy Dialog is deprecated. Please migrate to the new Dialog system.")]
public abstract class Dialog : MonoBehaviour
{
/// <summary>
/// The current state of the dialog.
/// </summary>
[Obsolete("Legacy Dialog is deprecated. Please migrate to the new Dialog. See uxcore/LegacyDialog/README.md")]
[Obsolete("Legacy Dialog is deprecated. Please migrate to the new Dialog system.")]
public DialogState State { get; protected set; } = DialogState.Uninitialized;

/// <summary>
Expand Down
Loading