class Provider
(Niantic.Lightship.AR.XRSubsystems.XRPersistentAnchorSubsystem.Provider)
Overview
An abstract class to be implemented by providers of this subsystem.
class Provider: SubsystemProvider< XRPersistentAnchorSubsystem > {
public:
// properties
bool IsMockProvider;
XRPersistentAnchorConfiguration CurrentConfiguration;
// methods
virtual abstract TrackableChanges<XRPersistentAnchor> GetChanges(
XRPersistentAnchor defaultAnchor,
Allocator allocator
) = 0;
virtual abstract bool GetNetworkStatusUpdate(out XRPersistentAnchorNetworkRequestStatus[] statuses) = 0;
virtual abstract bool GetLocalizationStatusUpdate(out XRPersistentAnchorLocalizationStatus[] statuses) = 0;
virtual bool GetVpsSessionId(out string vpsSessionId);
virtual bool TryAddMap(byte[] dataBytes);
virtual bool TryAddGraph(byte[] dataBytes);
virtual bool TryAddAnchor(Pose pose, out XRPersistentAnchor anchor);
virtual bool TryRemoveAnchor(TrackableId anchorId);
virtual bool TryRestoreAnchor(
XRPersistentAnchorPayload anchorPayload,
out XRPersistentAnchor anchor
);
virtual bool TryLocalize(
XRPersistentAnchorPayload anchorPayload,
out XRPersistentAnchor anchor
);
};
Detailed Documentation
An abstract class to be implemented by providers of this subsystem.
Properties
CurrentConfiguration
XRPersistentAnchorConfiguration CurrentConfiguration
Get or set configuration with <name>XRPersistentAnchorConfiguration</name>
Methods
GetChanges
virtual abstract TrackableChanges<XRPersistentAnchor> GetChanges(
XRPersistentAnchor defaultAnchor,
Allocator allocator
) = 0
Invoked to get the changes to anchors (added, updated, and removed) since the last call to GetChanges(XRPersistentAnchor,Allocator).
Parameters:
defaultAnchor
- The default anchor. This should be used to initialize the returned NativeArrays for backwards compatibility. See Allocator.
allocator
- An allocator to use for the NativeArrays in TrackableChanges<T>.
Returns:
Changes since the last call to GetChanges.
GetNetworkStatusUpdate
virtual abstract bool GetNetworkStatusUpdate(out XRPersistentAnchorNetworkRequestStatus[] statuses) = 0
Get a list of network status updates, if any
Returns:
True if an update is present, false otherwise
GetLocalizationStatusUpdate
virtual abstract bool GetLocalizationStatusUpdate(out XRPersistentAnchorLocalizationStatus[] statuses) = 0
Get a list of localization status updates, if any
Returns:
True if an update is present, false otherwise
GetVpsSessionId
virtual bool GetVpsSessionId(out string vpsSessionId)
Get the vps session id, if any
Parameters:
vpsSessionId
- The vps session id as 32 character hexidecimal upper-case string.
Returns:
True if vps session id is present, false otherwise
TryAddMap
virtual bool TryAddMap(byte[] dataBytes)
Attempts to add map.
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
dataBytes
- Byte array of map data
Returns:
true if the new map was added, otherwise false.
TryAddGraph
virtual bool TryAddGraph(byte[] dataBytes)
Attempts to add map graph.
.. note::
This is an experimental feature, and is subject to breaking changes or deprecation without notice
Parameters:
dataBytes
- Byte array of map graph data
Returns:
true if the new map graph was added, otherwise false.
TryAddAnchor
virtual bool TryAddAnchor(Pose pose, out XRPersistentAnchor anchor)
Should create a new anchor with the provided pose.
Parameters:
pose
- The pose, in session space, of the new anchor.
anchor
- The new anchor. Must be valid only if this method returns true.
Returns:
Should return true if the new anchor was added, otherwise false.
TryRemoveAnchor
virtual bool TryRemoveAnchor(TrackableId anchorId)
Should remove an existing anchor with TrackableId anchorId.
Parameters:
anchorId
- The id of an existing anchor to remove.
Returns:
Should return true if the anchor was removed, otherwise false. If the anchor does not exist, return false.
TryRestoreAnchor
virtual bool TryRestoreAnchor(
XRPersistentAnchorPayload anchorPayload,
out XRPersistentAnchor anchor
)
Tries to restore an anchor
Parameters:
anchorPayload
- The payload to restore the anchor with
anchor
- The restored anchor
Returns:
Whether or not the restoration was successful