releases/2.5.4mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0releases/2.4.0releases/2.5.0releases/2.5.1releases/2.5.2releases/2.5.3
  • Guides
  • API Documentation

We've moved!

Starting from MRTK 2.6, we are publishing both conceptual docs and API references on docs.microsoft.com. For conceptual docs, please visit our new landing page. For API references, please visit the MRTK-Unity section of the dot net API explorer. Existing content will remain here but will not be updated further.

  • Guides
  • Feature Overviews
  • Spatial Awareness System
  • Spatial Observers
  • Configuring Observers for Editor

    Show / Hide Table of Contents
    • Getting Started with MRTK
      • Release Notes
      • MRTK Package Contents
      • Updating from earlier versions
      • Upgrading from HTK
      • Building and Deploying MRTK
      • NuGet Packages
      • Getting started with MRTK and XR SDK
      • Performance
      • Hologram Stabilization
    • Architecture
      • Overview
      • Framework and Runtime
      • Input System
        • Terminology
        • Core System
        • Controllers, Pointers, and Focus
      • Systems, Extension Services and Data Providers
    • Feature Overviews
      • Boundary System
        • Boundary System Overview
        • Configuring the Boundary Visualization
      • Camera System
        • Camera System Overview
        • Camera Settings Providers
          • Windows Mixed Reality Camera Settings
          • Unity AR Camera Settings [Experimental]
          • Creating a camera settings provider
      • Cross Platform Support
        • Configure MRTK for iOS and Android
      • Detecting Platform Capabilities
      • Diagnostics System
        • Diagnostics System Overview
        • Configuring the Diagnostics System
        • Using the Visual Profiler
      • Extension Services
        • Extension Service Creation Wizard
        • Scene Transition Service Overview
        • Hand Physics Service Overview
      • Input System
        • Input Overview
        • Input Actions
        • Input Events
        • Input Providers
          • Input Providers Overview
          • Creating an input data provider
        • Controllers
        • Eyes
        • Gaze
        • Gestures
        • Hands
        • How to Add Near Interaction
        • In-Editor Input Simulation
        • Pointers
        • Voice Input
          • Dictation
          • Speech (Command and Control)
      • Multi Scene System
        • Multi Scene System Overview
        • Scene Types
        • Content Scene Loading
        • Monitoring Content Loading
        • Lighting Scene Operations
      • Packaging
        • MRTK Packages
        • MRTK Modularization
      • Profiles
        • Profiles Overview
        • Configuration Guide
      • Rendering
        • Material Instance Overview
        • Shaders
          • MRTK Standard Shader
      • Services
        • What makes a mixed reality feature
        • What are the MixedRealityServiceRegistry and IMixedRealityServiceRegistrar
        • Extension services
      • Spatial Awareness System
        • Spatial Awareness Overview
        • Spatial Observers
          • Configuring Observers for Device
          • Configuring Observers for Editor
          • Controlling Observers via Code
          • Creating a custom Observer
      • Teleport System Overview
      • Tools
        • Dependency Window
        • Extension Service Creation Wizard
        • Holographic Remoting
        • Input Animation Recording
          • Input Animation File Format Specification
        • Optimize Window
        • Runtime tools
          • Controller Mapping tool
      • UX Building Blocks
        • Interactable
        • Button
        • Bounding Box
        • Object Manipulation
        • Sliders
        • Fingertip Visualization
        • App Bar
        • Object Collection
        • Slate
        • System Keyboard
        • Tooltips
        • Solvers
      • Example Scenes
        • Examples Hub
        • Hand Interaction Example
        • Eye Tracking Interaction Example
      • Experimental
        • Scrolling Object Collection
        • Hand Coach UX
        • Pulse Shader
    • Contributing
      • Contributing Overview
      • Coding Guidelines
      • Writing and Running Tests
      • Writing Documentation
      • Pull Requests
      • Experimental Features
      • Breaking Changes
      • How to use DocFX
    • Planning
      • Roadmap
    • Notice
    • Authors

    Configuring mesh observers for the editor

    A convenient way to provide environment mesh data in the Unity editor is to use the SpatialObjectMeshObserver class. The Spatial Object Mesh Observer is an editor-only data provider for the Spatial Awareness system that enables importing 3D model data to represent a spatial mesh. One common use of the Spatial Object Mesh Observer is to import data scanned via a Microsoft HoloLens to test how an experience adapts to different environments from within Unity.

    Getting started

    This guide will walk through setting up a Spatial Object Mesh Observer. There are three key steps to enable this feature.

    1. Add a Spatial Object Mesh Observer to the Spatial Awareness system profile
    2. Set the Environment Mesh Data object
    3. Configure rest of the Mesh Observer profile properties

    Set up a spatial object mesh observer profile

    1. Select the desired Mixed Reality Toolkit configuration profile or select the Mixed Reality Toolkit object in scene

    2. Open or expand the Spatial Awareness System tab

    3. Click on "Add Spatial Observer" button

      Add Spatial Observer

    4. Select the SpatialObjectMeshObserver type

      Select Spatial Object Mesh Observer

    5. Select the desired Spatial Mesh Object. By default, the observer is configured with an example model. This model was created using a Microsoft HoloLens but it is possible to create a new scan mesh object.

    6. Configure rest of the Mesh Observer profile properties

      Select the Mesh Object

    Spatial object mesh observer profile notes

    Since the Spatial Object Mesh Observer loads data from a 3D model, it does not honor some of the standard mesh observer settings which are outlined below.

    Update Interval

    The Spatial Object Mesh Observer sends all meshes to an application when the model is loaded. It does not simulate time deltas between updates. An application can re-receive the mesh events by calling myObserver.ClearObservation() and myObserver.Resume().

    Is Stationary Observer

    The Spatial Object Mesh Observer considers all 3D mesh objects to be stationary and disregards origin.

    Observer Shape and Extents

    The Spatial Object Mesh Observer sends the entire 3D mesh to the application. Observer shape and extents are not considered.

    Level of Detail and Triangles / Cubic Meter

    The Observer does not attempt to find 3D model LODs when sending the meshes to the application.

    Acquiring environment scans

    This section outlines additional information to create and gather Spatial Mesh Object files for use with the Spatial Object Mesh Observer.

    Windows Device Portal

    The Windows Device Portal can be used to download the spatial mesh, as a .obj file, from a Microsoft HoloLens device.

    1. Scan by simply walking and viewing the desired environment with a HoloLens
    2. Connect to the HoloLens using the Windows Device Portal
    3. Navigate to the 3D View page
    4. Click the Update button under Spatial Mapping section
    5. Click the Save button under Spatial Mapping section to save the obj file to PC
    Note

    HoloToolkit .room files

    Many developers will have previously used HoloToolkit to scan environments and create .room files. The Mixed Reality Toolkit now supports importing these files as GameObjects in Unity and use them as Spatial Mesh Objects in the observer.

    See also

    • Profiles
    • Mixed Reality Toolkit Profile configuration guide
    • Spatial Awareness Getting started
    • Configuring Mesh Observers on Device
    • Configuring Mesh Observers via code
    • Using the Windows Device Portal
    • Improve this Doc
    In This Article
    • Getting started
      • Set up a spatial object mesh observer profile
      • Spatial object mesh observer profile notes
    • Acquiring environment scans
      • Windows Device Portal
    • See also
    Back to top Generated by DocFX