SpatialStageFrameOfReference SpatialStageFrameOfReference SpatialStageFrameOfReference SpatialStageFrameOfReference Class

Definition

Represents a spatial stage, defined by the user to establish the physical space in which they intend to use a Mixed Reality headset.

public : sealed class SpatialStageFrameOfReference : ISpatialStageFrameOfReferencepublic sealed class SpatialStageFrameOfReference : ISpatialStageFrameOfReferencePublic NotInheritable Class SpatialStageFrameOfReference Implements ISpatialStageFrameOfReference// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Remarks

A spatial stage consists minimally of a floor-level coordinate system whose origin is chosen by the user, representing the logical center of the area in which they intend to use their Mixed Reality headset. This floor-level coordinate system enables apps to present standing-scale experiences.

Optionally, the user may also define a movement boundary, representing the open area in which they intend to walk while using the headset. This movement boundary enables apps to present room-scale experiences.

If the user has not defined a spatial stage, an app may call the RequestNewStageAsync method to guide the user through system UI that will allow them to define one.

On HoloLens, an app may also build standing-scale or room-scale experiences using spatial mapping. Spatial mapping enables the developer to analyze the user's surroundings and determine the locations of the user's walls and floors using the SpatialSurfaceObserver type, even if the user has not defined a stage manually. Inspect the SpatialSurfaceObserver.IsSupported property to determine if the current device supports spatial mapping.

Coordinate systems returned by the stage are right-handed, with +y up, +x to the right, and -z forward.

Properties

CoordinateSystem CoordinateSystem CoordinateSystem CoordinateSystem

Gets a floor-level coordinate system located at the stage origin defined by the user.

public : SpatialCoordinateSystem CoordinateSystem { get; }public SpatialCoordinateSystem CoordinateSystem { get; }Public ReadOnly Property CoordinateSystem As SpatialCoordinateSystem// You can use this property in JavaScript.

Remarks

The coordinate system is right-handed, with +y up, +x to the right, and -z forward.

Current Current Current Current

Gets the current spatial stage, if one has been defined by the user.

public : static SpatialStageFrameOfReference Current { get; }public static SpatialStageFrameOfReference Current { get; }Public Static ReadOnly Property Current As SpatialStageFrameOfReference// You can use this property in JavaScript.

Remarks

This property will return null if the user has not defined a spatial stage. On HoloLens, users are not yet able to define a spatial stage.

LookDirectionRange LookDirectionRange LookDirectionRange LookDirectionRange

Gets the extent to which the user can look around with their headset.

public : SpatialLookDirectionRange LookDirectionRange { get; }public SpatialLookDirectionRange LookDirectionRange { get; }Public ReadOnly Property LookDirectionRange As SpatialLookDirectionRange// You can use this property in JavaScript.

MovementRange MovementRange MovementRange MovementRange

Gets the extent to which the user can move while wearing their headset.

public : SpatialMovementRange MovementRange { get; }public SpatialMovementRange MovementRange { get; }Public ReadOnly Property MovementRange As SpatialMovementRange// You can use this property in JavaScript.

Methods

GetCoordinateSystemAtCurrentLocation(SpatialLocator) GetCoordinateSystemAtCurrentLocation(SpatialLocator) GetCoordinateSystemAtCurrentLocation(SpatialLocator) GetCoordinateSystemAtCurrentLocation(SpatialLocator)

Gets a floor-level coordinate system at the user's current position and orientation.

public : SpatialCoordinateSystem GetCoordinateSystemAtCurrentLocation(SpatialLocator locator)public SpatialCoordinateSystem GetCoordinateSystemAtCurrentLocation(SpatialLocator locator)Public Function GetCoordinateSystemAtCurrentLocation(locator As SpatialLocator) As SpatialCoordinateSystem// You can use this method in JavaScript.
Parameters
locator
SpatialLocator SpatialLocator SpatialLocator SpatialLocator

The spatial locator with the position and orientation to use as the origin for the returned coordinate system.

Returns

Remarks

The coordinate system is right-handed, with +y up, +x to the right, and -z forward.

RequestNewStageAsync() RequestNewStageAsync() RequestNewStageAsync() RequestNewStageAsync()

Shows system UI to guide the user in defining a new stage to replace the current stage.

public : static IAsyncOperation<SpatialStageFrameOfReference> RequestNewStageAsync()public static IAsyncOperation<SpatialStageFrameOfReference> RequestNewStageAsync()Public Static Function RequestNewStageAsync() As IAsyncOperation( Of SpatialStageFrameOfReference )// You can use this method in JavaScript.
Returns

An app may call RequestNewStageAsync if there is no stage defined or if the current stage is insufficient to meet the app's needs, such as not defining movement bounds.

TryGetMovementBounds(SpatialCoordinateSystem) TryGetMovementBounds(SpatialCoordinateSystem) TryGetMovementBounds(SpatialCoordinateSystem) TryGetMovementBounds(SpatialCoordinateSystem)

Gets the boundary vertices of the open area defined by the user where they intend to move while using their headset.

public : Vector3[] TryGetMovementBounds(SpatialCoordinateSystem coordinateSystem)public Vector3[] TryGetMovementBounds(SpatialCoordinateSystem coordinateSystem)Public Function TryGetMovementBounds(coordinateSystem As SpatialCoordinateSystem) As Vector3[]// You can use this method in JavaScript.
Parameters
coordinateSystem
SpatialCoordinateSystem SpatialCoordinateSystem SpatialCoordinateSystem SpatialCoordinateSystem

The coordinate system in which to express the boundary vertices.

Returns
Vector3[] Vector3[] Vector3[] Vector3[]

The boundary vertices.

Remarks

This method will return null if the user has not defined movement bounds. (i.e. if MovementRange is NoMovement)

Events

CurrentChanged CurrentChanged CurrentChanged CurrentChanged

Occurs when the user changes or redefines the current spatial stage.

public : static event EventHandler CurrentChanged<object>public static event EventHandler CurrentChanged<object>Public Static Event CurrentChanged<object>// You can use this event in JavaScript.

Remarks

When this occurs, inspect the Current property again to get the latest stage instance.