SpatialSurfaceObserver SpatialSurfaceObserver SpatialSurfaceObserver SpatialSurfaceObserver SpatialSurfaceObserver Class

Definition

Provides methods for observing surfaces in the user's surroundings.

public : sealed class SpatialSurfaceObserver : ISpatialSurfaceObserver
struct winrt::Windows::Perception::Spatial::Surfaces::SpatialSurfaceObserver : ISpatialSurfaceObserver
public sealed class SpatialSurfaceObserver : ISpatialSurfaceObserver
Public NotInheritable Class SpatialSurfaceObserver Implements ISpatialSurfaceObserver
var spatialSurfaceObserver = new spatialSurfaceObserver();
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)
Capabilities
spatialPerception

Remarks

Spatial mapping lets your app understand the shape and location of the surfaces in the user's surroundings.

Through the sensors on a device like HoloLens, Windows generates 3D triangle meshes of surfaces in large cube-shaped volumes. Over time, as Windows improves its understanding of your surroundings, new surface volumes are generated and existing volumes are updated with new mesh. Sometimes, surface volumes can be destroyed as well, when the system is running low on storage.

You access these surfaces by expressing interest in a volume of space, either a bounding box, bounding frustum, or bounding sphere. Windows updates you to let you know when the set of surfaces in that observed volume has changed, with each surface volume identified by an id and the time of its last update. By reasoning about changes to this set of observed surface metadata, you can detect new mesh, updated mesh, and removed mesh over time.

Constructors

SpatialSurfaceObserver() SpatialSurfaceObserver() SpatialSurfaceObserver() SpatialSurfaceObserver() SpatialSurfaceObserver()

Initializes a new instance of the SpatialSurfaceObserver class.

Methods

GetObservedSurfaces() GetObservedSurfaces() GetObservedSurfaces() GetObservedSurfaces() GetObservedSurfaces()

Gets metadata for the set of surfaces observed within the bounding volume at the moment.

IsSupported() IsSupported() IsSupported() IsSupported() IsSupported()

Gets whether spatial mapping is supported on the current system.

RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync()

Requests access for an app to use spatial mapping. This requires the spatialPerception capability.

SetBoundingVolume(SpatialBoundingVolume) SetBoundingVolume(SpatialBoundingVolume) SetBoundingVolume(SpatialBoundingVolume) SetBoundingVolume(SpatialBoundingVolume) SetBoundingVolume(SpatialBoundingVolume)

Sets the single bounding volume that this observer will track for new, updated or removed surfaces.

SetBoundingVolumes(IIterable<SpatialBoundingVolume>) SetBoundingVolumes(IIterable<SpatialBoundingVolume>) SetBoundingVolumes(IIterable<SpatialBoundingVolume>) SetBoundingVolumes(IIterable<SpatialBoundingVolume>) SetBoundingVolumes(IIterable<SpatialBoundingVolume>)

Sets the list of bounding volumes that this observer will track for new, updated or removed surfaces.

Events

ObservedSurfacesChanged ObservedSurfacesChanged ObservedSurfacesChanged ObservedSurfacesChanged ObservedSurfacesChanged

Occurs when the set of surface metadata observed within the bounding volume has changed.

See Also