Skip to main content
Version: 14 Oct 2024

MLSpatialAnchor

A structure representing a user-defined Spatial Anchor.

Public Methods

MLSpatialAnchor

public MLSpatialAnchor(
MLAnchors.Anchor anchor
)

Parameters

TypeNameDescription
MLAnchors.Anchoranchor

MLSpatialAnchor

public MLSpatialAnchor(
MLAnchors.Anchor anchor,
ulong expirationTimeStamp
)

Parameters

TypeNameDescription
MLAnchors.Anchoranchor
ulongexpirationTimeStamp

Public Attributes

Cfuid

The coordinate frame identifier of the Spatial Anchor. This should be passed to MLSnapshotGetTransform to get the anchor's transform. The anchor's transform is set when the anchor is created but may be updated later by the Spatial Anchor system based on factors such as quality of the mapped space and subsequent localizations.


public readonly NativeBindings.MLCoordinateFrameUID Cfuid;

TypeDescription
readonly NativeBindings.MLCoordinateFrameUIDA unique identifier which represents a coordinate frame. The unique identifier is comprised of two values.

ExpirationTimeStamp

The suggested expiration time for this anchor represented in seconds since the Unix epoch. This is implemented as an expiration timestamp in the future after which the associated anchor should be considered no longer valid and may be removed by the Spatial Anchor system based on factors such as quality of the mapped space and subsequent localizations.


public readonly ulong ExpirationTimeStamp;


Id

The anchor's unique ID. This is a unique identifier for a single Spatial Anchor that is generated and managed by the Spatial Anchor system. The ID is created when MLSpatialAnchorCreate is called.


public readonly MLUUIDBytes Id;


IsPersisted

Indicates whether or not the anchor has been persisted via a call to MLSpatialAnchorPublish.


public readonly bool IsPersisted;


Quality

The quality of the local space that this anchor occupies. This value may change over time.


public readonly Quality Quality;

TypeDescription
readonly QualityThe quality of the local space around the anchor. This can change over time as the user continues to scan the space.

SpaceId

The ID of the space that this anchor belongs to. This is only relevant if IsPersisted is true.


public readonly MLUUIDBytes SpaceId;


Version

Version of the structure.


public readonly uint Version;