SpatialSurfaceMesh SpatialSurfaceMesh SpatialSurfaceMesh SpatialSurfaceMesh Class

Definition

Represents the mesh data for a surface observed in the user's surroundings.

public : sealed class SpatialSurfaceMesh : ISpatialSurfaceMesh
public sealed class SpatialSurfaceMesh : ISpatialSurfaceMesh
Public NotInheritable Class SpatialSurfaceMesh Implements ISpatialSurfaceMesh
// 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

The SpatialSurfaceMesh class contains all of the information you need to render the mesh or process it for physics, including its vertex, index and normal buffers.

Because this object keeps its buffers alive, you should be sure to delete it or release references to it when you either no longer need the mesh or have already transformed it into a different processed form that you are caching instead.

Properties

CoordinateSystem CoordinateSystem CoordinateSystem CoordinateSystem

Gets the coordinate system in which the VertexPositions and VertexNormals buffers express their coordinates.

public : SpatialCoordinateSystem CoordinateSystem { get; }
public SpatialCoordinateSystem CoordinateSystem { get; }
Public ReadOnly Property CoordinateSystem As SpatialCoordinateSystem
var spatialCoordinateSystem = spatialSurfaceMesh.coordinateSystem;

Remarks

Unlike other spatial data structures, vertex buffers and normal buffers are quite heavy, and it would be prohibitive to update all of their coordinates every frame. Instead, apps can transfer these buffers to the GPU or process them for physics once, and then reason about how the surface's SpatialCoordinateSystem changes its relative transform to the app's other relevant coordinate systems in future frames.

SurfaceInfo SurfaceInfo SurfaceInfo SurfaceInfo

Gets the surface metadata that's associated with this mesh.

public : SpatialSurfaceInfo SurfaceInfo { get; }
public SpatialSurfaceInfo SurfaceInfo { get; }
Public ReadOnly Property SurfaceInfo As SpatialSurfaceInfo
var spatialSurfaceInfo = spatialSurfaceMesh.surfaceInfo;

TriangleIndices TriangleIndices TriangleIndices TriangleIndices

Gets the buffer object representing the mesh's index buffer.

public : SpatialSurfaceMeshBuffer TriangleIndices { get; }
public SpatialSurfaceMeshBuffer TriangleIndices { get; }
Public ReadOnly Property TriangleIndices As SpatialSurfaceMeshBuffer
var spatialSurfaceMeshBuffer = spatialSurfaceMesh.triangleIndices;

Remarks

If SpatialSurfaceMeshOptions.TriangleIndexFormat is set as an option in the call to SpatialSurfaceInfo.TryComputeLatestMeshAsync, this buffer will be generated in the format indicated.

VertexNormals VertexNormals VertexNormals VertexNormals

Gets the buffer object representing the mesh's normal buffer, if IncludeVertexNormals was set as a mesh option in the call to SpatialSurfaceInfo.TryComputeLatestMeshAsync. Otherwise, this property is null.

public : SpatialSurfaceMeshBuffer VertexNormals { get; }
public SpatialSurfaceMeshBuffer VertexNormals { get; }
Public ReadOnly Property VertexNormals As SpatialSurfaceMeshBuffer
var spatialSurfaceMeshBuffer = spatialSurfaceMesh.vertexNormals;

Remarks

If the SpatialSurfaceMeshOptions.VertexNormalFormat option is also set, this buffer will be generated in the format indicated.

VertexPositions VertexPositions VertexPositions VertexPositions

Gets the buffer object representing the mesh's vertex buffer.

public : SpatialSurfaceMeshBuffer VertexPositions { get; }
public SpatialSurfaceMeshBuffer VertexPositions { get; }
Public ReadOnly Property VertexPositions As SpatialSurfaceMeshBuffer
var spatialSurfaceMeshBuffer = spatialSurfaceMesh.vertexPositions;

Remarks

Note that to get correct vertex positions, coordinates must be scaled according to the VertexPositionScale property. If you are otherwise transforming these coordinates to another coordinate system before using them anyway, you can make a scale matrix from the VertexPositionScale vector and include that as the first matrix in your transform chain.

If SpatialSurfaceMeshOptions.VertexPositionFormat is set as an option in the call to SpatialSurfaceInfo.TryComputeLatestMeshAsync, this buffer will be generated in the format indicated.

VertexPositionScale VertexPositionScale VertexPositionScale VertexPositionScale

Gets the scale vector that you must use to scale the elements of VertexPositions.

public : Vector3 VertexPositionScale { get; }
public Vector3 VertexPositionScale { get; }
Public ReadOnly Property VertexPositionScale As Vector3
var vector3 = spatialSurfaceMesh.vertexPositionScale;
Value
Vector3 Vector3 Vector3 Vector3

The scale vector.

Remarks

This gets you mesh coordinates in meters in the mesh's specified coordinate system.

If you are otherwise transforming these coordinates to another coordinate system before using them anyway, you can make a scale matrix from the VertexPositionScale vector and include that as the first matrix in your transform chain.