Skip to content

Commit 5a97cff

Browse files
authored
Merge pull request #3774 from davidkline-ms/docs_spatial
Getting started documentation for spatial awareness
2 parents 7ce74ca + c6dbeea commit 5a97cff

13 files changed

+208
-2
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Configuring the Spatial Awareness Mesh Observer
2+
3+
The spatial swareness mesh observer profile provides options for configuring:
4+
- [General Settings](#general-settings)
5+
- [Physics Settings](#physics-settings)
6+
- [Level of Detail Settings](#level-of-detail-settings)
7+
- [Display Settings](#display-settings)
8+
9+
## General Settings
10+
11+
![Mesh Observer General Settings](../../External/ReadMeImages/SpatialAwareness/MeshObserverGeneralSettings.png)
12+
13+
### Startup Behavior
14+
15+
The startup behavior specifies the behavior of the observer when it is first instantiated. The options are Auto Start and Manual Start. When set to Manual Start, applications will need to call one of the following IMixedRealitySpatialAwarenessSystem methods:
16+
17+
- ResumeObserver<T>(string name)
18+
- ResumeObservers()
19+
- ResumeObservers<T>()
20+
21+
The default value is Auto Start.
22+
23+
### Update Interval
24+
25+
The time, in seconds, between requests to the platform to update spatial mesh data. Typical values fall in the range of 0.1 and 5.0 seconds.
26+
27+
### Is Stationary Observer
28+
29+
Indicates whether or not the observer is to remain stationary or to move and update with the user.
30+
31+
> When stationary, if user moves further than the [Observation Extents](#observation-extents) away from the origin. In this instance, there would be no mesh data around the user until they moved closer to the origin.
32+
33+
### Observer Shape
34+
35+
The observer shape defines the type of volume that the mesh observer will use when observing meshes. The supported options are:
36+
37+
- [Axis Aligned Cube](#axis-aligned-cube)
38+
- [User Aligned Cube](#user-aligned-cube)
39+
- Sphere
40+
41+
#### Axis Aligned Cube
42+
43+
An axis aligned cube volume is a rectangular shape that stays aligned with the axes of the world coordinate system, as determened at application startup.
44+
45+
#### User Aligned Cube
46+
47+
A user aligned cube volume is a rectangular shape that rotates to align with the users local coordinate system.
48+
49+
### Observation Extents
50+
51+
The observation extents define the distance from the observation point that meshes will be observed. When the [Observer Shape](#observer-shape) is set to Sphere, the X value of the extents will be used as the radius of the sphere.
52+
53+
## Physics Settings
54+
55+
![Mesh Observer Physics Settings](../../External/ReadMeImages/SpatialAwareness/MeshObserverPhysicsSettings.png)
56+
57+
### Physics Layer
58+
59+
The physics layer specifies which layer on which the spatial mesh objects will be placed in order to interact with the Unity Physics and RayCast systems. The Mixed Reality Toolkit reserves layer 31 by default for use by Spatial Awareness observers.
60+
61+
#### Recalculate Normals
62+
63+
Specifies whether or not the mesh observer will recalculate the normals of the mesh following observation. This setting is available to ensure applications receive meshes that contain valid normals data on platforms that do not return them with meshes.
64+
65+
## Level of Detail Settings
66+
67+
![Mesh Observer Level of Detail Settings](../../External/ReadMeImages/MeshObserverLevelOfDetailSettings.png)
68+
69+
### Level of Detail
70+
71+
Specifies the level of detail (LOD) of the spatial mesh data. Currently defined values are Coarse, Fine and Custom.
72+
73+
The Coarse LOD generally place a smaller impact on application performance and are an excellent choice for navigation and plane finding.
74+
75+
The Fine LOD generally exact a higher performance impact on application performance and are a great option for occlusion meshes.
76+
77+
The Custom LOD require the application to specify the [Triangles / Cubic Meter](#triangles-per-cubic-meter) value and allows applications to tune the accuracy vs. performance impact of the spatial mesh observer.
78+
79+
> Note: It is not guaranteed that all Triangles/Cubic Meter values are honored by all platforms. Experimentation and profiling is highlu recommended when using a custom LOD.
80+
81+
### Triangles per Cubic Meter
82+
83+
When using the Custom [Level of Detail](#level-of-detail), specifies the requested value for the triangle density for the spatial mesh.
84+
85+
## Display Settings
86+
87+
![Mesh Observer Display Settings](../../External/ReadMeImages/MeshObserverDisplaySettings.png)
88+
89+
*Mesh Observer Display Settings*
90+
91+
### Display Option
92+
93+
Specifies how spatial meshes are to be displayed by the observer. Supported values are None, Visible and Occlusion. Setting Visible or Occlusion instructs the observer to select the appropriate material. Specifying None causes the observer to not render the mesh.
94+
95+
> Note: Setting Display Option to None does _not_ stop the observer from running. If you wish to stop the observer, applications will need to call one of the following IMixedRealitySpatialAwarenessSystem methods:
96+
> - SuspendObserver<T>(string name)
97+
> - SuspendObservers()
98+
> - SuspendObservers<T>()
99+
100+
### Visible Material
101+
102+
Indicates the material to be used when visualizing the spatial mesh.
103+
104+
### Occlusion Material
105+
106+
Indicates the material to be used to cause the spatial mesh to occlude holograms.
107+
108+
## See Also
109+
110+
- [IMixedRealitySpatialAwarenessObserver API documentation](xref:Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessObserver)
111+
- [IMixedRealitySpatialAwarenessMeshObserver API documentation](xref:Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessMeshObserver)
112+
- [BaseSpatialObserver API documentation](xref:Microsoft.MixedReality.Toolkit.SpatialAwareness.BaseSpatialObserver)
113+
- [Spatial Awareness System](SpatialAwarenessSystemGettingStarted.md)
114+
- [Using Spatial Awareness in an Application](../TODO.md)
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Spatial Awareness
2+
3+
The Spatial Awareness system provides real-world environmental awareness in mixed reality
4+
applications. When introduced on Microsoft HoloLens, spatial awareness provided a collection
5+
of meshes, representing the geometry of the environment, which allowed for compelling interactions
6+
between holograms and the real-world.
7+
8+
## Getting Started
9+
10+
Adding support for spatial awareness requires two key components of the Mixed Reality Toolkit: the
11+
spatial awareness system and a supported platform provider.
12+
13+
1. [Enable](enable-spatial-awareness) the spatial awareness system
14+
2. [Register](register-observers) and [configure](configure-observers) one or more spatial observers
15+
3. [Build and deploy](build-and-deploy) to a platform that supports spatial awareness
16+
17+
### Enable Spatial Awareness
18+
19+
The spatial awareness system is managed by the MixedRealityToolkit object (or another
20+
[service registrar](xref:Microsoft.MixedReality.Toolkit.IMixedRealityServiceRegistrar) component).
21+
22+
> The following steps presume use of the MixedRealityToolkit object. Steps required for other service registrars may be different.
23+
24+
1. Select the MixedRealityToolkit object in the scene hierarchy.
25+
26+
![MRTK Configured Scene Hierarchy](../../External/ReadMeImages/MRTK_ConfiguredHierarchy.png)
27+
28+
2. Navigate the Inspector panel to the Spatial Awareness System section and check Enable
29+
30+
![Enable Spatial Awareness](../../External/ReadMeImages/SpatialAwareness/MRTKConfig_SpatialAwareness.png)
31+
32+
3. Select the Spatial Awareness System implementation
33+
34+
![Select the Spatial Awareness System Implementation](../../External/ReadMeImages/SpatialAwareness/SpatialAwarenessSelectSystemType.png)
35+
36+
> Users of the default profile (DefaultMixedRealityToolkitConfigurationProfile) will have the spatial awareness system pre-configured to use the MixedRealitySpatialAwarenessSystem from the Mixed Reality
37+
Toolkit Spatial Awareness Service package.
38+
39+
### Register observers
40+
41+
Before the spatial awareness system can provide applications with data about the real-world, at least
42+
one spatial observer must be registered. Spatial observers are generally platform specific components
43+
that may vary in the type(s) of data (ex: meshes) provided.
44+
45+
1. Open or expand the Spatial Awareness System profile
46+
47+
![Spatial Awareness System Profile](../../External/ReadMeImages/SpatialAwareness/SpatialAwarenessProfile.png)
48+
49+
2. Click "Add Spatial Observer"
50+
3. Select the Spatial Observer implementation
51+
52+
![Select the Spatial Observer Implementation](../../External/ReadMeImages/SpatialAwareness/SpatialAwarenessSelectObserver.png)
53+
54+
> Users of the default profile (DefaultMixedRealitSpatialAwarenessSystemProfile) will have the spatial awareness system pre-configured to use the WindowsMixedRealitySpatialMeshObserver from the Mixed Reality
55+
Toolkit Windows Mixed Reality Provider package.
56+
57+
#### Configure observers
58+
59+
Once the spatial observer(s) have been registered with the system, they can be configured to provide
60+
the desired data.
61+
62+
> When configuring a spatial observer, many implementations will auto-populate the observer's configuration profile with common default values.
63+
64+
1. Open or expand the Spatial Observer profile
65+
66+
![Spatial Mesh Observer Profile](../../External/ReadMeImages/SpatialAwareness/SpatialAwarenessMeshObserverProfile.png)
67+
68+
2. Configure the desired options
69+
70+
The illustration in the previous step shows the configuration profile for a spatial mesh observer.
71+
Please see [Configuring the Spatial Awareness Mesh Observer](ConfiguringSpatialAwarenessMeshObserver.md) for more information pertaining to the specific
72+
settings available to mesh observers. Other observers may have similar settings.
73+
74+
### Build and Deploy
75+
76+
Once the spatial awareness system is configured with the desired observer(s), the project can be built
77+
and deployed to the target platform.
78+
79+
> Some platforms, including Microsoft HoloLens, provide support for remote execution from within Unity.
80+
This feature enables rapid development and testing without requring the build and deploy step. Be sure to do final acceptance testing using an built and deployed version of the application, running
81+
82+
83+
## See Also
84+
85+
- [Spatial Awareness API documentation](xref:Microsoft.MixedReality.Toolkit.SpatialAwareness)
86+
- [Configuring the Spatial Awareness Mesh Observer](ConfiguringSpatialAwarenessMeshObserver.md)
87+
- [Using Spatial Awareness in an Application](../TODO.md)
88+
89+

Documentation/toc.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@
5656
href: TODO.md
5757
- name: UX Building Blocks
5858
href: TODO.md
59-
- name: Spatial Mapping
60-
href: TODO.md
59+
- name: Spatial Awareness
60+
href: SpatialAwareness/SpatialAwarenessGettingStarted.md
61+
items:
62+
- name: Configuring the Spatial Awareness Mesh Observer
63+
href: SpatialAwareness/ConfiguringSpatialAwarenessMeshObserver.md
6164
- name: In-Editor Input Simulation
6265
href: TODO.md
6366
- name: Performance Diagnostic Tool
8.3 KB
Loading
14.1 KB
Loading
7.77 KB
Loading
12.7 KB
Loading
7.47 KB
Loading
5.03 KB
Loading
45.6 KB
Loading

0 commit comments

Comments
 (0)