XRShareableAnchorSubsystem
This subsystem provides information regarding shareable anchors.
A shareable anchor is a pose (position and rotation) in the physical environment that is tracked by an XR device. It can then be saved on a host for sharing among different clients, so that each client can retrieve the same anchor from the physical environment. Anchors are updated as the device refines its understanding of the environment, allowing you to reliably place virtual content at a real-world pose and sync among all clients.
This base class must be implemented by providers that supply actual shareable anchor capabilities.
Summary
Inheritance
Inherits from:TrackingSubsystem< XRShareableAnchor, XRShareableAnchorSubsystem, XRShareableAnchorSubsystemDescriptor, XRShareableAnchorSubsystem.Provider >Direct Known Subclasses:
Google.XR.Extensions.SpatialEntities.SpatialShareableAnchorSubsystem
Constructors and Destructors |
|
|---|---|
XRShareableAnchorSubsystem()
Reserved for test only.
|
Public functions |
|
|---|---|
GetChanges(Allocator allocator)
|
override TrackableChanges< XRShareableAnchor >
|
TryAddAnchor(Pose pose, out XRShareableAnchor anchor)
|
bool
Attempts to create a new anchor at the given pose .
|
TryAttachGeospatialAnchor(XRGeospatialPose geospatialPose)
|
Result< XRShareableAnchor >
Attempts to create a shareable anchor "attached" to the given geospatial pose.
|
TryAttachSurfaceAnchorAsync(XRGeospatialSurfaceType type, XRGeospatialPose geospatialPose, CancellationToken cancellationToken)
|
Awaitable< Result< XRShareableAnchor > >
Attempts to create a shareable anchor "attached" to the given geospatial pose relative to the location's surface.
|
TryEraseAnchorAsync(SerializableGuid shareableId, XRShareableAnchorHosts host, CancellationToken cancellationToken)
|
Awaitable< XRResultStatus >
Attempts to erase the persistent saved data associated with an anchor given its persistent GUID.
|
TryGetSavedAnchorIdsAsync(XRShareableAnchorHosts host, Allocator allocator, CancellationToken cancellationToken)
|
Awaitable< Result< NativeArray< SerializableGuid > > >
Attempts to get a NativeArray
|
TryLoadAnchorAsync(SerializableGuid shareableId, XRShareableAnchorHosts host, CancellationToken cancellationToken)
|
Awaitable< Result< XRShareableAnchor > >
Attempts to load a shareable anchor given its persistent GUID.
|
TryRemoveAnchor(TrackableId anchorId)
|
bool
Attempts to remove an existing anchor with anchorId .
|
TrySaveAnchorAsync(TrackableId anchorId, XRShareableAnchorHosts host, CancellationToken cancellationToken)
|
Awaitable< Result< SerializableGuid > >
Attempts to persistently save the given anchor so that it can be loaded in a future session.
|
Classes |
|
|---|---|
|
Google. |
An abstract class to be implemented by providers of this subsystem. |