Interface ISpatialCoordinateService
This service is used to discover, track and create coordinates.
Inherited Members
Namespace: Microsoft.MixedReality.SpatialAlignment
Assembly: cs.temp.dll.dll
Syntax
public interface ISpatialCoordinateService : IDisposable
Properties
IsTracking
Gets or sets whether this coordinate service should be discovering/tracking coordinates.
Declaration
bool IsTracking { get; }
Property Value
Type | Description |
---|---|
Boolean |
KnownCoordinates
Gets a set of all known coordinates to this service.
Declaration
IEnumerable<ISpatialCoordinate> KnownCoordinates { get; }
Property Value
Type | Description |
---|---|
IEnumerable<ISpatialCoordinate> |
Methods
TryCreateCoordinateAsync(Vector3, Quaternion, CancellationToken)
Attempts to create a new coordinate with this service.
Declaration
Task<ISpatialCoordinate> TryCreateCoordinateAsync(Vector3 worldPosition, Quaternion worldRotation, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldPosition | |
Quaternion | worldRotation | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ISpatialCoordinate> | The coordinate if the coordinate was succesfully created, otherwise null. |
TryDeleteCoordinateAsync(String, CancellationToken)
Attempts to asynchronously delete a coordinate with this space given an Id.
Declaration
Task<bool> TryDeleteCoordinateAsync(string id, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | id | The id representing the coordinate. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Boolean> | True if the coordinate was succesfully deleted. |
TryDiscoverCoordinatesAsync(CancellationToken, String[])
Begins search for coordinates, optionally priortizing a set of ids.
Declaration
Task<bool> TryDiscoverCoordinatesAsync(CancellationToken cancellationToken, params string[] idsToLocate)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to be used for cancellation (stopping) of the discovery task. |
String[] | idsToLocate |
Returns
Type | Description |
---|---|
Task<Boolean> | The set of coordinates discovered during this session. |
TryGetKnownCoordinate(String, out ISpatialCoordinate)
A key based lookup for a known coordinate.
Declaration
bool TryGetKnownCoordinate(string id, out ISpatialCoordinate spatialCoordinate)
Parameters
Type | Name | Description |
---|---|---|
String | id | The identifier of the coordinate to look up. |
ISpatialCoordinate | spatialCoordinate | The out parameter that will be filled with found coordinate, or null otherwise. |
Returns
Type | Description |
---|---|
Boolean | Returns true if coordinate was found (known locally), false otherwise. |
Events
CoordinatedDiscovered
Triggered when a new coordinate is discovered or created with this service.
Declaration
event Action<ISpatialCoordinate> CoordinatedDiscovered
Event Type
Type | Description |
---|---|
Action<ISpatialCoordinate> |
Remarks
It may not be in the IsLocated state if created locally.
CoordinateRemoved
Triggered when a new coordinate is removed from this service.
Declaration
event Action<ISpatialCoordinate> CoordinateRemoved
Event Type
Type | Description |
---|---|
Action<ISpatialCoordinate> |