Delen via


SpatialSurfaceObserver Class

Definition

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

public ref class SpatialSurfaceObserver sealed
/// [Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 131072)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SpatialSurfaceObserver final
[Windows.Foundation.Metadata.Activatable(131072, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 131072)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SpatialSurfaceObserver
function SpatialSurfaceObserver()
Public NotInheritable Class SpatialSurfaceObserver
Inheritance
Object Platform::Object IInspectable SpatialSurfaceObserver
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10586.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v2.0)
App 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.

Version history

Windows version SDK version Value added
1703 15063 IsSupported

Constructors

SpatialSurfaceObserver()

Initializes a new instance of the SpatialSurfaceObserver class.

Methods

GetObservedSurfaces()

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

IsSupported()

Gets whether spatial mapping is supported on the current system.

RequestAccessAsync()

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

SetBoundingVolume(SpatialBoundingVolume)

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

SetBoundingVolumes(IIterable<SpatialBoundingVolume>)

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

Events

ObservedSurfacesChanged

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

Applies to

See also