Skip to content

Spatial Awareness System

David Kline edited this page Feb 19, 2019 · 6 revisions

The Mixed Reality Toolkit Spatial Awareness System

The Mixed Reality Toolkit's Spatial Awareness System enables applications to interact with surfaces in the user's world. From placing items on real-world surfaces to opening magic windows in walls, spatial awareness helps immerse users in your application.

Spatial Awareness System Requirements

To use spatial awareness, the following requirements must be met.

  • The application is running on hardware that provides environmental data (ex: Microsoft HoloLens).
  • One or more spatial awareness observers are registered in the Additional Service Providers profile.

Spatial Awareness Components

The Spatial Awareness system uses registered observers to provide components (ex: meshes) that represent the real-world environment. Each observer is responsible for creating and managing the components provided.

Configuring the Spatial Awareness System

Setting Up the Spatial Awareness System

Spatial Awareness System Settings

Spatial Awareness Settings

Enable Spatial Awareness

For platforms supporting environmental awareness, enabling the Sptial Awarness System will start the specified system type and begin communicating with registered observers.

Spatial Awareness System Type

The Mixed Reality Toolkit provides application developers the ability to select the default Spatial Awareness System implementation (Microsoft.MixedReality.Toolkit.Services.SpatialAwarenessSystem.MixedRealitySpatialAwarenessSystem), a version from an installed extension or a custom implementation written by the developer.

Spatial Awareness System Type Selection

Spatial Awareness System Type Selection

Registering a Spatial Observer

Spatial observers are generally platform specific and are generally provided as part of a Mixed Reality Toolkit platform or extension package. Spatial observers are registered in the Additional Service Providers profile.

Windows Mixed Reality Spatial Mesh Observer registration

Windows Mixed Reality Spatial Mesh Observer registration

All spatial observer profiles are to inherit from the IMixedRealitySpatialAwarenessObserver interface. This interface specified the general settings to be implemented by all observers.

When registering a spatial observer, it is important to specify the appropriate type of profile, in this example, a Spatial Awareness Mesh Observer Profile. Failing to do so may limit the functionality of the observer and your application.

See Also