Skip to content
Open
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
7 changes: 4 additions & 3 deletions org.mixedrealitytoolkit.core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

### Removed

* Removed ITrackedInteractor, as it was supporting an unused codepath and there are better ways to get this data (like querying the attach transform). [PR #1044](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1044)
* Removed FindObjectUtility, as it was a backwards-compatibility layer for pre-2021.3.18. Since our min version is now 2022.3, we can just call the API directly. [PR #1056](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1056)
* Removed `ITrackedInteractor`, as it was supporting an unused codepath and there are better ways to get this data (like querying the attach transform). [PR #1044](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1044)
* Removed `FindObjectUtility`, as it was a backwards-compatibility layer for pre-2021.3.18. Since our min version is now 2022.3, we can just call the API directly. [PR #1056](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1056)

### Deprecated

* Deprecated IHandedInteractor, as its info is now queryable directly from IXRInteractor's handedness property. [PR #1042](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1042)
* Deprecated `IHandedInteractor`, as its info is now queryable directly from `IXRInteractor`'s handedness property. [PR #1042](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1042)
* Deprecated `EnumFlagsAttribute` in favor of `Unity.XR.CoreUtils.GUI.FlagsPropertyAttribute`. [PR #1075](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1075)

## [4.0.0-development.pre.1] - 2024-07-09

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ namespace MixedReality.Toolkit
/// From https://answers.unity.com/questions/486694/default-editor-enum-as-flags-.html
/// </remarks>
[AttributeUsage(AttributeTargets.Field)]
[Obsolete("Use Unity.XR.CoreUtils.GUI.FlagsPropertyAttribute instead.")]
public sealed class EnumFlagsAttribute : PropertyAttribute
{
/// <summary>
/// Initializes a new instance of the <see cref="EnumFlagsAttribute"/> class.
/// </summary>
public EnumFlagsAttribute() { }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
// Copyright (c) Mixed Reality Toolkit Contributors
// Licensed under the BSD 3-Clause

using System;
using Unity.Profiling;
using Unity.XR.CoreUtils.GUI;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
using static MixedReality.Toolkit.SpatialManipulation.ObjectManipulator;
using System;

#if UNITY_EDITOR
using UnityEditor;
#endif

namespace MixedReality.Toolkit.SpatialManipulation
{
Expand Down Expand Up @@ -108,8 +105,7 @@ public bool OverrideBounds
}
}

[SerializeField]
[DrawIf("overrideBounds")]
[SerializeField, DrawIf("overrideBounds")]
[Tooltip("The bounds will be calculated from this object and this object only, instead of the entire hierarchy.")]
private Transform boundsOverride;

Expand Down Expand Up @@ -199,8 +195,7 @@ public bool ToggleHandlesOnClick
set => toggleHandlesOnClick = value;
}

[SerializeField]
[DrawIf("toggleHandlesOnClick")]
[SerializeField, DrawIf("toggleHandlesOnClick")]
[Tooltip("During a selection of the associated interactable, if the interactable is dragged/moved a smaller distance than this value, the handles will be activated/deactivated.")]
private float dragToggleThreshold = 0.02f;

Expand Down Expand Up @@ -262,8 +257,7 @@ public HandleType EnabledHandles
set => enabledHandles = value;
}

[EnumFlags]
[SerializeField]
[SerializeField, FlagsProperty]
[Tooltip("Specifies whether the rotate handles will rotate the object around its origin, or the center of its calculated bounds.")]
private RotateAnchorType rotateAnchor = RotateAnchorType.BoundsCenter;

Expand All @@ -282,8 +276,7 @@ public RotateAnchorType RotateAnchor
}
}

[EnumFlags]
[SerializeField]
[SerializeField, FlagsProperty]
[Tooltip("Specifies whether the scale handles will rotate the object around their opposing corner, or the center of its calculated bounds.")]
private ScaleAnchorType scaleAnchor = ScaleAnchorType.OppositeCorner;

Expand Down Expand Up @@ -336,8 +329,7 @@ public bool SmoothingActive
set => smoothingActive = value;
}

[SerializeField]
[DrawIf("smoothingActive")]
[SerializeField, DrawIf("smoothingActive")]
[Tooltip("Enter amount representing amount of smoothing to apply to the rotation. Smoothing of 0 means no smoothing. Max value means no change to value.")]
private float rotateLerpTime = 0.00001f;

Expand All @@ -350,8 +342,7 @@ public float RotateLerpTime
set => rotateLerpTime = value;
}

[SerializeField]
[DrawIf("smoothingActive")]
[SerializeField, DrawIf("smoothingActive")]
[Tooltip("Enter amount representing amount of smoothing to apply to the scale. Smoothing of 0 means no smoothing. Max value means no change to value.")]
private float scaleLerpTime = 0.00001f;

Expand All @@ -364,8 +355,7 @@ public float ScaleLerpTime
set => scaleLerpTime = value;
}

[SerializeField]
[DrawIf("smoothingActive")]
[SerializeField, DrawIf("smoothingActive")]
[Tooltip("Enter amount representing amount of smoothing to apply to the translation. " +
"Smoothing of 0 means no smoothing. Max value means no change to value.")]
private float translateLerpTime = 0.00001f;
Expand Down Expand Up @@ -395,8 +385,7 @@ public bool EnableConstraints
set => enableConstraints = value;
}

[SerializeField]
[DrawIf("enableConstraints")]
[SerializeField, DrawIf("enableConstraints")]
[Tooltip("Constraint manager slot to enable constraints when manipulating the object.")]
private ConstraintManager constraintsManager;
/// <summary>
Expand Down Expand Up @@ -439,7 +428,7 @@ public LogicType ManipulationLogicTypes
[Header("Events")]

[SerializeField]
SelectEnterEvent manipulationStarted = new SelectEnterEvent();
private SelectEnterEvent manipulationStarted = new SelectEnterEvent();

/// <summary>
/// Fired when manipulation on a handle begins.
Expand All @@ -451,7 +440,7 @@ public SelectEnterEvent ManipulationStarted
}

[SerializeField]
SelectExitEvent manipulationEnded = new SelectExitEvent();
private SelectExitEvent manipulationEnded = new SelectExitEvent();

/// <summary>
/// Fired when manipulation on a handle ends.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Mixed Reality Toolkit Contributors
// Licensed under the BSD 3-Clause

using Unity.XR.CoreUtils.GUI;
using UnityEngine;

namespace MixedReality.Toolkit.SpatialManipulation
Expand All @@ -17,8 +18,7 @@ public class MoveAxisConstraint : TransformConstraint
{
#region Properties

[SerializeField]
[EnumFlags]
[SerializeField, FlagsProperty]
[Tooltip("Constrain movement along an axis")]
private AxisFlags constraintOnMovement = 0;

Expand Down Expand Up @@ -103,4 +103,4 @@ public override void ApplyConstraint(ref MixedRealityTransform transform)

#endregion Public Methods
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Mixed Reality Toolkit Contributors
// Licensed under the BSD 3-Clause

using Unity.XR.CoreUtils.GUI;
using UnityEngine;

namespace MixedReality.Toolkit.SpatialManipulation
Expand All @@ -16,8 +17,7 @@ public class RotationAxisConstraint : TransformConstraint
{
#region Properties

[SerializeField]
[EnumFlags]
[SerializeField, FlagsProperty]
[Tooltip("Constrain rotation about an axis")]
private AxisFlags constraintOnRotation = 0;

Expand Down Expand Up @@ -78,4 +78,4 @@ public override void ApplyConstraint(ref MixedRealityTransform transform)

#endregion Public Methods
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Mixed Reality Toolkit Contributors
// Licensed under the BSD 3-Clause

using System;
using Unity.XR.CoreUtils.GUI;
using UnityEngine;

namespace MixedReality.Toolkit.SpatialManipulation
Expand All @@ -17,8 +17,7 @@ public abstract class TransformConstraint : MonoBehaviour
{
#region Properties

[SerializeField]
[EnumFlags]
[SerializeField, FlagsProperty]
[Tooltip("What type of manipulation this constraint applies to. Defaults to One Handed and Two Handed.")]
private ManipulationHandFlags handType = ManipulationHandFlags.OneHanded | ManipulationHandFlags.TwoHanded;

Expand All @@ -31,8 +30,7 @@ public ManipulationHandFlags HandType
set => handType = value;
}

[SerializeField]
[EnumFlags]
[SerializeField, FlagsProperty]
[Tooltip("What type of manipulation this constraint applies to. Defaults to Near and Far.")]
private ManipulationProximityFlags proximityType = ManipulationProximityFlags.Near | ManipulationProximityFlags.Far;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using Unity.Profiling;
using Unity.XR.CoreUtils.GUI;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.XR.Interaction.Toolkit;
Expand Down Expand Up @@ -69,7 +70,7 @@ public enum RotateAnchorType
/// This enumeration describing the type of behavior to apply when a
/// <see cref="ObjectManipulator"/> is released by a controller.
/// </summary>
[System.Flags]
[Flags]
public enum ReleaseBehaviorType
{
/// <summary>
Expand Down Expand Up @@ -135,8 +136,7 @@ public Transform HostTransform
}
}

[SerializeField]
[EnumFlags]
[SerializeField, FlagsProperty]
[Tooltip("What kinds of manipulation should be allowed?")]
private TransformFlags allowedManipulations = TransformFlags.Move | TransformFlags.Rotate | TransformFlags.Scale;

Expand Down Expand Up @@ -206,8 +206,7 @@ public bool ApplyTorque
set => applyTorque = value;
}

[SerializeField]
[Range(0.001f, 2.0f)]
[SerializeField, Range(0.001f, 2.0f)]
[Tooltip("The time scale at which a Rigidbody reacts to input movement defined as oscillation period of the dampened spring force.")]
private float springForceSoftness = 0.1f;

Expand All @@ -220,8 +219,7 @@ public float SpringForceSoftness
set => springForceSoftness = value;
}

[SerializeField]
[Range(0.001f, 2.0f)]
[SerializeField, Range(0.001f, 2.0f)]
[Tooltip("The time scale at which a Rigidbody reacts to input rotation defined as oscillation period of the dampened spring torque.")]
private float springTorqueSoftness = 0.1f;

Expand All @@ -234,9 +232,8 @@ public float SpringTorqueSoftness
set => springTorqueSoftness = value;
}

[SerializeField]
[Range(0, 2.0f)]
[Tooltip("The damping of the spring force&torque. A value of one corresponds to critical damping, lower values lead to under damping or oscillation.")]
[SerializeField, Range(0, 2.0f)]
[Tooltip("The damping of the spring force & torque. A value of one corresponds to critical damping, lower values lead to under damping or oscillation.")]
private float springDamping = 1.0f;

/// <summary>
Expand All @@ -248,8 +245,7 @@ public float SpringDamping
set => springDamping = value;
}

[SerializeField]
[Range(0, 10000f)]
[SerializeField, Range(0, 10000f)]
[Tooltip("The maximum acceleration applied by the spring force to avoid trembling when pushing a body against a static object.")]
private float springForceLimit = 100.0f;

Expand Down Expand Up @@ -288,8 +284,7 @@ public RotateAnchorType RotationAnchorFar
set => rotationAnchorFar = value;
}

[SerializeField]
[EnumFlags]
[SerializeField, FlagsProperty]
[Tooltip("Rigid body behavior of the dragged object when releasing it.")]
private ReleaseBehaviorType releaseBehavior = ReleaseBehaviorType.KeepVelocity | ReleaseBehaviorType.KeepAngularVelocity;

Expand Down Expand Up @@ -325,8 +320,7 @@ public SystemType TransformSmoothingLogicType
}
}

[FormerlySerializedAs("smoothingActive")]
[SerializeField]
[SerializeField, FormerlySerializedAs("smoothingActive")]
[Tooltip("Frame-rate independent smoothing for far interactions. Far smoothing is enabled by default.")]
private bool smoothingFar = true;

Expand Down Expand Up @@ -358,8 +352,7 @@ public bool SmoothingNear
set => smoothingNear = value;
}

[SerializeField]
[Range(0, 1)]
[SerializeField, Range(0, 1)]
[Tooltip("Enter amount representing amount of smoothing to apply to the movement. Smoothing of 0 means no smoothing. Max value means no change to value.")]
private float moveLerpTime = 0.001f;

Expand All @@ -372,8 +365,7 @@ public float MoveLerpTime
set => moveLerpTime = value;
}

[SerializeField]
[Range(0, 1)]
[SerializeField, Range(0, 1)]
[Tooltip("Enter amount representing amount of smoothing to apply to the rotation. Smoothing of 0 means no smoothing. Max value means no change to value.")]
private float rotateLerpTime = 0.001f;

Expand All @@ -386,8 +378,7 @@ public float RotateLerpTime
set => rotateLerpTime = value;
}

[SerializeField]
[Range(0, 1)]
[SerializeField, Range(0, 1)]
[Tooltip("Enter amount representing amount of smoothing to apply to the scale. Smoothing of 0 means no smoothing. Max value means no change to value.")]
private float scaleLerpTime = 0.001f;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the BSD 3-Clause

using Unity.Profiling;
using Unity.XR.CoreUtils.GUI;
using UnityEngine;
using UnityEngine.Serialization;

Expand Down Expand Up @@ -69,8 +70,7 @@ public Transform TargetToFace
set => targetToFace = value;
}

[SerializeField]
[EnumFlags]
[SerializeField, FlagsProperty]
[Tooltip("Rotation axes used when facing target.")]
private AxisFlags pivotAxis = AxisFlags.XAxis | AxisFlags.YAxis | AxisFlags.ZAxis;

Expand Down
Loading