SpatialSurfaceInfo SpatialSurfaceInfo SpatialSurfaceInfo SpatialSurfaceInfo SpatialSurfaceInfo Class

Definition

Represents a snapshot of metadata for a surface observed in the user's surroundings.

public : sealed class SpatialSurfaceInfo : ISpatialSurfaceInfo
struct winrt::Windows::Perception::Spatial::Surfaces::SpatialSurfaceInfo : ISpatialSurfaceInfo
public sealed class SpatialSurfaceInfo : ISpatialSurfaceInfo
Public NotInheritable Class SpatialSurfaceInfo Implements ISpatialSurfaceInfo
// This class does not provide a public constructor.
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)

Remarks

Mesh objects contain large vertex and index buffers, and so they're heavy to hold onto if you don't have good reason. For efficient use in rendering or physics, an app is expected to cache the mesh and buffer objects it's interested in, and to throw out mesh for areas where the user is no longer operating.

You can use the set of SpatialSurfaceInfo instances given to you by SpatialSurfaceObserver, representing what mesh is present in the targeted bounding volume, in order to manage your cache.

Correlating the Id and UpdateTime properties across multiple observations lets you identify new mesh, updated mesh and removed mesh:

  • If you see a SpatialSurfaceInfo with an Id you haven't seen before, treat it as new mesh.
  • If you see a SpatialSurfaceInfo with a known Id, but with a new UpdateTime, treat it as updated mesh.
  • If you no longer see a SpatialSurfaceInfo with a known Id, treat it as removed mesh.

Because this is a snapshot, the UpdateTime property will not change over time. To see if this surface's mesh has updated, or whether a surface has been removed or moved out of the bounding volume, return to the SpatialSurfaceObserver and either call GetObservedSurfaces each frame or handle the ObservedSurfacesChanged event.

Properties

Id Id Id Id Id

Gets the persistent identifier for this surface.

UpdateTime UpdateTime UpdateTime UpdateTime UpdateTime

Gets the last update time represented by this surface metadata snapshot.

Methods

TryComputeLatestMeshAsync(Double) TryComputeLatestMeshAsync(Double) TryComputeLatestMeshAsync(Double) TryComputeLatestMeshAsync(Double) TryComputeLatestMeshAsync(Double)

Generates a mesh object and its vertex and index buffers for this surface. This chooses the most detailed mesh that does not exceed the specified triangle density, in triangles per cubic meter.

TryComputeLatestMeshAsync(Double, SpatialSurfaceMeshOptions) TryComputeLatestMeshAsync(Double, SpatialSurfaceMeshOptions) TryComputeLatestMeshAsync(Double, SpatialSurfaceMeshOptions) TryComputeLatestMeshAsync(Double, SpatialSurfaceMeshOptions) TryComputeLatestMeshAsync(Double, SpatialSurfaceMeshOptions)

Generates a mesh object and its vertex and index buffers for this surface, with the specified mesh generation options. This chooses the most detailed mesh that does not exceed the specified triangle density, in triangles per cubic meter.

TryGetBounds(SpatialCoordinateSystem) TryGetBounds(SpatialCoordinateSystem) TryGetBounds(SpatialCoordinateSystem) TryGetBounds(SpatialCoordinateSystem) TryGetBounds(SpatialCoordinateSystem)

Gets the bounds of this surface, expressed in the specified coordinate system.

See Also