Skip to content

Commit 0e26858

Browse files
committed
Merge branch 'mrtk_development_hl2' of https://github.com/Microsoft/MixedRealityToolkit-Unity into user/john/mrtk_development_hl2_panzoom
2 parents c927ecf + c29dc21 commit 0e26858

File tree

8 files changed

+603
-413
lines changed

8 files changed

+603
-413
lines changed

Assets/MixedRealityToolkit.SDK/Features/UX/Prefabs/AppBar/AppBar.prefab

Lines changed: 533 additions & 323 deletions
Large diffs are not rendered by default.

Assets/MixedRealityToolkit.SDK/Profiles/DefaultMixedRealityControllerMappingProfile.asset

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2658,9 +2658,9 @@ MonoBehaviour:
26582658
axisType: 2
26592659
inputType: 25
26602660
inputAction:
2661-
id: 0
2662-
description: None
2663-
axisConstraint: 0
2661+
id: 1
2662+
description: Select
2663+
axisConstraint: 2
26642664
keyCode: 0
26652665
axisCodeX:
26662666
axisCodeY:
@@ -2671,9 +2671,9 @@ MonoBehaviour:
26712671
axisType: 7
26722672
inputType: 14
26732673
inputAction:
2674-
id: 0
2675-
description: None
2676-
axisConstraint: 0
2674+
id: 3
2675+
description: Grip Pose
2676+
axisConstraint: 7
26772677
keyCode: 0
26782678
axisCodeX:
26792679
axisCodeY:
@@ -2688,9 +2688,9 @@ MonoBehaviour:
26882688
axisType: 2
26892689
inputType: 25
26902690
inputAction:
2691-
id: 0
2692-
description: None
2693-
axisConstraint: 0
2691+
id: 1
2692+
description: Select
2693+
axisConstraint: 2
26942694
keyCode: 0
26952695
axisCodeX:
26962696
axisCodeY:
@@ -2701,9 +2701,9 @@ MonoBehaviour:
27012701
axisType: 7
27022702
inputType: 14
27032703
inputAction:
2704-
id: 0
2705-
description: None
2706-
axisConstraint: 0
2704+
id: 3
2705+
description: Grip Pose
2706+
axisConstraint: 7
27072707
keyCode: 0
27082708
axisCodeX:
27092709
axisCodeY:
@@ -3230,6 +3230,6 @@ MonoBehaviour:
32303230
axisConstraint: 7
32313231
keyCode: 0
32323232
axisCodeX:
3233-
axisCodeY:
3233+
axisCodeY:
32343234
invertXAxis: 0
3235-
invertYAxis: 0
3235+
invertYAxis: 0

Assets/MixedRealityToolkit/Definitions/Physics/RayStep.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ public static Vector3 GetPointByDistance(RayStep[] steps, float distance)
137137
Debug.Assert(steps != null);
138138
Debug.Assert(steps.Length > 0);
139139

140-
var (rayStep, remainingDistance) = GetStepByDistance(steps, distance);
140+
float remainingDistance = 0;
141+
RayStep rayStep = GetStepByDistance(steps, distance, ref remainingDistance);
141142
if (remainingDistance > 0)
142143
{
143144
return Vector3.Lerp(rayStep.Origin, rayStep.Terminus, remainingDistance / rayStep.Length);
@@ -154,7 +155,7 @@ public static Vector3 GetPointByDistance(RayStep[] steps, float distance)
154155
/// <param name="steps"></param>
155156
/// <param name="distance"></param>
156157
/// <returns></returns>
157-
public static (RayStep rayStep, float traveledDistance) GetStepByDistance(RayStep[] steps, float distance)
158+
public static RayStep GetStepByDistance(RayStep[] steps, float distance, ref float traveledDistance)
158159
{
159160
Debug.Assert(steps != null);
160161
Debug.Assert(steps.Length > 0);
@@ -174,11 +175,13 @@ public static (RayStep rayStep, float traveledDistance) GetStepByDistance(RaySte
174175
}
175176
else
176177
{
177-
return (steps[i], remainingDistance);
178+
traveledDistance = remainingDistance;
179+
return steps[i];
178180
}
179181
}
180182

181-
return (steps[steps.Length - 1], remainingDistance);
183+
traveledDistance = remainingDistance;
184+
return steps[steps.Length - 1];
182185
}
183186

184187
/// <summary>
@@ -192,7 +195,8 @@ public static Vector3 GetDirectionByDistance(RayStep[] steps, float distance)
192195
Debug.Assert(steps != null);
193196
Debug.Assert(steps.Length > 0);
194197

195-
return GetStepByDistance(steps, distance).rayStep.Direction;
198+
float traveledDistance = 0;
199+
return GetStepByDistance(steps, distance, ref traveledDistance).Direction;
196200
}
197201

198202
#endregion

Assets/MixedRealityToolkit/Utilities/BuildAndDeploy/UnityPlayerBuildTools.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using Microsoft.MixedReality.Toolkit.Utilities.Editor;
55
using System;
6+
using System.Collections.Generic;
67
using System.Diagnostics;
78
using System.IO;
89
using System.Linq;
@@ -216,8 +217,19 @@ public static void ParseBuildCommandLine(ref IBuildInfo buildInfo)
216217
case "-autoIncrement":
217218
buildInfo.AutoIncrement = true;
218219
break;
219-
case "-scenes":
220-
// TODO parse json scene list and set them.
220+
case "-sceneList":
221+
buildInfo.Scenes = buildInfo.Scenes.Union(SplitSceneList(arguments[++i]));
222+
break;
223+
case "-sceneListFile":
224+
string path = arguments[++i];
225+
if (File.Exists(path))
226+
{
227+
buildInfo.Scenes = buildInfo.Scenes.Union(SplitSceneList(File.ReadAllText(path)));
228+
}
229+
else
230+
{
231+
Debug.LogWarning($"Scene list file at '{path}' does not exist.");
232+
}
221233
break;
222234
case "-buildOutput":
223235
buildInfo.OutputDirectory = arguments[++i];
@@ -242,6 +254,12 @@ public static void ParseBuildCommandLine(ref IBuildInfo buildInfo)
242254
}
243255
}
244256

257+
private static IEnumerable<string> SplitSceneList(string sceneList)
258+
{
259+
return from scene in sceneList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
260+
select scene.Trim();
261+
}
262+
245263
/// <summary>
246264
/// Restores any nuget packages at the path specified.
247265
/// </summary>

Assets/MixedRealityToolkit/Utilities/CameraCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static Camera Main
2020
{
2121
get
2222
{
23-
var mainCamera = cachedCamera ?? Refresh(Camera.main);
23+
var mainCamera = cachedCamera == null ? Refresh(Camera.main) : cachedCamera;
2424

2525
if (mainCamera == null)
2626
{

Assets/MixedRealityToolkit/Utilities/InspectorFields/InspectorGenericFields.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public static void LoadSettings(T target, List<InspectorPropertySetting> setting
2323
{
2424
Type myType = target.GetType();
2525

26-
PropertyInfo[] propInfoList = myType.GetProperties();
27-
for (int i = 0; i < propInfoList.Length; i++)
26+
List<PropertyInfo> propInfoList = new List<PropertyInfo>(myType.GetProperties());
27+
for (int i = 0; i < propInfoList.Count; i++)
2828
{
2929
PropertyInfo propInfo = propInfoList[i];
3030
var attrs = (InspectorField[])propInfo.GetCustomAttributes(typeof(InspectorField), false);
@@ -35,8 +35,8 @@ public static void LoadSettings(T target, List<InspectorPropertySetting> setting
3535
}
3636
}
3737

38-
FieldInfo[] fieldInfoList = myType.GetFields();
39-
for (int i = 0; i < fieldInfoList.Length; i++)
38+
List<FieldInfo> fieldInfoList = new List<FieldInfo>(myType.GetFields());
39+
for (int i = 0; i < fieldInfoList.Count; i++)
4040
{
4141
FieldInfo fieldInfo = fieldInfoList[i];
4242
var attrs = (InspectorField[])fieldInfo.GetCustomAttributes(typeof(InspectorField), false);
@@ -59,8 +59,8 @@ public static List<InspectorPropertySetting> GetSettings(T source)
5959
Type myType = source.GetType();
6060
List<InspectorPropertySetting> settings = new List<InspectorPropertySetting>();
6161

62-
PropertyInfo[] propInfoList = myType.GetProperties();
63-
for (int i = 0; i < propInfoList.Length; i++)
62+
List<PropertyInfo> propInfoList = new List<PropertyInfo>(myType.GetProperties());
63+
for (int i = 0; i < propInfoList.Count; i++)
6464
{
6565
PropertyInfo propInfo = propInfoList[i];
6666
var attrs = (InspectorField[])propInfo.GetCustomAttributes(typeof(InspectorField), false);
@@ -70,8 +70,8 @@ public static List<InspectorPropertySetting> GetSettings(T source)
7070
}
7171
}
7272

73-
FieldInfo[] fieldInfoList = myType.GetFields();
74-
for (int i = 0; i < fieldInfoList.Length; i++)
73+
List<FieldInfo> fieldInfoList = new List<FieldInfo>(myType.GetFields());
74+
for (int i = 0; i < fieldInfoList.Count; i++)
7575
{
7676
FieldInfo fieldInfo = fieldInfoList[i];
7777
var attrs = (InspectorField[])fieldInfo.GetCustomAttributes(typeof(InspectorField), false);

ProjectSettings/EditorBuildSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ EditorBuildSettings:
77
m_Scenes:
88
- enabled: 1
99
path: Assets/MixedRealityToolkit.Examples/Demos/HandTracking/Scenes/HandInteractionExamples.unity
10-
guid: c224faf6723e0bf44b87f7a7719fcfc4
10+
guid: 3dd4a396b5225f8469b9a1eb608bfa57
1111
m_configObjects: {}

README.md

Lines changed: 17 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@
22

33
# What is MixedRealityToolkit
44

5-
MRTK is a Microsoft Driven opensource project.
6-
7-
MRTK-Unity provides a set of foundational components and features to accelerate MR app development in Unity. Latest Release of MRTK (V2) supports HoloLens/HoloLens 2, WMR, and OpenVR platform. Start your project with MRTK, and
8-
9-
# What's MRTK-Unity good for
10-
11-
* Provide basic features as an easy to use SDK to reduce the barrier-to-entry to get started.
12-
13-
* Enable rapid prototyping by providing the basic building blocks for MR app development.
14-
15-
* Showcase best practices in MR with UI controls and interactions that matches the WMR and HoloLens Shell.
16-
17-
* Support a wide audience, allowing solutions to be built that will run on multiple VR / AR / XR platforms such as Mixed Reality, Steam/Open VR.
18-
19-
* Ensure an extensive framework for advanced integrators, with the ability to swap out core components with their own should they wish to, or simply extend the framework to add new capabilities.
5+
MRTK is a Microsoft Driven open source project. MRTK-Unity...
6+
* Provides the **basic building blocks for unity development on HoloLens, Windows Mixed Reality, and OpenVR**.
7+
* Showcases UX best practices with **UI controls that match Windows Mixed Reality and HoloLens Shell**.
8+
* **Enables rapid prototyping** via in-editor simulation that allows you to see changes immediately.
9+
* **Supports a wide range of platforms**, including
10+
* Microsoft HoloLens
11+
* Microsoft HoloLens 2
12+
* Microsoft Immersive headsets (IHMD)
13+
* Windows Mixed Reality headsets
14+
* OpenVR headsets (HTC Vive / Oculus Rift)
15+
16+
* Is **extensible**. Provides devs ability to swap out core components and extend the framework.
2017

2118
# Build Status
2219

@@ -29,58 +26,19 @@ MRTK-Unity provides a set of foundational components and features to accelerate
2926
| :--- | :--- | :--- | :--- |
3027
| To develop apps for mixed reality headsets, you need the Windows 10 Fall Creators Update | The Unity 3D engine provides support for building mixed reality projects in Windows 10 | Visual Studio is used for code editing, deploying and building UWP app packages | The Emulators allow you test your app without the device in a simulated environment |
3128

32-
33-
# Supported Platform
34-
35-
The Mixed Reality Toolkit V2 will includes many APIs to accelerate the development of MR / XR / VR / AR projects for a range of supported devices, starting with
36-
37-
- Microsoft HoloLens
38-
- Microsoft HoloLens 2
39-
- Microsoft Immersive headsets (IHMD)
40-
- OpenVR (HTC Vive / Oculus Rift)
41-
42-
# Feature areas
43-
44-
* Input System
45-
46-
* Articulated Hands + Gestures (HoloLens 2)
47-
48-
* Eye Tracking (HoloLens2)
49-
50-
* Voice Commanding
51-
52-
* Gaze + Select (HoloLens)
53-
54-
* Controller Visualization
55-
56-
* Teleportation
57-
58-
* UI Controls
59-
60-
* Solver and Interactions
61-
62-
* Spatial Understanding
63-
64-
* Diagnostic Tool
65-
66-
6729
# Getting Started with MRTK
30+
1. [Download MRTK](Documentation/DownloadingTheMRTK.md)
31+
2. Follow this [Getting Started Guide](Documentation/GettingStartedWithTheMRTK.md)
32+
3. Check out [Mixed Reality Toolkit configuration guide](Documentation/MixedRealityConfigurationGuide.md)
6833

69-
You can find out how to use MRTK to develop for Windows Mixed Reality on the MS Developer Site.
70-
71-
The Mixed Reality team have prepared a few guides for getting up to speed on using the new Mixed Reality Toolkit, which can be found here:
72-
73-
* [Downloading the Mixed Reality Toolkit](Documentation/DownloadingTheMRTK.md)
74-
* [Getting Started with the Mixed Reality Toolkit](Documentation/GettingStartedWithTheMRTK.md)
75-
* [Mixed Reality Toolkit configuration guide](Documentation/MixedRealityConfigurationGuide.md)
76-
34+
### More documentation
7735
Find this readme, other documentation articles and the MRTK api reference on our [MRTK Dev Portal on github.io](https://microsoft.github.io/MixedRealityToolkit-Unity/).
7836

7937
# Engage with the Community
8038

8139
Join the conversation around MRTK on [Slack](https://holodevelopers.slack.com/).
8240

83-
Ask questions about using MRRTK on [Stack Overflow](https://stackoverflow.com/questions/tagged/mrtk).
41+
Ask questions about using MRTK on [Stack Overflow](https://stackoverflow.com/questions/tagged/mrtk) using the **MRTK** tag.
8442

8543
Search for solution or file a new issue in [GitHub](https://github.com/Microsoft/MixedRealityToolkit-Unity/issues) if you find something broken in MRTK code.
8644

0 commit comments

Comments
 (0)