WVR_UncacheSpatialAnchor

WVR_EXPORT WVR_Result WVR_UncacheSpatialAnchor(const WVR_SpatialAnchorName * cachedSpatialAnchorName)

Function is used to remove a cached anchor.

Developers use this API to remove a cached anchor on runtime.

Note: Once the cached spatial anchor list has been changed, the corresponding event (WVR_EventType) will be fired. This API will cause WVR_EventType_CachedAnchor_Changed event.

Version
API Level 14
Parameters
  • cachedSpatialAnchorName: the name of this cached anchor, refer to WVR_SpatialAnchorName
Return Value
  • WVR_Success: Remove a cached anchor successfully.
  • others: WVR_Result mean failure.

How to use

Sample function:

WVR_SpatialAnchorName cacheName = {"uniqueCacheName"};
if (WVR_UncacheSpatialAnchor(&cacheName) == WVR_Success) {
    // uncache the anchor successfully
}
// somewhere to listen cached spatial anchor list change event
void ProcessEvent() {
    WVR_Event_t event;
    while(WVR_PollEventQueue(&event)) {
        switch (event.common.type) {
            case WVR_EventType_CachedAnchor_Changed: {
                // .....

                break;
            }
        }
    }
}