@@ -986,8 +986,7 @@ AR_DEFINE_ENUM(ArCloudAnchorState){
986986 AR_CLOUD_ANCHOR_STATE_ERROR_INTERNAL = -1 ,
987987
988988 // / The authorization provided by the application is not valid.
989- // / - The Google Cloud project may not have enabled the ARCore Cloud Anchor
990- // / API.
989+ // / - The Google Cloud project may not have enabled the ARCore API.
991990 // / - It may fail if the operation you are trying to perform is not allowed.
992991 // / - When using API key authentication, this will happen if the API key in
993992 // / the manifest is invalid, unauthorized or missing. It may also fail if
@@ -1004,9 +1003,8 @@ AR_DEFINE_ENUM(ArCloudAnchorState){
10041003 " ARCore SDK 1.12. See release notes to learn more." ) = -3 ,
10051004
10061005 // / The application has exhausted the request quota allotted to the given
1007- // / API key. The developer should request additional quota for the ARCore
1008- // / Cloud Anchor service for their API key from the Google Developers
1009- // / Console.
1006+ // / API key. The developer should request additional quota for the ARCore API
1007+ // / for their API key from the Google Developers Console.
10101008 AR_CLOUD_ANCHOR_STATE_ERROR_RESOURCE_EXHAUSTED = -4 ,
10111009
10121010 // / Hosting failed, because the server could not successfully process the
@@ -1780,7 +1778,11 @@ void ArConfig_setAugmentedImageDatabase(
17801778// / @ingroup ArConfig
17811779// / Returns the image database from the session configuration.
17821780// /
1783- // / This function returns a copy of the internally stored image database.
1781+ // / This function returns a copy of the internally stored image database, so any
1782+ // / changes to the copy will not affect the current configuration or session.
1783+ // /
1784+ // / If no @c ::ArAugmentedImageDatabase has been configured, a new empty
1785+ // / database will be constructed using @c ::ArAugmentedImageDatabase_create.
17841786void ArConfig_getAugmentedImageDatabase (
17851787 const ArSession *session,
17861788 const ArConfig *config,
@@ -5522,31 +5524,34 @@ void ArEarth_getCameraGeospatialPose(
55225524 ArGeospatialPose *out_camera_geospatial_pose);
55235525
55245526// / @ingroup ArEarth
5525- // / Creates a new @c ::ArAnchor at the specified geodetic location and
5527+ // / Creates a new @c ::ArAnchor at the specified geospatial location and
55265528// / orientation relative to the Earth.
55275529// /
55285530// / Latitude and longitude are defined by the
55295531// / <a href="https://en.wikipedia.org/wiki/World_Geodetic_System">WGS84
55305532// / specification</a>, and altitude values are defined as the elevation above
5531- // / the WGS84 ellipsoid in meters.
5533+ // / the WGS84 ellipsoid in meters. To create an anchor using an altitude
5534+ // / relative to the Earth's terrain instead of altitude above the WGS84
5535+ // / ellipsoid, use @c ::ArEarth_resolveAndAcquireNewAnchorOnTerrain.
55325536// /
55335537// / The rotation provided by @p eus_quaternion_4 is a rotation with respect to
55345538// / an east-up-south coordinate frame. An identity rotation will have the anchor
55355539// / oriented such that X+ points to the east, Y+ points up away from the center
55365540// / of the earth, and Z+ points to the south.
55375541// /
55385542// / To create an anchor that has the +Z axis pointing in the same direction as
5539- // / heading obtained from @c ::ArGeospatialPose, use the following formula:
5543+ // / heading contained in an @c ::ArGeospatialPose, use the following formula:
55405544// /
55415545// / \code
55425546// / {qx, qy, qz, qw} = {0, sin((pi - heading * M_PI / 180.0) / 2), 0, cos((pi -
55435547// / heading * M_PI / 180.0) / 2)}}.
55445548// / \endcode
55455549// /
5546- // / An anchor's @c ::ArTrackingState will be @c #AR_TRACKING_STATE_PAUSED while
5547- // / @c ::ArEarth is @c #AR_TRACKING_STATE_PAUSED. The tracking state will
5548- // / permanently become @c #AR_TRACKING_STATE_STOPPED if the @c ::ArSession
5549- // / configuration is set to @c #AR_GEOSPATIAL_MODE_DISABLED.
5550+ // / An anchor's @c ::ArTrackingState will be @c #AR_TRACKING_STATE_PAUSED
5551+ // / while @c ::ArEarth's @c ::ArTrackingState is @c #AR_TRACKING_STATE_PAUSED.
5552+ // / Its tracking state will permanently become @c
5553+ // / #AR_TRACKING_STATE_STOPPED if @c ::ArSession_configure sets the Geospatial
5554+ // / mode to @c #AR_GEOSPATIAL_MODE_DISABLED.
55505555// /
55515556// / Creating anchors near the north pole or south pole is not supported. If the
55525557// / latitude is within 0.1 degrees of the north pole or south pole (90 degrees
@@ -5579,6 +5584,151 @@ ArStatus ArEarth_acquireNewAnchor(ArSession *session,
55795584 const float *eus_quaternion_4,
55805585 ArAnchor **out_anchor);
55815586
5587+ // / @ingroup ArEarth
5588+ // / Creates a new @c ::ArAnchor at a specified horizontal position and altitude
5589+ // / relative to the horizontal position’s terrain. Terrain means the ground or
5590+ // / ground floor inside a building with VPS coverage. If the altitude relative
5591+ // / to the WGS84 ellipsoid is known, use @c ::ArEarth_acquireNewAnchor instead.
5592+ // /
5593+ // / The specified @p altitude_above_terrain is interpreted to be relative to the
5594+ // / Earth's terrain (or floor) at the specified latitude/longitude geospatial
5595+ // / coordinates, rather than relative to the WGS84 ellipsoid. Specifying an
5596+ // / altitude of 0 will position the anchor directly on the terrain (or floor)
5597+ // / whereas specifying a positive altitude will position the anchor above the
5598+ // / terrain (or floor), against the direction of gravity.
5599+ // /
5600+ // / This creates a new @c ::ArAnchor and schedules a task to resolve the
5601+ // / anchor's pose using the given parameters. You may resolve multiple anchors
5602+ // / at a time, but a session cannot be tracking more than 40 Terrain Anchors at
5603+ // / time. Attempting to resolve more than 40 Terrain Anchors will result in
5604+ // / resolve calls returning status @c #AR_ERROR_RESOURCE_EXHAUSTED.
5605+ // /
5606+ // / If this function returns @c #AR_SUCCESS, the Terrain Anchor state of @p
5607+ // / out_terrain_anchor will be @c #AR_TERRAIN_ANCHOR_STATE_TASK_IN_PROGRESS, and
5608+ // / its tracking state will be @c #AR_TRACKING_STATE_PAUSED. The anchor
5609+ // / remains in this state until its pose has been successfully resolved. If
5610+ // / the resolving task results in an error, its tracking state will be
5611+ // / permanently set to @c #AR_TRACKING_STATE_STOPPED, and @c
5612+ // / ::ArAnchor_getTerrainAnchorState details the error that occurred using @c
5613+ // / ::ArTerrainAnchorState. If this function's return value is not @c
5614+ // / #AR_SUCCESS, then @p out_anchor will be set to @c NULL.
5615+ // /
5616+ // / Creating a Terrain Anchor requires an active @c ::ArEarth which is @c
5617+ // / #AR_EARTH_STATE_ENABLED. If it is not, then this function returns @c
5618+ // / #AR_ERROR_ILLEGAL_STATE. This call also requires a working internet
5619+ // / connection to communicate with the ARCore API on Google Cloud. ARCore will
5620+ // / continue to retry if it is unable to establish a connection to the ARCore
5621+ // / service.
5622+ // /
5623+ // / A Terrain Anchor's @c ::ArTrackingState will be @c #AR_TRACKING_STATE_PAUSED
5624+ // / while @c ::ArEarth's @c ::ArTrackingState is @c #AR_TRACKING_STATE_PAUSED.
5625+ // / The anchor's tracking state will permanently become @c
5626+ // / #AR_TRACKING_STATE_STOPPED if @c ::ArSession_configure is used to set @c
5627+ // / #AR_GEOSPATIAL_MODE_DISABLED.
5628+ // /
5629+ // /
5630+ // / Latitude and longitude are defined by the
5631+ // / <a href="https://en.wikipedia.org/wiki/World_Geodetic_System">WGS84
5632+ // / specification</a>.
5633+ // /
5634+ // / The rotation provided by @p eus_quaternion_4 is a rotation with respect to
5635+ // / an east-up-south coordinate frame. An identity rotation will have the anchor
5636+ // / oriented such that X+ points to the east, Y+ points up away from the center
5637+ // / of the earth, and Z+ points to the south.
5638+ // /
5639+ // / To create an anchor that has the +Z axis pointing in the same direction as
5640+ // / heading contained in an @c ::ArGeospatialPose, use the following formula:
5641+ // /
5642+ // / \code
5643+ // / {qx, qy, qz, qw} = {0, sin((pi - heading * M_PI / 180.0) / 2), 0, cos((pi -
5644+ // / heading * M_PI / 180.0) / 2)}}.
5645+ // / \endcode
5646+ // /
5647+ // / @param[in] session The ARCore session.
5648+ // / @param[in] earth The @c ::ArEarth handle.
5649+ // / @param[in] latitude The latitude of the anchor relative to the
5650+ // / WGS84 ellipsoid.
5651+ // / @param[in] longitude The longitude of the anchor relative to the
5652+ // / WGS84 ellipsoid.
5653+ // / @param[in] altitude_above_terrain The altitude of the anchor above the
5654+ // / Earth's terrain (or floor).
5655+ // / @param[in] eus_quaternion_4 The rotation quaternion as {qx, qy, qx, qw}.
5656+ // / @param[out] out_anchor The newly-created anchor.
5657+ // / @return @c #AR_SUCCESS or any of:
5658+ // / - @c #AR_ERROR_ILLEGAL_STATE if @p earth's @c ::ArEarthState is not
5659+ // / @c #AR_EARTH_STATE_ENABLED.
5660+ // / - @c #AR_ERROR_INVALID_ARGUMENT if @p latitude is outside the allowable
5661+ // / range, or if either @p session, @p earth, or @p eus_quaternion_4 is @c
5662+ // / NULL.
5663+ // / - @c #AR_ERROR_RESOURCE_EXHAUSTED if too many terrain anchors are currently
5664+ // / held.
5665+ ArStatus ArEarth_resolveAndAcquireNewAnchorOnTerrain (
5666+ ArSession *session,
5667+ ArEarth *earth,
5668+ double latitude,
5669+ double longitude,
5670+ double altitude_above_terrain,
5671+ const float *eus_quaternion_4,
5672+ ArAnchor **out_anchor);
5673+
5674+ // / @ingroup ArAnchor
5675+ // / Describes the current Terrain Anchor state of an @c ::ArAnchor. Obtained by
5676+ // / @c ::ArAnchor_getTerrainAnchorState.
5677+ AR_DEFINE_ENUM (ArTerrainAnchorState){
5678+ // / This is not a Terrain Anchor, or the Terrain Anchor has become invalid
5679+ // / due to @c ::ArEarth having @c #AR_TRACKING_STATE_STOPPED
5680+ // / due to @c #AR_GEOSPATIAL_MODE_DISABLED being set on the @c ::ArSession.
5681+ // / All Terrain Anchors transition to @c #AR_TERRAIN_ANCHOR_STATE_NONE
5682+ // / when @c #AR_GEOSPATIAL_MODE_DISABLED becomes active on the @c
5683+ // / ::ArSession.
5684+ AR_TERRAIN_ANCHOR_STATE_NONE = 0 ,
5685+
5686+ // / Resolving the Terrain Anchor is in progress. Once the task completes in
5687+ // / the background, the anchor will get a new state after the next @c
5688+ // / ::ArSession_update call.
5689+ AR_TERRAIN_ANCHOR_STATE_TASK_IN_PROGRESS = 1 ,
5690+
5691+ // / A resolving task for this Terrain Anchor has finished successfully.
5692+ AR_TERRAIN_ANCHOR_STATE_SUCCESS = 2 ,
5693+
5694+ // / Resolving task for this Terrain Anchor finished with an internal
5695+ // / error. The app should not attempt to recover from this error.
5696+ AR_TERRAIN_ANCHOR_STATE_ERROR_INTERNAL = -1 ,
5697+
5698+ // / The authorization provided by the application is not valid.
5699+ // / - The Google Cloud project may not have enabled the ARCore API.
5700+ // / - When using API key authentication, this will happen if the API key in
5701+ // / the manifest is invalid or unauthorized. It may also fail if the API
5702+ // / key is restricted to a set of apps not including the current one.
5703+ // / - When using keyless authentication, this may happen when no OAuth
5704+ // / client has been created, or when the signing key and package name
5705+ // / combination does not match the values used in the Google Cloud
5706+ // / project. It may also fail if Google Play Services isn't installed,
5707+ // / is too old, or is malfunctioning for some reason (e.g. killed
5708+ // / due to memory pressure).
5709+ AR_TERRAIN_ANCHOR_STATE_ERROR_NOT_AUTHORIZED = -2 ,
5710+
5711+ // / There is no terrain info at this location, such as the center of the
5712+ // / ocean.
5713+ AR_TERRAIN_ANCHOR_STATE_ERROR_UNSUPPORTED_LOCATION = -3 ,
5714+ };
5715+
5716+ // / @ingroup ArAnchor
5717+ // / Gets the current Terrain Anchor state of the anchor. This state is
5718+ // / guaranteed not to change until @c ::ArSession_update is called. For Anchors
5719+ // / that are not Terrain Anchors, this function returns @c
5720+ // / #AR_TERRAIN_ANCHOR_STATE_NONE. See @c ::ArTerrainAnchorState for the
5721+ // / possible Terrain Anchor states.
5722+ // /
5723+ // / @param[in] session The ARCore session.
5724+ // / @param[in] anchor The anchor to retrieve the terrain anchor state of.
5725+ // / @param[inout] out_state The current terrain anchor state of the anchor.
5726+ // / Non-terrain anchors will always be in
5727+ // / @c #AR_TERRAIN_ANCHOR_STATE_NONE state.
5728+ void ArAnchor_getTerrainAnchorState (const ArSession *session,
5729+ const ArAnchor *anchor,
5730+ ArTerrainAnchorState *out_state);
5731+
55825732// === ArGeospatialPose functions ===
55835733
55845734// / @ingroup ArGeospatialPose
0 commit comments