Skip to content

Commit 7c3bafb

Browse files
author
David Kline
authored
Merge pull request #2873 from davidkline-ms/feature/mrtk_spatialAwareness
merge mrtk_development -> feature/mrtk_spatialAwareness
2 parents 597746a + dbf5e99 commit 7c3bafb

17 files changed

+42
-29
lines changed

Assets/MixedRealityToolkit-SDK/Features/Diagnostics/DiagnosticsHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
using Microsoft.MixedReality.Toolkit.Core.EventDatum.Boundary;
4+
using Microsoft.MixedReality.Toolkit.Core.EventDatum.Diagnostics;
55
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Diagnostics;
66
using System;
77
using System.Text;

Assets/MixedRealityToolkit-SDK/Features/Diagnostics/MixedRealityDiagnosticsManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Microsoft.MixedReality.Toolkit.Core.Definitions.Diagnostics;
2-
using Microsoft.MixedReality.Toolkit.Core.EventDatum.Boundary;
2+
using Microsoft.MixedReality.Toolkit.Core.EventDatum.Diagnostics;
33
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Diagnostics;
44
using Microsoft.MixedReality.Toolkit.Core.Managers;
55
using Microsoft.MixedReality.Toolkit.Core.Utilities;
@@ -8,7 +8,7 @@
88

99
namespace Microsoft.MixedReality.Toolkit.SDK.DiagnosticsSystem
1010
{
11-
public class MixedRealityDiagnosticsManager : MixedRealityEventManager, IMixedRealityDiagnosticsManager
11+
public class MixedRealityDiagnosticsManager : MixedRealityEventManager, IMixedRealityDiagnosticsSystem
1212
{
1313
#region IMixedRealityManager
1414
private DiagnosticsEventData eventData;
@@ -83,7 +83,7 @@ private void RaiseDiagnosticsChanged()
8383
}
8484

8585
/// <summary>
86-
/// Event sent whenever the boundary visualization changes.
86+
/// Event sent whenever the diagnostics visualization changes.
8787
/// </summary>
8888
private static readonly ExecuteEvents.EventFunction<IMixedRealityDiagnosticsHandler> OnDiagnosticsChanged =
8989
delegate (IMixedRealityDiagnosticsHandler handler, BaseEventData eventData)

Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Pointers/BaseControllerPointer.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,8 @@ protected override async void Start()
144144
MixedRealityManager.TeleportSystem.Register(gameObject);
145145
}
146146

147-
if (MixedRealityManager.InputSystem == null)
148-
{
149-
await WaitUntilInputSystemValid;
150-
SetCursor();
151-
}
147+
await WaitUntilInputSystemValid;
148+
SetCursor();
152149
}
153150

154151
protected override void OnDisable()
@@ -311,10 +308,14 @@ public virtual bool TryGetPointingRay(out Ray pointingRay)
311308
{
312309
Vector3 pointerPosition;
313310
TryGetPointerPosition(out pointerPosition);
314-
pointingRay = new Ray(pointerPosition, PointerDirection);
311+
pointingRay = pointerRay;
312+
pointingRay.origin = pointerPosition;
313+
pointingRay.direction = PointerDirection;
315314
return true;
316315
}
317316

317+
private readonly Ray pointerRay = new Ray();
318+
318319
/// <inheritdoc />
319320
public virtual bool TryGetPointerRotation(out Quaternion rotation)
320321
{

Assets/MixedRealityToolkit-SDK/Features/UX/Scripts/Pointers/MousePointer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public override void OnSourcePoseChanged(SourcePoseEventData<Vector2> eventData)
7878
/// <inheritdoc />
7979
public override void OnPositionInputChanged(InputEventData<Vector2> eventData)
8080
{
81-
8281
if (eventData.SourceId == Controller?.InputSource.SourceId)
8382
{
8483
if (!UseSourcePoseData &&

Assets/MixedRealityToolkit-SDK/Profiles/DefaultMixedRealityDiagnosticsProfile.asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ MonoBehaviour:
1111
m_Script: {fileID: 11500000, guid: 8c2d00f2d26cc124caed106ffbfe3f06, type: 3}
1212
m_Name: DefaultMixedRealityDiagnosticsProfile
1313
m_EditorClassIdentifier:
14+
isCustomProfile: 0
1415
showFps: 1
1516
showCpu: 1
1617
showMemory: 1

Assets/MixedRealityToolkit/_Core/Definitions/Diagnostics/MixedRealityDiagnosticsProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.MixedReality.Toolkit.Core.Definitions.Diagnostics
1010
/// Configuration profile settings for setting up diagnostics.
1111
/// </summary>
1212
[CreateAssetMenu(menuName = "Mixed Reality Toolkit/Mixed Reality Diagnostics Profile", fileName = "MixedRealityDiagnosticsProfile", order = (int)CreateProfileMenuItemIndices.Diagnostics)]
13-
public class MixedRealityDiagnosticsProfile : ScriptableObject
13+
public class MixedRealityDiagnosticsProfile : BaseMixedRealityProfile
1414
{
1515
[SerializeField]
1616
[Tooltip("Should show fps?")]

Assets/MixedRealityToolkit/_Core/Definitions/MixedRealityConfigurationProfile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public bool IsDiagnosticsSystemEnabled
259259

260260
[SerializeField]
261261
[Tooltip("Diagnostics System Class to instantiate at runtime.")]
262-
[Implements(typeof(IMixedRealityDiagnosticsManager), TypeGrouping.ByNamespaceFlat)]
262+
[Implements(typeof(IMixedRealityDiagnosticsSystem), TypeGrouping.ByNamespaceFlat)]
263263
private SystemType diagnosticsSystemType;
264264

265265
/// <summary>

Assets/MixedRealityToolkit/_Core/Devices/UnityInput/MouseController.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,11 @@ public void Update()
6767
return;
6868
}
6969

70-
controllerPose.Position = InputSource.Pointers[0].BaseCursor.Position;
71-
controllerPose.Rotation = InputSource.Pointers[0].BaseCursor.Rotation;
70+
if (InputSource.Pointers[0].BaseCursor != null)
71+
{
72+
controllerPose.Position = InputSource.Pointers[0].BaseCursor.Position;
73+
controllerPose.Rotation = InputSource.Pointers[0].BaseCursor.Rotation;
74+
}
7275

7376
// Don't ask me why it's mapped weird. Bc Unity...
7477
mouseDelta.x = Input.GetAxis("Mouse X");

Assets/MixedRealityToolkit/_Core/Devices/UnityInput/MouseDeviceManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public override void Enable()
2929
return;
3030
}
3131

32+
#if UNITY_EDITOR
33+
UnityEditor.EditorWindow.focusedWindow.ShowNotification(new GUIContent("Press \"ESC\" to regain mouse control"));
34+
#endif
35+
3236
Cursor.visible = false;
3337
Cursor.lockState = CursorLockMode.Locked;
3438

Assets/MixedRealityToolkit/_Core/EventDatum/Diagnostics/DiagnosticsEventData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using Microsoft.MixedReality.Toolkit.Core.Interfaces.Diagnostics;
66
using UnityEngine.EventSystems;
77

8-
namespace Microsoft.MixedReality.Toolkit.Core.EventDatum.Boundary
8+
namespace Microsoft.MixedReality.Toolkit.Core.EventDatum.Diagnostics
99
{
1010
public class DiagnosticsEventData : GenericBaseEventData
1111
{
@@ -17,7 +17,7 @@ public class DiagnosticsEventData : GenericBaseEventData
1717
public DiagnosticsEventData(EventSystem eventSystem) : base(eventSystem) { }
1818

1919
public void Initialize(
20-
IMixedRealityDiagnosticsManager diagnosticsSystem,
20+
IMixedRealityDiagnosticsSystem diagnosticsSystem,
2121
bool visible,
2222
bool showCpu,
2323
bool showFps,

0 commit comments

Comments
 (0)