Stay organized with collections
Save and categorize content based on your preferences.
ArResolveAnchorOnTerrainFuture
An asynchronous operation for resolving a terrain anchor launched by ArEarth_resolveAnchorOnTerrainAsync
.
See the Terrain anchors developer guide for more information.
Summary
Typedefs
ArResolveAnchorOnTerrainCallback
void(* ArResolveAnchorOnTerrainCallback)(void *context, ArAnchor *anchor, ArTerrainAnchorState terrain_anchor_state)
ArResolveAnchorOnTerrainFuture
struct ArResolveAnchorOnTerrainFuture_ ArResolveAnchorOnTerrainFuture
Functions
ArResolveAnchorOnTerrainFuture_acquireResultAnchor
void ArResolveAnchorOnTerrainFuture_acquireResultAnchor(
const ArSession *session,
const ArResolveAnchorOnTerrainFuture *future,
ArAnchor **out_anchor
)
Gets the resolved Terrain anchor.
If the operation isn't done yet or the operation failed, this will be NULL
. The caller must release the anchor using ArAnchor_release
.
Details |
Parameters |
session
|
The ARCore session.
|
future
|
The handle for the asynchronous operation.
|
out_anchor
|
The anchor.
|
|
ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState
void ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState(
const ArSession *session,
const ArResolveAnchorOnTerrainFuture *future,
ArTerrainAnchorState *out_terrain_anchor_state
)
Gets the result status of the resolving operation, if the operation is done.
Details |
Parameters |
session
|
The ARCore session.
|
future
|
The handle for the asynchronous operation.
|
out_terrain_anchor_state
|
The result status.
|
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[null,null,["Last updated 2025-07-14 UTC."],[[["\u003cp\u003e\u003ccode\u003eArResolveAnchorOnTerrainFuture\u003c/code\u003e represents an asynchronous operation for resolving a terrain anchor, initiated by \u003ccode\u003eArEarth_resolveAnchorOnTerrainAsync\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis operation allows you to acquire the resolved \u003ccode\u003eArAnchor\u003c/code\u003e representing the terrain anchor and its state using dedicated functions.\u003c/p\u003e\n"],["\u003cp\u003eYou can access detailed information about terrain anchors in the Terrain anchors developer guide.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArResolveAnchorOnTerrainCallback\u003c/code\u003e is used to receive the resolved anchor and its state asynchronously.\u003c/p\u003e\n"]]],["`ArResolveAnchorOnTerrainFuture` manages asynchronous terrain anchor resolution initiated by `ArEarth_resolveAnchorOnTerrainAsync`. Key actions include using `ArResolveAnchorOnTerrainFuture_acquireResultAnchor` to retrieve the resolved terrain anchor (which must be released), and `ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState` to obtain the resolution status. The `ArResolveAnchorOnTerrainCallback` is a callback triggered post-resolution, providing context, the anchor, and the resolution state. `ArResolveAnchorOnTerrainFuture` must be released with `ArFuture_release`.\n"],null,["# ArResolveAnchorOnTerrainFuture\n==============================\n\nAn asynchronous operation for resolving a terrain anchor launched by [ArEarth_resolveAnchorOnTerrainAsync](/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync).\n\nSee the [Terrain anchors developer guide](https://developers.google.com/ar/develop/geospatial/c/anchors#terrain-anchors) for more information.\n\nSummary\n-------\n\n| ### Typedefs ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ArResolveAnchorOnTerrainCallback](#arresolveanchoronterraincallback)`)(void *context, ArAnchor *anchor, ArTerrainAnchorState terrain_anchor_state)` | typedef `void(*` Callback definition for [ArEarth_resolveAnchorOnTerrainAsync](/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync). |\n| [ArResolveAnchorOnTerrainFuture](#arresolveanchoronterrainfuture) | typedef `struct ArResolveAnchorOnTerrainFuture_` Handle to an asynchronous operation launched by [ArEarth_resolveAnchorOnTerrainAsync](/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync). |\n\n| ### Functions ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| [ArResolveAnchorOnTerrainFuture_acquireResultAnchor](#arresolveanchoronterrainfuture_acquireresultanchor)`(const `[ArSession](/ar/reference/c/group/ar-session#arsession)` *session, const `[ArResolveAnchorOnTerrainFuture](/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture)` *future, `[ArAnchor](/ar/reference/c/group/ar-anchor#aranchor)` **out_anchor)` | `void` Gets the resolved Terrain anchor. |\n| [ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState](#arresolveanchoronterrainfuture_getresultterrainanchorstate)`(const `[ArSession](/ar/reference/c/group/ar-session#arsession)` *session, const `[ArResolveAnchorOnTerrainFuture](/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture)` *future, `[ArTerrainAnchorState](/ar/reference/c/group/ar-anchor#arterrainanchorstate)` *out_terrain_anchor_state)` | `void` Gets the result status of the resolving operation, if the operation is done. |\n\nTypedefs\n--------\n\n### ArResolveAnchorOnTerrainCallback\n\n```scdoc\nvoid(* ArResolveAnchorOnTerrainCallback)(void *context, ArAnchor *anchor, ArTerrainAnchorState terrain_anchor_state)\n``` \nCallback definition for [ArEarth_resolveAnchorOnTerrainAsync](/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync).\n\nThe `context` argument will be the same as that passed to [ArEarth_resolveAnchorOnTerrainAsync](/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync). The `anchor` argument will be the same as that returned by [ArResolveAnchorOnTerrainFuture_acquireResultAnchor](/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture_acquireresultanchor) and must be released using [ArAnchor_release](/ar/reference/c/group/ar-anchor#aranchor_release). The `terrain_anchor_state` argument will be the same as that returned by [ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState](/ar/reference/c/group/ar-resolve-anchor-on-terrain-future#arresolveanchoronterrainfuture_getresultterrainanchorstate).\n\nIt is a best practice to free `context` memory provided to [ArEarth_resolveAnchorOnTerrainAsync](/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync) at the end of the callback implementation. \n\n### ArResolveAnchorOnTerrainFuture\n\n```scdoc\nstruct ArResolveAnchorOnTerrainFuture_ ArResolveAnchorOnTerrainFuture\n``` \nHandle to an asynchronous operation launched by [ArEarth_resolveAnchorOnTerrainAsync](/ar/reference/c/group/ar-earth#arearth_resolveanchoronterrainasync).\n\nRelease with [ArFuture_release](/ar/reference/c/group/ar-future#arfuture_release). ([reference type, long-lived](/ar/reference/c/group/concepts#object-ownership)).\n\nFunctions\n---------\n\n### ArResolveAnchorOnTerrainFuture_acquireResultAnchor\n\n```gdscript\nvoid ArResolveAnchorOnTerrainFuture_acquireResultAnchor(\n const ArSession *session,\n const ArResolveAnchorOnTerrainFuture *future,\n ArAnchor **out_anchor\n)\n``` \nGets the resolved Terrain anchor.\n\nIf the operation isn't done yet or the operation failed, this will be `NULL`. The caller must release the anchor using [ArAnchor_release](/ar/reference/c/group/ar-anchor#aranchor_release).\n\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------|--------------------------------------------| | `session` | The ARCore session. | | `future` | The handle for the asynchronous operation. | | `out_anchor` | The anchor. | |\n\n### ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState\n\n```gdscript\nvoid ArResolveAnchorOnTerrainFuture_getResultTerrainAnchorState(\n const ArSession *session,\n const ArResolveAnchorOnTerrainFuture *future,\n ArTerrainAnchorState *out_terrain_anchor_state\n)\n``` \nGets the result status of the resolving operation, if the operation is done.\n\n\n| Details ||\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------------------------|--------------------------------------------| | `session` | The ARCore session. | | `future` | The handle for the asynchronous operation. | | `out_terrain_anchor_state` | The result status. | |"]]