Skip to content

Commit 8ea9681

Browse files
authored
Merge pull request #7055 from keveleigh/merge-stabilization
Merge stabilization -> dev
2 parents 261ef0c + 88bd07d commit 8ea9681

32 files changed

+226
-81
lines changed

Assets/MixedReality.Toolkit.Foundation.nuspec

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,30 @@
3434
<file src="..\Plugins\**\Microsoft.MixedReality.Toolkit.dll*" target="Plugins\" />
3535
<file src="..\Plugins\**\Microsoft.MixedReality.Toolkit.pdb*" target="Plugins\" />
3636
<file src="..\Plugins\**\Microsoft.MixedReality.Toolkit.Gltf.*" target="Plugins\" />
37-
<file src="..\..\Assets\MixedRealityToolkit\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit" />
37+
38+
<!-- The following line is commented out because of a path length issue in nuget for unity -->
39+
<!-- <file src="..\..\Assets\MixedRealityToolkit\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit" /> -->
40+
3841

3942
<!-- Assemblies and Sources that are built from the MixedRealityToolkit.Providers folder -->
4043
<file src="..\Plugins\**\Microsoft.MixedReality.Toolkit.Providers.*" target="Plugins\" />
41-
<file src="..\..\Assets\MixedRealityToolkit.Providers\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.Providers" />
4244

45+
<!-- The following line is commented out because of a path length issue in nuget for unity -->
46+
<!-- <file src="..\..\Assets\MixedRealityToolkit.Providers\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.Providers" /> -->
47+
4348
<!-- Assemblies and Sources that are built from the MixedRealityToolkit.SDK folder -->
4449
<file src="..\Plugins\**\Microsoft.MixedReality.Toolkit.SDK.*" target="Plugins\" />
4550
<file src="..\Plugins\**\Microsoft.MixedReality.Toolkit.SDK.Inspectors.*" target="Plugins\" />
46-
<file src="..\..\Assets\MixedRealityToolkit.SDK\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.SDK" />
47-
51+
52+
<!-- The following line is commented out because of a path length issue in nuget for unity -->
53+
<!-- <file src="..\..\Assets\MixedRealityToolkit.SDK\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.SDK" />-->
54+
4855
<!-- Assemblies and Sources that are built from the MixedRealityToolkit.Services folder -->
4956
<file src="..\Plugins\**\Microsoft.MixedReality.Toolkit.Services.*" target="Plugins\" />
50-
<file src="..\..\Assets\MixedRealityToolkit.Services\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.Services" />
5157

58+
<!-- The following line is commented out because of a path length issue in nuget for unity -->
59+
<!-- <file src="..\..\Assets\MixedRealityToolkit.Services\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.Services" /> -->
60+
5261
<!--
5362
link.xml is copied to the root location, so that it can catch IL2CPP
5463
bytecode stripping issues for all scripts included in this package.

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/Shared/WindowsMixedRealityUtilities.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
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-
#if (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
54
using System;
5+
6+
#if (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
67
using System.Runtime.InteropServices;
78
#if WINDOWS_UWP
89
using Windows.Perception.Spatial;
@@ -21,6 +22,15 @@ namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality
2122
{
2223
public static class WindowsMixedRealityUtilities
2324
{
25+
/// <summary>
26+
/// The provider that should be used for the corresponding utilities.
27+
/// </summary>
28+
/// <remarks>
29+
/// This is intended to be used to support both XR SDK and Unity's legacy XR pipeline, which provide
30+
/// different APIs to access these native objects.
31+
/// </remarks>
32+
public static IWindowsMixedRealityUtilitiesProvider UtilitiesProvider { get; set; } = null;
33+
2434
#if (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
2535
#if ENABLE_DOTNET
2636
[DllImport("DotNetNativeWorkaround.dll", EntryPoint = "MarshalIInspectable")]
@@ -51,8 +61,6 @@ private static SpatialCoordinateSystem GetSpatialCoordinateSystem(IntPtr nativeP
5161
}
5262
#endif //ENABLE_DOTNET
5363

54-
public static IWindowsMixedRealityUtilitiesProvider UtilitiesProvider { get; set; } = null;
55-
5664
/// <summary>
5765
/// Access the underlying native spatial coordinate system.
5866
/// </summary>
@@ -64,7 +72,7 @@ public static SpatialCoordinateSystem SpatialCoordinateSystem
6472
{
6573
get
6674
{
67-
if (spatialCoordinateSystem == null && UtilitiesProvider != null)
75+
if (spatialCoordinateSystem == null && UtilitiesProvider != null && UtilitiesProvider.ISpatialCoordinateSystemPtr != IntPtr.Zero)
6876
{
6977
#if ENABLE_DOTNET
7078
spatialCoordinateSystem = GetSpatialCoordinateSystem(UtilitiesProvider.ISpatialCoordinateSystemPtr);
@@ -89,7 +97,7 @@ public static HolographicFrame CurrentHolographicFrame
8997
{
9098
get
9199
{
92-
if (UtilitiesProvider == null)
100+
if (UtilitiesProvider == null || UtilitiesProvider.IHolographicFramePtr == IntPtr.Zero)
93101
{
94102
return null;
95103
}
@@ -107,13 +115,13 @@ public static HolographicFrame CurrentHolographicFrame
107115
private static SpatialCoordinateSystem spatialCoordinateSystem = null;
108116
#endif // (UNITY_WSA && DOTNETWINRT_PRESENT) || WINDOWS_UWP
109117

110-
[System.Obsolete("Use the System.Numerics.Vector3 extension method ToUnityVector3 instead.")]
118+
[Obsolete("Use the System.Numerics.Vector3 extension method ToUnityVector3 instead.")]
111119
public static UnityEngine.Vector3 SystemVector3ToUnity(System.Numerics.Vector3 vector)
112120
{
113121
return vector.ToUnityVector3();
114122
}
115123

116-
[System.Obsolete("Use the System.Numerics.Quaternion extension method ToUnityQuaternion instead.")]
124+
[Obsolete("Use the System.Numerics.Quaternion extension method ToUnityQuaternion instead.")]
117125
public static UnityEngine.Quaternion SystemQuaternionToUnity(System.Numerics.Quaternion quaternion)
118126
{
119127
return quaternion.ToUnityQuaternion();

Assets/MixedRealityToolkit.Tests/EditModeTests/Microsoft.MixedReality.Toolkit.Tests.EditModeTests.asmdef

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"Microsoft.MixedReality.Toolkit.Services.InputSystem",
1010
"Microsoft.MixedReality.Toolkit.Services.InputSimulation",
1111
"Microsoft.MixedReality.Toolkit.Services.SpatialAwarenessSystem",
12-
"Microsoft.MixedReality.Toolkit.Tests",
1312
"Microsoft.MixedReality.Toolkit.Examples",
1413
"Microsoft.MixedReality.Toolkit.Tools",
15-
"Microsoft.MixedReality.Toolkit.Providers.OpenVR"
14+
"Microsoft.MixedReality.Toolkit.Providers.OpenVR",
15+
"Microsoft.MixedReality.Toolkit.Tests.Utilities"
1616
],
1717
"optionalUnityReferences": [
1818
"TestAssemblies"

Assets/MixedRealityToolkit.Tests/MixedReality.Toolkit.Tests.nuspec

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,21 @@
1414
<releaseNotes>$releaseNotes$</releaseNotes>
1515
<tags>Unity MixedReality MixedRealityToolkit MRTK</tags>
1616
<dependencies>
17+
<dependency id="Microsoft.MixedReality.Toolkit.Tests.Utilities" version="$version$" />
1718
<dependency id="Microsoft.MixedReality.Toolkit.Foundation" version="$version$" />
1819
</dependencies>
1920
<contentFiles>
2021
<files include="any\any\.PkgSrc\**" buildAction="None" copyToOutput="false" />
2122
</contentFiles>
2223
</metadata>
2324
<files>
24-
<file src="**" exclude="*.nuspec;*.nuspec.meta;*.props;*.props.meta;*.targets;*.targets.meta" target="MRTK\" />
25+
<!-- Test Utilities is excluded because there is a separate utilities package -->
26+
<file src="**" exclude="*.nuspec;*.nuspec.meta;*.props;*.props.meta;*.targets;*.targets.meta;TestUtilities\**" target="MRTK\" />
2527

2628
<!-- Reuse MixedReality.Toolkit.targets, as the MSBuild logic is the same for all MRTK nuget packages. -->
2729
<file src="..\MixedRealityToolkit\MixedReality.Toolkit.targets" target="build\Microsoft.MixedReality.Toolkit.Tests.targets" />
2830

29-
<file src="..\..\Plugins\**\Microsoft.MixedReality.Toolkit.Tests.*" target="Plugins\" />
30-
<file src="..\..\..\Assets\MixedRealityToolkit.Tests\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.Tests" />
31+
<file src="..\..\Plugins\**\Microsoft.MixedReality.Toolkit.Tests.*" exclude="..\..\Plugins\**\Microsoft.MixedReality.Toolkit.Tests.Utilities*" target="Plugins\" />
32+
<file src="..\..\..\Assets\MixedRealityToolkit.Tests\**\*.cs" exclude="..\..\..\Assets\MixedRealityToolkit.Tests\TestUtilities\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.Tests" />
3133
</files>
3234
</package>

Assets/MixedRealityToolkit.Tests/PlayModeTests/Microsoft.MixedReality.Toolkit.Tests.PlayModeTests.asmdef

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"Microsoft.MixedReality.Toolkit.Services.InputSystem",
1010
"Microsoft.MixedReality.Toolkit.Services.InputSimulation",
1111
"Microsoft.MixedReality.Toolkit.Services.InputSimulation.Editor",
12-
"Microsoft.MixedReality.Toolkit.Tests",
1312
"Unity.TextMeshPro",
1413
"Microsoft.MixedReality.Toolkit.Async",
1514
"Microsoft.MixedReality.Toolkit.Services.SpatialAwarenessSystem",
16-
"Microsoft.MixedReality.Toolkit.Providers.ObjectMeshObserver"
15+
"Microsoft.MixedReality.Toolkit.Providers.ObjectMeshObserver",
16+
"Microsoft.MixedReality.Toolkit.Tests.Utilities"
1717
],
1818
"optionalUnityReferences": [
1919
"TestAssemblies"

Assets/MixedRealityToolkit.Tests/TestUtilities.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MixedRealityToolkit.Tests/Microsoft.MixedReality.Toolkit.Tests.asmdef renamed to Assets/MixedRealityToolkit.Tests/TestUtilities/Microsoft.MixedReality.Toolkit.Tests.Utilities.asmdef

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
2-
"name": "Microsoft.MixedReality.Toolkit.Tests",
2+
"name": "Microsoft.MixedReality.Toolkit.Tests.Utilities",
33
"references": [
44
"Microsoft.MixedReality.Toolkit",
5+
"Microsoft.MixedReality.Toolkit.Async",
56
"Microsoft.MixedReality.Toolkit.Editor.ClassExtensions",
6-
"Microsoft.MixedReality.Toolkit.SDK",
7+
"Microsoft.MixedReality.Toolkit.Editor.Utilities",
78
"Microsoft.MixedReality.Toolkit.Services.InputSimulation",
8-
"Microsoft.MixedReality.Toolkit.Editor.Utilities"
9+
"Microsoft.MixedReality.Toolkit.Services.InputSimulation.Editor",
10+
"Microsoft.MixedReality.Toolkit.Services.InputSystem",
11+
"Microsoft.MixedReality.Toolkit.Services.DiagnosticsSystem"
912
],
1013
"optionalUnityReferences": [
1114
"TestAssemblies"

Assets/MixedRealityToolkit.Tests/Microsoft.MixedReality.Toolkit.Tests.asmdef.meta renamed to Assets/MixedRealityToolkit.Tests/TestUtilities/Microsoft.MixedReality.Toolkit.Tests.Utilities.asmdef.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
2+
<package >
3+
<metadata>
4+
<id>Microsoft.MixedReality.Toolkit.Tests.Utilities</id>
5+
<version>$version$</version>
6+
<authors>Microsoft</authors>
7+
<owners>Microsoft,MixedReality</owners>
8+
<licenseUrl>https://github.com/Microsoft/MixedRealityToolkit-Unity/blob/mrtk_development/License.txt</licenseUrl>
9+
<projectUrl>https://aka.ms/MRTK</projectUrl>
10+
<iconUrl>https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/Images/MRTK_Logo_NuGet.png</iconUrl>
11+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
12+
<description>Test Utilities for the Mixed Reality Toolkit.</description>
13+
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
14+
<releaseNotes>$releaseNotes$</releaseNotes>
15+
<tags>Unity MixedReality MixedRealityToolkit MRTK</tags>
16+
<dependencies>
17+
<dependency id="Microsoft.MixedReality.Toolkit.Foundation" version="$version$" />
18+
</dependencies>
19+
<contentFiles>
20+
<files include="any\any\.PkgSrc\**" buildAction="None" copyToOutput="false" />
21+
</contentFiles>
22+
</metadata>
23+
<files>
24+
<!-- Keep the following line to include extra files-->
25+
<file src="**" exclude="*.nuspec;*.nuspec.meta;*.props;*.props.meta;*.targets;*.targets.meta" target="MRTK\" />
26+
27+
<!-- Reuse MixedReality.Toolkit.targets, as the MSBuild logic is the same for all MRTK nuget packages. -->
28+
<file src="..\..\MixedRealityToolkit\MixedReality.Toolkit.targets" target="build\Microsoft.MixedReality.Toolkit.Tests.Utilities.targets" />
29+
30+
<file src="..\..\..\Plugins\**\Microsoft.MixedReality.Toolkit.Tests.Utilities*" target="Plugins\" />
31+
<file src="..\..\..\..\Assets\MixedRealityToolkit.Tests\TestUtilities\**\*.cs" target="contentFiles\any\any\.PkgSrc\MRTK\MixedRealityToolkit.Tests\TestUtilities" />
32+
</files>
33+
</package>

Assets/MixedRealityToolkit.Tests/TestUtilities/MixedReality.Toolkit.Tests.Utilities.nuspec.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)