SpatialSurfaceInfo
SpatialSurfaceInfo
SpatialSurfaceInfo
SpatialSurfaceInfo
Class
Definition
Represents a snapshot of metadata for a surface observed in the user's surroundings.
public : sealed class SpatialSurfaceInfo : ISpatialSurfaceInfopublic sealed class SpatialSurfaceInfo : ISpatialSurfaceInfoPublic NotInheritable Class SpatialSurfaceInfo Implements ISpatialSurfaceInfo// You can use this class in JavaScript.
- Attributes
| 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
Gets the persistent identifier for this surface.
public : PlatForm::Guid Id { get; }public Guid Id { get; }Public ReadOnly Property Id As Guid// You can use this property in JavaScript.
- Value
- PlatForm::Guid Guid Guid Guid
The identifier.
UpdateTime UpdateTime UpdateTime UpdateTime
Gets the last update time represented by this surface metadata snapshot.
public : DateTime UpdateTime { get; }public DateTimeOffset UpdateTime { get; }Public ReadOnly Property UpdateTime As DateTimeOffset// You can use this property in JavaScript.
- Value
- DateTime DateTimeOffset DateTimeOffset DateTimeOffset
The update time.
Methods
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.
public : IAsyncOperation<SpatialSurfaceMesh> TryComputeLatestMeshAsync(double maxTrianglesPerCubicMeter)public IAsyncOperation<SpatialSurfaceMesh> TryComputeLatestMeshAsync(Double maxTrianglesPerCubicMeter)Public Function TryComputeLatestMeshAsync(maxTrianglesPerCubicMeter As Double) As IAsyncOperation( Of SpatialSurfaceMesh )// You can use this method in JavaScript.
- maxTrianglesPerCubicMeter
- double Double Double Double
The maximum triangle density that the app can accept, in triangles per cubic meter.
The operation that triggers once the mesh is ready.
Remarks
Note that this method does not retrieve the specific mesh that was most current as of the UpdateTime property. Instead, the system's latest mesh data for this surface Id is always returned.
This method may return null if the mesh now contains no triangles or if the surface has since been removed.
- See Also
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.
public : IAsyncOperation<SpatialSurfaceMesh> TryComputeLatestMeshAsync(double maxTrianglesPerCubicMeter, SpatialSurfaceMeshOptions options)public IAsyncOperation<SpatialSurfaceMesh> TryComputeLatestMeshAsync(Double maxTrianglesPerCubicMeter, SpatialSurfaceMeshOptions options)Public Function TryComputeLatestMeshAsync(maxTrianglesPerCubicMeter As Double, options As SpatialSurfaceMeshOptions) As IAsyncOperation( Of SpatialSurfaceMesh )// You can use this method in JavaScript.
- maxTrianglesPerCubicMeter
- double Double Double Double
The maximum triangle density that the app can accept, in triangles per cubic meter.
- options
- SpatialSurfaceMeshOptions SpatialSurfaceMeshOptions SpatialSurfaceMeshOptions SpatialSurfaceMeshOptions
The mesh generation options.
The operation that triggers once the mesh is ready.
- See Also
TryGetBounds(SpatialCoordinateSystem) TryGetBounds(SpatialCoordinateSystem) TryGetBounds(SpatialCoordinateSystem) TryGetBounds(SpatialCoordinateSystem)
Gets the bounds of this surface, expressed in the specified coordinate system.
public : IReference<SpatialBoundingOrientedBox> TryGetBounds(SpatialCoordinateSystem coordinateSystem)public Nullable<SpatialBoundingOrientedBox> TryGetBounds(SpatialCoordinateSystem coordinateSystem)Public Function TryGetBounds(coordinateSystem As SpatialCoordinateSystem) As Nullable( Of SpatialBoundingOrientedBox )// You can use this method in JavaScript.
- coordinateSystem
- SpatialCoordinateSystem SpatialCoordinateSystem SpatialCoordinateSystem SpatialCoordinateSystem
The coordinate system in which to express the bounds.
The bounds.
Remarks
Because this is a snapshot, the bounds returned will not change over time.
This method will return null if the specified coordinate system cannot be located at the moment.