Skip to content

Commit 8663edc

Browse files
committed
Merge branch 'mrtk_development' into users/trferrel/profile-inspector-reduce
# Conflicts: # Assets/MixedRealityToolkit/Inspectors/Utilities/MixedRealityInspectorUtility.cs
2 parents da762ac + 99b9d02 commit 8663edc

File tree

104 files changed

+574
-555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+574
-555
lines changed

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Scenes/EyeTrackingDemo-03-Navigation.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10209,7 +10209,7 @@ MonoBehaviour:
1020910209
m_OnCullStateChanged:
1021010210
m_PersistentCalls:
1021110211
m_Calls: []
10212-
m_text: " ***\n<size=2.9><color=#78A2C8>https://www.microsoft.com/en-us/hololens/</color></size>\nThe
10212+
m_text: " ***\n<size=2.9><color=#78A2C8>https://www.microsoft.com/hololens/</color></size>\nThe
1021310213
<b>HoloLens</b> is a head-mounted display unit connected to an adjustable, cushioned
1021410214
inner headband, which can tilt HoloLens up and down, as well as forward and backward.
1021510215
To wear the unit, the user fits the HoloLens on their head, using an adjustment

Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Script/LaunchUri.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class LaunchUri : MonoBehaviour
1313
/// Launch a UWP slate app. In most cases, your experience can continue running while the
1414
/// launched app renders on top.
1515
/// </summary>
16-
/// <param name="uri">Url of the web page or app to launch. See https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-default-app
16+
/// <param name="uri">Url of the web page or app to launch. See https://docs.microsoft.com/windows/uwp/launch-resume/launch-default-app
1717
/// for more information about the protocols that can be used when launching apps.</param>
1818
public void Launch(string uri)
1919
{

Assets/MixedRealityToolkit.Providers/ObjectMeshObserver/SpatialObjectMeshObserverProfileInspector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public override void OnInspectorGUI()
7676
return;
7777
}
7878

79-
using (new GUIEnabledWrapper(!IsProfileLock((BaseMixedRealityProfile)target)))
79+
using (new EditorGUI.DisabledGroupScope(IsProfileLock((BaseMixedRealityProfile)target)))
8080
{
8181
serializedObject.Update();
8282

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/Definitions/HolographicFrameNativeData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality
99
/// <summary>
1010
/// A representation of Windows Mixed Reality native data, provided as an IntPtr from Unity's UnityEngine.XR.XRDevice.GetNativePtr().
1111
/// </summary>
12-
/// <remarks>See <see href="https://docs.microsoft.com/en-us/windows/mixed-reality/unity-xrdevice-advanced"/> for more info.</remarks>
12+
/// <remarks>See <see href="https://docs.microsoft.com/windows/mixed-reality/unity-xrdevice-advanced"/> for more info.</remarks>
1313
[StructLayout(LayoutKind.Sequential)]
1414
public struct HolographicFrameNativeData
1515
{

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/Editor/WindowsMixedRealityCameraSettingsProfileInspector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class WindowsMixedRealityCameraSettingsProfileInspector : BaseMixedRealit
2121
private readonly GUIContent pvCameraRenderingTitle = new GUIContent("Render from PV Camera (Align holograms)");
2222
private readonly GUIContent reprojectionMethodTitle = new GUIContent("HoloLens 2 Reprojection Method");
2323

24-
private const string MRCDocURL = "https://docs.microsoft.com/en-us/windows/mixed-reality/mixed-reality-capture-for-developers#render-from-the-pv-camera-opt-in";
25-
private const string DepthReprojectionDocURL = "https://docs.microsoft.com/en-us/windows/mixed-reality/hologram-stability#reprojection";
24+
private const string MRCDocURL = "https://docs.microsoft.com/windows/mixed-reality/mixed-reality-capture-for-developers#render-from-the-pv-camera-opt-in";
25+
private const string DepthReprojectionDocURL = "https://docs.microsoft.com/windows/mixed-reality/hologram-stability#reprojection";
2626

2727
protected override void OnEnable()
2828
{
@@ -36,7 +36,7 @@ public override void OnInspectorGUI()
3636
{
3737
RenderProfileHeader(ProfileTitle, ProfileDescription, target);
3838

39-
using (new GUIEnabledWrapper(!IsProfileLock((BaseMixedRealityProfile)target)))
39+
using (new EditorGUI.DisabledGroupScope(IsProfileLock((BaseMixedRealityProfile)target)))
4040
{
4141
serializedObject.Update();
4242

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityDeviceManager.cs

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,7 @@ public override void Enable()
379379
//NOTE: We update the source state data, in case an app wants to query it on source detected.
380380
for (var i = 0; i < numInteractionManagerStates; i++)
381381
{
382-
var controller = GetController(interactionManagerStates[i].source);
383-
384-
if (controller != null)
385-
{
386-
controller.UpdateController(interactionManagerStates[i]);
387-
Service?.RaiseSourceDetected(controller.InputSource, controller);
388-
}
382+
GetOrAddController(interactionManagerStates[i]);
389383
}
390384

391385
if (InputSystemProfile.GesturesProfile != null &&
@@ -395,6 +389,26 @@ public override void Enable()
395389
}
396390
}
397391

392+
private void GetOrAddController(InteractionSourceState interactionSourceState)
393+
{
394+
// If this is a new detected controller, raise source detected event with input system
395+
// check needs to be here because GetOrAddController adds it to the activeControllers Dictionary
396+
// this could be cleaned up because that's not clear
397+
bool raiseSourceDetected = !activeControllers.ContainsKey(interactionSourceState.source.id);
398+
399+
var controller = GetOrAddController(interactionSourceState.source);
400+
401+
if (controller != null)
402+
{
403+
if (raiseSourceDetected)
404+
{
405+
Service?.RaiseSourceDetected(controller.InputSource, controller);
406+
}
407+
408+
controller.UpdateController(interactionSourceState);
409+
}
410+
}
411+
398412
/// <inheritdoc/>
399413
public override void Update()
400414
{
@@ -406,7 +420,7 @@ public override void Update()
406420
{
407421
// SourceDetected gets raised when a new controller is detected and, if previously present,
408422
// when OnEnable is called. Do not create a new controller here.
409-
var controller = GetController(interactionManagerStates[i].source, false);
423+
var controller = GetOrAddController(interactionManagerStates[i].source, false);
410424

411425
if (controller != null)
412426
{
@@ -553,7 +567,7 @@ public override void Disable()
553567
/// <param name="interactionSource">Source State provided by the SDK</param>
554568
/// <param name="addController">Should the Source be added as a controller if it isn't found?</param>
555569
/// <returns>New or Existing Controller Input Source</returns>
556-
private BaseWindowsMixedRealitySource GetController(InteractionSource interactionSource, bool addController = true)
570+
private BaseWindowsMixedRealitySource GetOrAddController(InteractionSource interactionSource, bool addController = true)
557571
{
558572
//If a device is already registered with the ID provided, just return it.
559573
if (activeControllers.ContainsKey(interactionSource.id))
@@ -672,7 +686,7 @@ private BaseWindowsMixedRealitySource GetController(InteractionSource interactio
672686
/// <param name="interactionSourceState">Source State provided by the SDK to remove</param>
673687
private void RemoveController(InteractionSource interactionSource)
674688
{
675-
var controller = GetController(interactionSource, false);
689+
var controller = GetOrAddController(interactionSource, false);
676690

677691
if (controller != null)
678692
{
@@ -686,10 +700,12 @@ private void RemoveController(InteractionSource interactionSource)
686700
}
687701
}
688702

689-
if (controller.Visualizer != null &&
690-
controller.Visualizer.GameObjectProxy != null)
703+
var visualizer = controller.Visualizer;
704+
705+
if (visualizer != null && !visualizer.Equals(null) &&
706+
visualizer.GameObjectProxy != null)
691707
{
692-
controller.Visualizer.GameObjectProxy.SetActive(false);
708+
visualizer.GameObjectProxy.SetActive(false);
693709
}
694710
}
695711

@@ -704,19 +720,7 @@ private void RemoveController(InteractionSource interactionSource)
704720
/// SDK Interaction Source Detected Event handler
705721
/// </summary>
706722
/// <param name="args">SDK source detected event arguments</param>
707-
private void InteractionManager_InteractionSourceDetected(InteractionSourceDetectedEventArgs args)
708-
{
709-
bool raiseSourceDetected = !activeControllers.ContainsKey(args.state.source.id);
710-
711-
var controller = GetController(args.state.source);
712-
713-
if (controller != null && raiseSourceDetected)
714-
{
715-
Service?.RaiseSourceDetected(controller.InputSource, controller);
716-
}
717-
718-
controller?.UpdateController(args.state);
719-
}
723+
private void InteractionManager_InteractionSourceDetected(InteractionSourceDetectedEventArgs args) => GetOrAddController(args.state);
720724

721725
/// <summary>
722726
/// SDK Interaction Source Pressed Event handler. Used only for voice.
@@ -726,7 +730,7 @@ private void InteractionManager_InteractionSourcePressed(InteractionSourcePresse
726730
{
727731
if (args.state.source.kind == InteractionSourceKind.Voice)
728732
{
729-
var controller = GetController(args.state.source);
733+
var controller = GetOrAddController(args.state.source);
730734
if (controller != null)
731735
{
732736
controller.UpdateController(args.state);
@@ -747,7 +751,7 @@ private void InteractionManager_InteractionSourceReleased(InteractionSourceRelea
747751
{
748752
if (args.state.source.kind == InteractionSourceKind.Voice)
749753
{
750-
GetController(args.state.source)?.UpdateController(args.state);
754+
GetOrAddController(args.state.source)?.UpdateController(args.state);
751755
}
752756
}
753757

@@ -766,7 +770,7 @@ private void InteractionManager_InteractionSourceLost(InteractionSourceLostEvent
766770

767771
private void GestureRecognizer_HoldStarted(HoldStartedEventArgs args)
768772
{
769-
var controller = GetController(args.source, false);
773+
var controller = GetOrAddController(args.source, false);
770774
if (controller != null)
771775
{
772776
Service?.RaiseGestureStarted(controller, holdAction);
@@ -775,7 +779,7 @@ private void GestureRecognizer_HoldStarted(HoldStartedEventArgs args)
775779

776780
private void GestureRecognizer_HoldCompleted(HoldCompletedEventArgs args)
777781
{
778-
var controller = GetController(args.source, false);
782+
var controller = GetOrAddController(args.source, false);
779783
if (controller != null)
780784
{
781785
Service?.RaiseGestureCompleted(controller, holdAction);
@@ -784,7 +788,7 @@ private void GestureRecognizer_HoldCompleted(HoldCompletedEventArgs args)
784788

785789
private void GestureRecognizer_HoldCanceled(HoldCanceledEventArgs args)
786790
{
787-
var controller = GetController(args.source, false);
791+
var controller = GetOrAddController(args.source, false);
788792
if (controller != null)
789793
{
790794
Service?.RaiseGestureCanceled(controller, holdAction);
@@ -793,7 +797,7 @@ private void GestureRecognizer_HoldCanceled(HoldCanceledEventArgs args)
793797

794798
private void GestureRecognizer_ManipulationStarted(ManipulationStartedEventArgs args)
795799
{
796-
var controller = GetController(args.source, false);
800+
var controller = GetOrAddController(args.source, false);
797801
if (controller != null)
798802
{
799803
Service?.RaiseGestureStarted(controller, manipulationAction);
@@ -802,7 +806,7 @@ private void GestureRecognizer_ManipulationStarted(ManipulationStartedEventArgs
802806

803807
private void GestureRecognizer_ManipulationUpdated(ManipulationUpdatedEventArgs args)
804808
{
805-
var controller = GetController(args.source, false);
809+
var controller = GetOrAddController(args.source, false);
806810
if (controller != null)
807811
{
808812
Service?.RaiseGestureUpdated(controller, manipulationAction, args.cumulativeDelta);
@@ -811,7 +815,7 @@ private void GestureRecognizer_ManipulationUpdated(ManipulationUpdatedEventArgs
811815

812816
private void GestureRecognizer_ManipulationCompleted(ManipulationCompletedEventArgs args)
813817
{
814-
var controller = GetController(args.source, false);
818+
var controller = GetOrAddController(args.source, false);
815819
if (controller != null)
816820
{
817821
Service?.RaiseGestureCompleted(controller, manipulationAction, args.cumulativeDelta);
@@ -820,7 +824,7 @@ private void GestureRecognizer_ManipulationCompleted(ManipulationCompletedEventA
820824

821825
private void GestureRecognizer_ManipulationCanceled(ManipulationCanceledEventArgs args)
822826
{
823-
var controller = GetController(args.source, false);
827+
var controller = GetOrAddController(args.source, false);
824828
if (controller != null)
825829
{
826830
Service?.RaiseGestureCanceled(controller, manipulationAction);
@@ -829,7 +833,7 @@ private void GestureRecognizer_ManipulationCanceled(ManipulationCanceledEventArg
829833

830834
private void GestureRecognizer_Tapped(TappedEventArgs args)
831835
{
832-
var controller = GetController(args.source, false);
836+
var controller = GetOrAddController(args.source, false);
833837
if (controller != null)
834838
{
835839
Service?.RaiseGestureCompleted(controller, selectAction);
@@ -842,7 +846,7 @@ private void GestureRecognizer_Tapped(TappedEventArgs args)
842846

843847
private void NavigationGestureRecognizer_NavigationStarted(NavigationStartedEventArgs args)
844848
{
845-
var controller = GetController(args.source, false);
849+
var controller = GetOrAddController(args.source, false);
846850
if (controller != null)
847851
{
848852
Service?.RaiseGestureStarted(controller, navigationAction);
@@ -851,7 +855,7 @@ private void NavigationGestureRecognizer_NavigationStarted(NavigationStartedEven
851855

852856
private void NavigationGestureRecognizer_NavigationUpdated(NavigationUpdatedEventArgs args)
853857
{
854-
var controller = GetController(args.source, false);
858+
var controller = GetOrAddController(args.source, false);
855859
if (controller != null)
856860
{
857861
Service?.RaiseGestureUpdated(controller, navigationAction, args.normalizedOffset);
@@ -860,7 +864,7 @@ private void NavigationGestureRecognizer_NavigationUpdated(NavigationUpdatedEven
860864

861865
private void NavigationGestureRecognizer_NavigationCompleted(NavigationCompletedEventArgs args)
862866
{
863-
var controller = GetController(args.source, false);
867+
var controller = GetOrAddController(args.source, false);
864868
if (controller != null)
865869
{
866870
Service?.RaiseGestureCompleted(controller, navigationAction, args.normalizedOffset);
@@ -869,7 +873,7 @@ private void NavigationGestureRecognizer_NavigationCompleted(NavigationCompleted
869873

870874
private void NavigationGestureRecognizer_NavigationCanceled(NavigationCanceledEventArgs args)
871875
{
872-
var controller = GetController(args.source, false);
876+
var controller = GetOrAddController(args.source, false);
873877
if (controller != null)
874878
{
875879
Service?.RaiseGestureCanceled(controller, navigationAction);

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/WindowsMixedRealityUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static class WindowsMixedRealityUtilities
3434
/// On .NET Native, IInspectable pointers cannot be marshaled from native to managed code using Marshal.GetObjectForIUnknown.
3535
/// This class calls into a native method that specifically marshals the type as a specific WinRT interface, which
3636
/// is supported by the marshaller on both .NET Core and .NET Native.
37-
/// Please see https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/InputSystem/HandTracking.html#net-native for more info.
37+
/// Please see https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/Input/HandTracking.html#net-native for more info.
3838
/// </remarks>
3939
private static SpatialCoordinateSystem GetSpatialCoordinateSystem(IntPtr nativePtr)
4040
{

Assets/MixedRealityToolkit.SDK/Experimental/Features/Dwell/DwellHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Microsoft.MixedReality.Toolkit.Experimental.Dwell
99
{
1010
/// <summary>
11-
/// Use this component to add a Dwell modality (https://docs.microsoft.com/en-us/windows/mixed-reality/gaze-and-dwell) to the UI target.
11+
/// Use this component to add a Dwell modality (https://docs.microsoft.com/windows/mixed-reality/gaze-and-dwell) to the UI target.
1212
/// </summary>
1313
[AddComponentMenu("Scripts/MRTK/SDK/DwellHandler")]
1414
public class DwellHandler : MonoBehaviour, IMixedRealityFocusHandler

Assets/MixedRealityToolkit.SDK/Experimental/ScrollingObjectCollection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Simply drop these prefabs into a scene, add the desired objects, and press "Upda
1010
### Prerequisites
1111

1212
- All objects in collection must use the MRTK standard shader
13-
- Every object in the collection must have a collider with a <see cref="NearInteractionTouchable"/>. All collision testing is currently done using these collidables, ScrollingObjectCollection does not yet support a static/nonmoving backing collider.
13+
- Every object in the collection must have a collider with a [`NearInteractionTouchable`](xref:Microsoft.MixedReality.Toolkit.Input.NearInteractionTouchable). All collision testing is currently done using these collidables, ScrollingObjectCollection does not yet support a static/nonmoving backing collider.
1414
- All objects in collection need to be the same size currently, additionally you may get unexpected results if your objects aren't centered in a gameObject.
1515
- For a seamless touchable surface, the 'cell size' in the scrolling collection should match the size of every object in the collection.
1616

Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Controllers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The framework is flexible enough to allow you to provide offsets to rotate and r
1414

1515
Using the visualizer is extremely simple, just add it to an existing GameObject in your scene and provided you have configured your controller correctly, they will simply be instantiated into the scene at runtime when controllers are detected.
1616

17-
![](../../../../../../Documentation/Images/ControllerVisualizer/ControllerVisualizerInspector.png)
17+
![Controller visualizer inspector](../../../../../../Documentation/Images/ControllerVisualizer/ControllerVisualizerInspector.png)
1818

1919
Check the documentation on configuring Controller Profiles for more details:
2020

0 commit comments

Comments
 (0)