Class XRAnchorSubsystem.Provider
An abstract class to be implemented by providers of this subsystem.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Syntax
public abstract class Provider : SubsystemProvider<XRAnchorSubsystem>
Methods
GetChanges(XRAnchor, Allocator)
Invoked to get the changes to anchors (added, updated, and removed) since the last call to GetChanges(XRAnchor, Allocator).
Declaration
public abstract TrackableChanges<XRAnchor> GetChanges(XRAnchor defaultAnchor, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
XRAnchor | defaultAnchor | The default anchor. This should be used to initialize the returned
|
Unity.Collections.Allocator | allocator | An allocator to use for the |
Returns
Type | Description |
---|---|
TrackableChanges<XRAnchor> | Changes since the last call to GetChanges(XRAnchor, Allocator). |
TryAddAnchor(Pose, out XRAnchor)
Should create a new anchor with the provided pose
.
Declaration
public virtual bool TryAddAnchor(Pose pose, out XRAnchor anchor)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Pose | pose | The pose, in session space, of the new anchor. |
XRAnchor | anchor | The new anchor. Must be valid only if this method returns |
Returns
Type | Description |
---|---|
Boolean | Should return |
TryAttachAnchor(TrackableId, Pose, out XRAnchor)
Should create a new anchor "attached" to the trackable with id trackableToAffix
.
The behavior of the anchor depends on the type of trackable to which this anchor is attached and
might be implementation-defined.
Declaration
public virtual bool TryAttachAnchor(TrackableId trackableToAffix, Pose pose, out XRAnchor anchor)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableToAffix | The id of the trackable to which to attach. |
UnityEngine.Pose | pose | The pose, in session space, of the anchor to create. |
XRAnchor | anchor | The new anchor. Must be valid only if this method returns |
Returns
Type | Description |
---|---|
Boolean |
|
TryRemoveAnchor(TrackableId)
Should remove an existing anchor with TrackableId anchorId
.
Declaration
public virtual bool TryRemoveAnchor(TrackableId anchorId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | anchorId | The id of an existing anchor to remove. |
Returns
Type | Description |
---|---|
Boolean | Should return |