Skip to content

Commit d583334

Browse files
author
David Kline (ANALOG)
committed
complete profile, small interface changes
1 parent 12da165 commit d583334

17 files changed

+316
-168
lines changed

Assets/MixedRealityToolkit-SDK/Features/SpatialAwareness/System/MixedRealitySpatialAwarenessSystem.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,13 @@ public int MeshTrianglesPerCubicMeter
482482
public bool MeshRecalculateNormals { get; set; } = true;
483483

484484
/// <inheritdoc />
485-
public bool DisplayMeshes { get; set; } = false;
485+
public SpatialMeshDisplayOptions MeshDisplayOption { get; set; } = SpatialMeshDisplayOptions.None;
486486

487487
/// <inheritdoc />
488-
public Material MeshMaterial { get; set; } = null;
488+
public Material MeshVisibleMaterial { get; set; } = null;
489+
490+
/// <inheritdoc />
491+
public Material MeshOcclusionMaterial { get; set; } = null;
489492

490493
/// <inheritdoc />
491494
public Dictionary<uint, IMixedRealitySpatialAwarenessMeshDescription> GetMeshes()

Assets/MixedRealityToolkit-SDK/Profiles/DefaultMixedRealityConfigurationProfile.asset

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ MonoBehaviour:
1111
m_Script: {fileID: 11500000, guid: 7612acbc1a4a4ed0afa5f4ccbe42bee4, type: 3}
1212
m_Name: DefaultMixedRealityConfigurationProfile
1313
m_EditorClassIdentifier:
14-
initialManagerTypes:
15-
- reference: Microsoft.MixedReality.Toolkit.SDK.Input.MixedRealityInputManager,
16-
Microsoft.MixedReality.Toolkit.SDK
17-
- reference: Microsoft.MixedReality.Toolkit.SDK.BoundarySystem.MixedRealityBoundaryManager,
18-
Microsoft.MixedReality.Toolkit.SDK
14+
initialManagerTypes: []
1915
targetExperienceScale: 3
2016
enableCameraProfile: 1
2117
cameraProfile: {fileID: 11400000, guid: 8089ccfdd4494cd38f676f9fc1f46a04, type: 2}
@@ -53,5 +49,5 @@ MonoBehaviour:
5349
spatialAwarenessSystemType:
5450
reference: Microsoft.MixedReality.Toolkit.SDK.SpatialAwarenessSystem.MixedRealitySpatialAwarenessSystem,
5551
Microsoft.MixedReality.Toolkit.SDK
56-
spatialAwarenessProfile: {fileID: 11400000, guid: fe3d98567cf77744ba16af55bdec08ed,
52+
spatialAwarenessProfile: {fileID: 11400000, guid: 2a33d8426496c874ab1550069b7ccef8,
5753
type: 2}

Assets/MixedRealityToolkit-SDK/Profiles/DefaultMixedRealitySpatialAwarenessProfile.asset

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,21 @@ MonoBehaviour:
1919
meshLevelOfDetail: 0
2020
meshTrianglesPerCubicMeter: 0
2121
meshRecalculateNormals: 1
22-
displayMeshes: 0
22+
meshDisplayOption: 0
2323
meshMaterial: {fileID: 2100000, guid: a923a5d1aebc7fe449b4ab3289da537b, type: 2}
24+
meshOcclusionMaterial: {fileID: 2100000, guid: a809c7ea182b699409443d46d5b42435,
25+
type: 2}
26+
useSurfaceFindingSystem: 1
27+
surfaceFindingPhysicsLayer: 31
28+
surfaceFindingMinimumArea: 0.025
29+
displayFloorSurfaces: 0
30+
floorSurfaceMaterial: {fileID: 2100000, guid: 47f3c5e1cb6142ba9697cd4c86d74321,
31+
type: 2}
32+
displayCeilingSurfaces: 0
33+
ceilingSurfaceMaterial: {fileID: 2100000, guid: d5334c45caee46be937b095a1e977dc6,
34+
type: 2}
35+
displayWallSurfaces: 0
36+
wallSurfaceMaterial: {fileID: 2100000, guid: 3c55769e893c4f4c8c51b7fa69bee2b9, type: 2}
37+
displayPlatformSurfaces: 0
38+
platformSurfaceMaterial: {fileID: 2100000, guid: cb74390ea57642f8b5ca0aa8f5fb38c1,
39+
type: 2}

Assets/MixedRealityToolkit-SDK/Profiles/DefaultMixedRealitySpatialAwarenessProfile.asset.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.

Assets/MixedRealityToolkit-SDK/StandardAssets/Materials/MRTK_Occlusion.mat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Material:
77
m_PrefabParentObject: {fileID: 0}
88
m_PrefabInternal: {fileID: 0}
99
m_Name: MRTK_Occlusion
10-
m_Shader: {fileID: 4800000, guid: bece293ca0f6595439e878a63a5ec3bf, type: 3}
10+
m_Shader: {fileID: 15300, guid: 0000000000000000f000000000000000, type: 0}
1111
m_ShaderKeywords: ETC1_EXTERNAL_ALPHA
1212
m_LightmapFlags: 5
1313
m_EnableInstancingVariants: 0

Assets/MixedRealityToolkit-SDK/StandardAssets/Shaders/MRTK_Occlusion.shader

Lines changed: 0 additions & 58 deletions
This file was deleted.

Assets/MixedRealityToolkit-SDK/StandardAssets/Shaders/MRTK_Occlusion.shader.meta

Lines changed: 0 additions & 9 deletions
This file was deleted.

Assets/MixedRealityToolkit/_Core/Definitions/SpatialAwareness/MixedRealitySpatialAwarenessProfile.cs

Lines changed: 112 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class MixedRealitySpatialAwarenessProfile : ScriptableObject
3737
private float updateInterval = 3.5f;
3838

3939
/// <summary>
40-
/// Rhe frequency, in seconds, at which the spatial observer updates.
40+
/// The frequency, in seconds, at which the spatial observer updates.
4141
/// </summary>
4242
public float UpdateInterval => updateInterval;
4343

@@ -93,13 +93,13 @@ public class MixedRealitySpatialAwarenessProfile : ScriptableObject
9393
public bool MeshRecalculateNormals => meshRecalculateNormals;
9494

9595
[SerializeField]
96-
[Tooltip("Automatically display spatial meshes?")]
97-
private bool displayMeshes = false;
96+
[Tooltip("How should spatial meshes be displayed?")]
97+
private SpatialMeshDisplayOptions meshDisplayOption = SpatialMeshDisplayOptions.None;
9898

9999
/// <summary>
100-
/// Indicates if the mesh subsystem is to automatically display surface meshes within the application.
100+
/// Indicates how the mesh subsystem is to display surface meshes within the application.
101101
/// </summary>
102-
public bool DisplayMeshes => displayMeshes;
102+
public SpatialMeshDisplayOptions MeshDisplayOption => meshDisplayOption;
103103

104104
[SerializeField]
105105
[Tooltip("Material to use when displaying meshes")]
@@ -110,11 +110,117 @@ public class MixedRealitySpatialAwarenessProfile : ScriptableObject
110110
/// </summary>
111111
public Material MeshMaterial => meshMaterial;
112112

113+
[SerializeField]
114+
[Tooltip("Material to use when spatial meshes should occlude other objects")]
115+
private Material meshOcclusionMaterial = null;
116+
117+
/// <summary>
118+
/// The material to be used when spatial meshes should occlude other objects.
119+
/// </summary>
120+
public Material MeshOcclusionMaterial => meshOcclusionMaterial;
121+
113122
#endregion Mesh settings
114123

115124
#region Surface Finding settings
116125

117-
// todo
126+
[SerializeField]
127+
[Tooltip("Is the surface finding subsystem in use?")]
128+
private bool useSurfaceFindingSystem = true;
129+
130+
/// <summary>
131+
/// Indicates if the surface finding subsystem is in use by the application.
132+
/// </summary>
133+
public bool UseSurfaceFindingSystem => useSurfaceFindingSystem;
134+
135+
[SerializeField]
136+
[Tooltip("Physics layer on which to set the planar surfaces")]
137+
private int surfaceFindingPhysicsLayer = 31;
138+
139+
/// <summary>
140+
/// The desired Unity Physics Layer on which to set the planar surfaces.
141+
/// </summary>
142+
public int SurfaceFindingPhysicsLayer => surfaceFindingPhysicsLayer;
143+
144+
[SerializeField]
145+
[Tooltip("The minimum area, in square meters, of the planar surfaces")]
146+
private float surfaceFindingMinimumArea = 0.025f;
147+
148+
/// <summary>
149+
/// The minimum area, in square meters, of the planar surfaces.
150+
/// </summary>
151+
public float SurfaceFindingMinimumArea => surfaceFindingMinimumArea;
152+
153+
[SerializeField]
154+
[Tooltip("Automatically display floor surfaces?")]
155+
private bool displayFloorSurfaces = false;
156+
157+
/// <summary>
158+
/// Indicates if the surface finding subsystem is to automatically display floor surfaces within the application.
159+
/// </summary>
160+
public bool DisplayFloorSurfaces => displayFloorSurfaces;
161+
162+
[SerializeField]
163+
[Tooltip("Material to use when displaying floor surfaces")]
164+
private Material floorSurfaceMaterial = null;
165+
166+
/// <summary>
167+
/// The material to be used when automatically displaying floor surfaces.
168+
/// </summary>
169+
public Material FloorSurfaceMaterial => floorSurfaceMaterial;
170+
171+
[SerializeField]
172+
[Tooltip("Automatically display ceiling surfaces?")]
173+
private bool displayCeilingSurfaces = false;
174+
175+
/// <summary>
176+
/// Indicates if the surface finding subsystem is to automatically display ceiling surfaces within the application.
177+
/// </summary>
178+
public bool DisplayCeilingSurface => displayCeilingSurfaces;
179+
180+
[SerializeField]
181+
[Tooltip("Material to use when displaying ceiling surfaces")]
182+
private Material ceilingSurfaceMaterial = null;
183+
184+
/// <summary>
185+
/// The material to be used when automatically displaying ceiling surfaces.
186+
/// </summary>
187+
public Material CeilingSurfaceMaterial => ceilingSurfaceMaterial;
188+
189+
[SerializeField]
190+
[Tooltip("Automatically display wall surfaces?")]
191+
private bool displayWallSurfaces = false;
192+
193+
/// <summary>
194+
/// Indicates if the surface finding subsystem is to automatically display wall surfaces within the application.
195+
/// </summary>
196+
public bool DisplayWallSurface => displayWallSurfaces;
197+
198+
[SerializeField]
199+
[Tooltip("Material to use when displaying wall surfaces")]
200+
private Material wallSurfaceMaterial = null;
201+
202+
/// <summary>
203+
/// The material to be used when automatically displaying wall surfaces.
204+
/// </summary>
205+
public Material WallSurfaceMaterial => wallSurfaceMaterial;
206+
207+
[SerializeField]
208+
[Tooltip("Automatically display platform surfaces?")]
209+
private bool displayPlatformSurfaces = false;
210+
211+
/// <summary>
212+
/// Indicates if the surface finding subsystem is to automatically display platform surfaces within the application.
213+
/// </summary>
214+
public bool DisplayPlatformSurfaces => displayPlatformSurfaces;
215+
216+
[SerializeField]
217+
[Tooltip("Material to use when displaying platform surfaces")]
218+
private Material platformSurfaceMaterial = null;
219+
220+
/// <summary>
221+
/// The material to be used when automatically displaying platform surfaces.
222+
/// </summary>
223+
public Material PlatformSurfaceMaterial => platformSurfaceMaterial;
118224

119225
#endregion Surface Finding settings
120226
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+
namespace Microsoft.MixedReality.Toolkit.Core.Definitions.SpatialAwarenessSystem
5+
{
6+
/// <summary>
7+
/// Options for how the spatial mesh is to be displayed by the spatial awareness system.
8+
/// </summary>
9+
public enum SpatialMeshDisplayOptions
10+
{
11+
/// <summary>
12+
/// Do not display the spatial mesh
13+
/// </summary>
14+
None = 0,
15+
16+
/// <summary>
17+
/// Display the spatial mesh using the configured material
18+
/// </summary>
19+
Visible,
20+
21+
/// <summary>
22+
/// Display the spatial mesh using the configured occlusion material
23+
/// </summary>
24+
Occlusion
25+
}
26+
}

Assets/MixedRealityToolkit/_Core/Definitions/SpatialAwareness/SpatialMeshDisplayOptions.cs.meta

Lines changed: 11 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)