IAzureSpatialAnchors

IAzureSpatialAnchors.h provides the C++ interface for using [AzureSpatialAnchors](API\Plugins\AzureSpatialAnchors\AzureSpatialAnchors) (ASA) in Unreal.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

AzureSpatialAnchors

Header

/Engine/Plugins/Runtime/AR/AzureSpatialAnchors/Source/AzureSpatialAnchors/Public/IAzureSpatialAnchors.h

Include

#include "IAzureSpatialAnchors.h"

Syntax

class IAzureSpatialAnchors : public IModularFeature

Remarks

IAzureSpatialAnchors.h provides the C++ interface for using AzureSpatialAnchors (ASA) in Unreal.

Most of its functions are simple wrappers for ASA api's from Microsoft. A few relate to UAzureCloudSpatialAnchor objects. A few communicate with the platform specific local anchor api's, where that is necessary.

It is extended by AzureSpatialAnchorsBase, which owns the UAzureCloudSpatialAnchor objects which are UE's representation of the ASA CloudAnchor object. That is then extended by AzureSpatialAnchorsFor<Platform> classes in their own plugins (so one can choose to enable the feature per platform). The ForPlatform classes implement the api wrapper functions and do whatever type conversions and async translation is required. AzureSpatialAnchorsForWMR is an example, however it is complicated by the existance of the interop layer (which keeps winrt types out of UE4's build). Other implementations may be somewhat simpler without this additional layer.

AzureSpatialAnchorsFunctionLibrary provides the blueprint api for AzureSpatialAnchors. It is also an example of how to use the C++ api.

UAzureSpatialAnchorsLibrary::StartSession() is a super simple case.  It just calls through to one of the non-async ForPlatform api functions.

UAzureSpatialAnchorsLibrary::DeleteCloudAnchor is a latent blueprint function wrapping a simple async api function.  Most of the logic is actually in FAzureSpatialAnchorsDeleteCloudAnchorAction.

UAzureSpatialAnchorsLibrary::LoadCloudAnchor / FAzureSpatialAnchorsLoadCloudAnchorAction is the most complicated.  It creates a watcher then registers for the delegates so it can handle AnchorLocated and AnchorLocateCompleted events.

Destructors

Name Description

Public function Virtual

~IAzureSpatialAnchors()

Functions

Name Description

Public function

EAzureSpatia...

 

ConstructAnchor

(
    UARPin* InARPin,
    CloudAnchorID& OutCloudAnchorID
)

Public function

bool

 

ConstructCloudAnchor

(
    UARPin*& InARPin,
    UAzureCloudSpatialAnchor*& Out...
)

Public function

void

 

CreateAnchorAsync

(
    CloudAnchorID InCloudAnchorID,
    Callback_Result Callback
)

Public function

bool

 

CreateARPinAroundAzureCloudSpatialAnchor

(
    const FString& PinId,
    UAzureCloudSpatialAnchor* InAz...,
    UARPin*& OutARPin
)

Public function

void

 

CreateDiagnosticsManifestAsync

(
    const FString& Description,
    Callback_Result_String Callback
)

Public function

void

 

CreateNamedARPinAroundAnchor

(
    const FString& LocalAnchorId,
    UARPin*& OutARPin
)

Functions that must be implemented per-platform.

Public function

bool

 

CreateSession()

These functions alias the AzureSpatialAnchors API. They must be implemented for each platform.

Public function

EAzureSpatia...

 

CreateWatcher

(
    const FAzureSpatialAnchorsLocateCri...,
    float InWorldToMetersScale,
    WatcherID& OutWatcherID,
    FString& OutErrorString
)

Public function

void

 

DeleteAnchorAsync

(
    CloudAnchorID InCloudAnchorID,
    Callback_Result Callback
)

Public function

void

 

DestroySession()

Public function

void

 

DisposeSession()

Public function Static

IAzureSpatia...

 

Get()

Public function

void

 

GetAccessTokenWithAccountKeyAsync

(
    const FString& AccountKey,
    Callback_Result_String Callback
)

Public function

void

 

GetAccessTokenWithAuthenticationTokenAsync

(
    const FString& AccountKey,
    Callback_Result_String Callback
)

Public function

EAzureSpatia...

 

GetActiveWatchers

(
    TArray< WatcherID >& OutWatcherIDs
)

Public function

void

 

GetAnchorPropertiesAsync

(
    const FString& InCloudAnchorIdenti...,
    Callback_Result_CloudAnchorID Callb...
)

Public function

bool

 

GetCloudAnchor

(
    UARPin*& InARPin,
    UAzureCloudSpatialAnchor*& Out...
)

Public function

EAzureSpatia...

 

GetCloudAnchorAppProperties

(
    CloudAnchorID InCloudAnchorID,
    TMap< FString, FString >& OutAppPr...
)

Public function

EAzureSpatia...

 

GetCloudAnchorExpiration

(
    CloudAnchorID InCloudAnchorID,
    float& OutLifetimeInSeconds
)

Public function

void

 

GetCloudAnchors

(
    TArray< class UAzureCloudSpatialAnc...
)

Public function

EAzureSpatia...

 

GetCloudSpatialAnchorIdentifier

(
    CloudAnchorID InCloudAnchorID,
    FString& OutCloudAnchorIdentifier
)

Public function

EAzureSpatia...

 

GetConfiguration

Public function

EAzureSpatia...

 

GetLogLevel

Public function Static

FName

 

GetModularFeatureName()

Public function

UAzureCloudS...

 

GetOrConstructCloudAnchor

(
    CloudAnchorID CloudAnchorID
)

Public function

EAzureSpatia...

 

GetSessionId

(
    FString& OutSessionID
)

Virtual EAzureSpatialAnchorsResult GetSession() = 0; virtual EAzureSpatialAnchorsResult SetSession() = 0;

Public function

const FAzure...

 

GetSessionStatus()

These functions provide basic housekeeping for AzureSpatialAnchors. The AzureSpatialAnchorsBase layer implements them.

Public function

void

 

GetSessionStatusAsync

(
    Callback_Result_SessionStatus Callb...
)

Public function Static

bool

 

IsAvailable()

Public function Static

void

 

OnLog

(
    const wchar_t* LogMsg
)

Public function

void

 

RefreshAnchorPropertiesAsync

(
    CloudAnchorID InCloudAnchorID,
    Callback_Result Callback
)

Public function

EAzureSpatia...

 

ResetSession()

Public function

EAzureSpatia...

 

SetCloudAnchorAppProperties

(
    CloudAnchorID InCloudAnchorID,
    const TMap< FString, FString >& In...
)

Public function

EAzureSpatia...

 

SetCloudAnchorExpiration

(
    CloudAnchorID InCloudAnchorID,
    float InLifetimeInSeconds
)

Public function

EAzureSpatia...

 

SetConfiguration

(
    const FAzureSpatialAnchorsSessionCo...
)

Public function

EAzureSpatia...

 

SetDiagnosticsConfig

Public function

EAzureSpatia...

 

SetLocationProvider

(
    const FCoarseLocalizationSettings&...
)

Public function

EAzureSpatia...

 

SetLogLevel

Public function

EAzureSpatia...

 

StartSession()

Public function

void

 

StopSession()

Public function

EAzureSpatia...

 

StopWatcher

(
    WatcherID WatcherID
)

Public function

void

 

SubmitDiagnosticsManifestAsync

(
    const FString& ManifestPath,
    Callback_Result Callback
)

Public function

void

 

UpdateAnchorPropertiesAsync

(
    CloudAnchorID InCloudAnchorID,
    Callback_Result Callback
)

Classes

Name

Description

Protected class

FASAAnchorLocatedTask

If an implementation generates events from a thread other than the game thread it should launch these tasks that will fire the delegates on the game thread

Protected class

FASALocateAnchorsCompletedTask

Protected class

FASASessionUpdatedTask

Typedefs

Name

Description

Callback_Result

Callback_Result_CloudAnchorID

Callback_Result_SessionStatus

Callback_Result_String

CloudAnchorID

FASAAnchorLocatedDelegate

WatcherIdentifier, status, anchor.

FASALocateAnchorsCompletedDelegate

WatcherIdentifier, canceled.

FASASessionUpdatedDelegate

ReadyForCreateProgress, RecommendedForCreateProgress, SessionCreateHash, SessionLocateHash, feedback.

LogFunctionPtr

WatcherID

Constants