Aracılığıyla paylaş


SpatialSurfaceInfo Class

Definition

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

public ref class SpatialSurfaceInfo sealed
/// [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 SpatialSurfaceInfo final
[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 SpatialSurfaceInfo
Public NotInheritable Class SpatialSurfaceInfo
Inheritance
Object Platform::Object IInspectable SpatialSurfaceInfo
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)

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

Gets the persistent identifier for this surface.

UpdateTime

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

Methods

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.

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.

TryGetBounds(SpatialCoordinateSystem)

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

Applies to

See also