WVR_CreateSpatialAnchorFromCacheName

WVR_EXPORT WVR_Result WVR_CreateSpatialAnchorFromCacheName(const WVR_SpatialAnchorFromCacheNameCreateInfo * createInfo, WVR_SpatialAnchor * anchor)

Function is used to create a spatial anchor from previous built cached anchor.

Developers use this API to create a spatial anchor by the cachedSpatialAnchorName of WVR_SpatialAnchorFromCacheNameCreateInfo and get an anchor handle. This spatial anchor which created from cached anchor will be cleared once AP session closed. Each cachedSpatialAnchorName can only create one spatial anchor on it’s binding SLAM map in an AP session otherwise it will get anchor duplicated error.

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

Version
API Level 14
Parameters
  • createInfo: creation information, refer to WVR_SpatialAnchorFromCacheNameCreateInfo
  • anchor: returned handle object that holds the spatial anchor is related to createInfo
Return Value
  • WVR_Success: Create a spatial anchor successfully.
  • others: WVR_Result mean failure.

How to use

Sample function: