docs.unity3d.com
    Show / Hide Table of Contents

    Class XRAnchorSubsystem.Provider

    An abstract class to be implemented by providers of this subsystem.

    Inheritance
    Object
    XRAnchorSubsystem.Provider
    XRAnchorSubsystemImpl.TestProvider
    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public abstract class Provider

    Methods

    Destroy()

    Called when Destroy is called on the subsystem.

    Declaration
    public virtual void Destroy()

    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 NativeArrays for backwards compatibility. See TrackableChanges(Void*, Int32, Void*, Int32, Void*, Int32, T, Int32, Allocator).

    Allocator allocator

    An allocator to use for the NativeArrays in TrackableChanges<T>.

    Returns
    Type Description
    TrackableChanges<XRAnchor>

    Changes since the last call to GetChanges(XRAnchor, Allocator).

    Start()

    Invoked when Start is called on the subsystem. This method is only called if the subsystem was not previously running.

    Declaration
    public virtual void Start()

    Stop()

    Invoked when Stop is called on the subsystem. This method is only called if the subsystem was previously running.

    Declaration
    public virtual void Stop()

    TryAddAnchor(Pose, out XRAnchor)

    Should create a new anchor with the provide pose.

    Declaration
    public virtual bool TryAddAnchor(Pose pose, out XRAnchor anchor)
    Parameters
    Type Name Description
    Pose pose

    The pose, in session space, of the new anchor.

    XRAnchor anchor

    The new anchor. Must be valid only if this method returns true.

    Returns
    Type Description
    Boolean

    Should return true if the new anchor was added, otherwise false.

    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 may 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.

    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 true.

    Returns
    Type Description
    Boolean

    true if the new anchor was added, otherwise false.

    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 true if the anchor was removed, otherwise false. If the anchor does not exist, return false.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023