class WayspotAnchorService (Niantic.ARDK.AR.WayspotAnchors.WayspotAnchorService)

Overview

class WayspotAnchorService: IDisposable {
public:
    // properties

    LocalizationState LocalizationState;

    // methods

    async void CreateWayspotAnchors(
        Action<IWayspotAnchor[]> callback,
        params Matrix4x4[] localPoses
    );

    async Task<IWayspotAnchor[]> CreateWayspotAnchorsAsync(params Matrix4x4[] localPoses);
    void DestroyWayspotAnchors(params Guid[] ids);
    void DestroyWayspotAnchors(params IWayspotAnchor[] anchors);
    void Dispose();
    IWayspotAnchor[] GetAllWayspotAnchors();
    IWayspotAnchor GetWayspotAnchor(Guid id);
    async void Restart();
    IWayspotAnchor[] RestoreWayspotAnchors(params WayspotAnchorPayload[] wayspotAnchorPayloads);

    WayspotAnchorService(
        IARSession arSession,
        ILocationService locationService,
        IWayspotAnchorsConfiguration wayspotAnchorsConfiguration
    );
};

Detailed Documentation

Properties

LocalizationState LocalizationState

The current localization state of the waypoint anchor service.

Methods

async void CreateWayspotAnchors(
    Action<IWayspotAnchor[]> callback,
    params Matrix4x4[] localPoses
)

Creates new wayspot anchors.

Parameters:

callback

The callback when the wayspot anchors have been created

localPoses

The positions and rotations used the create the wayspot anchors

async Task<IWayspotAnchor[]> CreateWayspotAnchorsAsync(params Matrix4x4[] localPoses)

Creates new wayspot anchors. The new wayspot anchor is tracked by default.

Parameters:

localPoses

The positions and rotations used the create the wayspot anchors

Returns:

The newly created wayspot anchors

void DestroyWayspotAnchors(params Guid[] ids)

Destroys wayspot anchors by ID.

Parameters:

ids

The IDs of the wayspot anchors to destroy

void DestroyWayspotAnchors(params IWayspotAnchor[] anchors)

Destroys existing wayspot anchors.

Parameters:

anchors

The wayspot anchors to destroy

void Dispose()

Disposes of the Wayspot Anchor Service.

IWayspotAnchor[] GetAllWayspotAnchors()

Gets all of the wayspot anchors.

Returns:

All of the wayspot anchors

IWayspotAnchor GetWayspotAnchor(Guid id)

Gets a wayspot anchor by its ID.

Parameters:

id

The ID of the wayspot anchor to retrieve

Returns:

The wayspot anchor

async void Restart()

Restarts VPS.

IWayspotAnchor[] RestoreWayspotAnchors(params WayspotAnchorPayload[] wayspotAnchorPayloads)

Restores previously created wayspot anchors via the payload from them.

Parameters:

wayspotAnchorPayloads

The payloads from the wayspot anchors used to restore them

Returns:

The restored wayspot anchors

WayspotAnchorService(
    IARSession arSession,
    ILocationService locationService,
    IWayspotAnchorsConfiguration wayspotAnchorsConfiguration
)

Creates a new wayspot anchor service.

Parameters:

arSession

The AR Session used to create the wayspot anchor service

locationService

The location service used to create the wayspot anchor service

wayspotAnchorsConfiguration

The configuration of the wayspot anchors