119119// / @defgroup hit HitResult
120120// / Defines an intersection between a ray and estimated real-world geometry.
121121
122- // / @defgroup image ImageMetadata
122+ // / @defgroup image Image
123123// / Provides access to metadata from the camera image capture result.
124124
125125// / @defgroup intrinsics Intrinsics
@@ -385,9 +385,13 @@ typedef struct ArAugmentedImageDatabase_ ArAugmentedImageDatabase;
385385// / A position in space attached to a trackable
386386// / (@ref ownership "reference type, long-lived").
387387// /
388- // / Create with ArSession_acquireNewAnchor() or
389- // / ArHitResult_acquireNewAnchor()<br>
390- // / Release with ArAnchor_release()
388+ // / To create a new anchor call ArSession_acquireNewAnchor() or
389+ // / ArHitResult_acquireNewAnchor().<br>
390+ // / To have ARCore stop tracking the anchor, call ArAnchor_detach().<br>
391+ // / To release the memory associated with this anchor reference, call
392+ // / ArAnchor_release(). Note that, this will not cause ARCore to stop tracking
393+ // / the anchor. Other references to the same anchor acquired through
394+ // / ArAnchorList_acquireItem() are unaffected.
391395typedef struct ArAnchor_ ArAnchor;
392396
393397// / A list of anchors (@ref ownership "value type").
@@ -977,22 +981,40 @@ ArStatus ArCoreApk_requestInstallCustom(void *env,
977981// / @addtogroup session
978982// / @{
979983
980- // / Attempts to create a new ARCore session.
984+ // / Creates a new ARCore session. Prior to calling this function, your app must
985+ // / check that ARCore is installed by verifying that either:
981986// /
982- // / This is the entry point of ARCore. This function MUST be the first ARCore
983- // / call made by an application.
987+ // / - ArCoreApk_requestInstall() or ArCoreApk_requestInstallCustom() returns
988+ // / #AR_INSTALL_STATUS_INSTALLED, or
989+ // / - ArCoreApk_checkAvailability() returns
990+ // / #AR_AVAILABILITY_SUPPORTED_INSTALLED.
991+ // /
992+ // / This check must be performed prior to creating an ArSession, otherwise
993+ // / ArSession creation will fail, and subsequent installation or upgrade of
994+ // / ARCore will require an app restart and might cause Android to kill your app.
984995// /
985996// / @param[in] env The application's @c JNIEnv object
986997// / @param[in] application_context A @c jobject referencing the application's
987998// / Android @c Context
988999// / @param[out] out_session_pointer A pointer to an @c ArSession* to receive
9891000// / the address of the newly allocated session.
9901001// / @return #AR_SUCCESS or any of:
991- // / - #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED
992- // / - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE
993- // / - #AR_UNAVAILABLE_APK_TOO_OLD
994- // / - #AR_UNAVAILABLE_SDK_TOO_OLD
995- // / - #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED
1002+ // / - #AR_ERROR_FATAL if an internal error occurred while creating the session.
1003+ // / `adb logcat` may contain useful information.
1004+ // / - #AR_ERROR_CAMERA_PERMISSION_NOT_GRANTED if your app does not have the
1005+ // / [CAMERA](https://developer.android.com/reference/android/Manifest.permission.html#CAMERA)
1006+ // / permission.
1007+ // / - #AR_UNAVAILABLE_ARCORE_NOT_INSTALLED if the ARCore APK is not present.
1008+ // / This can be prevented by the installation check described above.
1009+ // / - #AR_UNAVAILABLE_DEVICE_NOT_COMPATIBLE if the device is not compatible with
1010+ // / ARCore. If encountered after completing the installation check, this
1011+ // / usually indicates a user has side-loaded ARCore onto an incompatible
1012+ // / device.
1013+ // / - #AR_UNAVAILABLE_APK_TOO_OLD if the installed ARCore APK is too old for the
1014+ // / ARCore SDK with which this application was built. This can be prevented by
1015+ // / the installation check described above.
1016+ // / - #AR_UNAVAILABLE_SDK_TOO_OLD if the ARCore SDK that this app was built with
1017+ // / is too old and no longer supported by the installed ARCore APK.
9961018ArStatus ArSession_create (void *env,
9971019 void *application_context,
9981020 ArSession **out_session_pointer);
@@ -1384,10 +1406,13 @@ ArStatus ArSession_resolveAndAcquireNewCloudAnchor(ArSession *session,
13841406// /
13851407// / The list will always return 3 camera configs. The GPU texture resolutions
13861408// / are the same in all three configs. Currently, most devices provide GPU
1387- // / texture resolution of 1920 x 1080, but devices might provide higher or lower
1388- // / resolution textures, depending on device capabilities. The CPU image
1389- // / resolutions returned are VGA, 720p, and a resolution matching the GPU
1390- // / texture.
1409+ // / texture resolution of 1920 x 1080 but this may vary with device
1410+ // / capabilities. The CPU image resolutions returned are VGA, a middle
1411+ // / resolution, and a large resolution matching the GPU texture. The middle
1412+ // / resolution will often be 1280 x 720, but may vary with device capabilities.
1413+ // /
1414+ // / Note: Prior to ARCore 1.6 the middle CPU image resolution was guaranteed to
1415+ // / be 1280 x 720 on all devices.
13911416// /
13921417// / @param[in] session The ARCore session
13931418// / @param[inout] list The list to fill. This list must have already
@@ -1479,17 +1504,28 @@ void ArPose_getMatrix(const ArSession *session,
14791504// / @addtogroup camera
14801505// / @{
14811506
1482- // / Sets @c out_pose to the pose of the user's device in the world coordinate
1483- // / space at the time of capture of the current camera texture. The position and
1484- // / orientation of the pose follow the device's physical camera (they are not
1485- // / affected by display orientation), <b>but are rotated around the Z axis by a
1486- // / multiple of 90° to (approximately) align the axes with those of the <a
1487- // / href="https://developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords"
1488- // / >Android Sensor Coordinate System</a></b>.
1489- // /
1490- // / This function will be deprecated in a future version of ARCore and replaced
1491- // / with one that returns the camera's actual physical pose without the 90°
1492- // / rotation.
1507+ // / Sets @c out_pose to the pose of the physical camera in world space for the
1508+ // / latest frame. This is an OpenGL camera pose with +X pointing right, +Y
1509+ // / pointing right up, -Z pointing in the direction the camera is looking, with
1510+ // / "right" and "up" being relative to the image readout in the usual
1511+ // / left-to-right top-to-bottom order. Specifically, this is the camera pose at
1512+ // / the center of exposure of the center row of the image.
1513+ // /
1514+ // / <b>For applications using the SDK for ARCore 1.5 and earlier</b>, the
1515+ // / returned pose is rotated around the Z axis by a multiple of 90 degrees so
1516+ // / that the axes correspond approximately to those of the <a
1517+ // / href="https://developer.android.com/guide/topics/sensors/sensors_overview#sensors-coords">Android
1518+ // / Sensor Coordinate System</a>.
1519+ // /
1520+ // / See Also:
1521+ // /
1522+ // / * ArCamera_getDisplayOrientedPose() for the pose of the virtual camera. It
1523+ // / will differ by a local rotation about the Z axis by a multiple of 90
1524+ // / degrees.
1525+ // / * ArFrame_getAndroidSensorPose() for the pose of the Android sensor frame.
1526+ // / It will differ in both orientation and location.
1527+ // / * ArFrame_transformDisplayUvCoords() to convert viewport coordinates to
1528+ // / texture coordinates.
14931529// /
14941530// / Note: This pose is only useful when ArCamera_getTrackingState() returns
14951531// / #AR_TRACKING_STATE_TRACKING and otherwise should not be used.
@@ -1502,18 +1538,24 @@ void ArCamera_getPose(const ArSession *session,
15021538 const ArCamera *camera,
15031539 ArPose *out_pose);
15041540
1505- // / Sets @c out_pose to the pose of the user's device in the world coordinate
1506- // / space at the time of capture of the current camera texture. The position of
1507- // / the pose is located at the device's camera, while the orientation
1508- // / approximately matches the orientation of the display (considering display
1509- // / rotation), using OpenGL camera conventions (+X right, +Y up, -Z in the
1510- // / direction the camera is looking).
1541+ // / Sets @c out_pose to the virtual camera pose in world space for rendering AR
1542+ // / content onto the latest frame. This is an OpenGL camera pose with +X
1543+ // / pointing right, +Y pointing up, and -Z pointing in the direction the camera
1544+ // / is looking, with "right" and "up" being relative to current logical display
1545+ // / orientation.
1546+ // /
1547+ // / See Also:
1548+ // /
1549+ // / * ArCamera_getViewMatrix() to conveniently compute the OpenGL View Matrix.
1550+ // / * ArCamera_getPose() for the physical pose of the camera. It will differ by
1551+ // / a local rotation about the Z axis by a multiple of 90 degrees.
1552+ // / * ArFrame_getAndroidSensorPose() for the pose of the android sensor frame.
1553+ // / It will differ in both orientation and location.
1554+ // / * ArSession_setDisplayGeometry() to update the display rotation.
15111555// /
15121556// / Note: This pose is only useful when ArCamera_getTrackingState() returns
15131557// / #AR_TRACKING_STATE_TRACKING and otherwise should not be used.
15141558// /
1515- // / See also: ArCamera_getViewMatrix()
1516- // /
15171559// / @param[in] session The ARCore session
15181560// / @param[in] camera The session's camera (retrieved from any frame).
15191561// / @param[inout] out_pose An already-allocated ArPose object into which the
@@ -1560,16 +1602,23 @@ void ArCamera_getProjectionMatrix(const ArSession *session,
15601602 float *dest_col_major_4x4);
15611603
15621604// / Retrieves the unrotated and uncropped intrinsics for the image (CPU) stream.
1563- // / @param camera The intrinsics may change per frame, so this should be called
1605+ // / The intrinsics may change per frame, so this should be called
15641606// / on each frame to get the intrinsics for the current frame.
1607+ // /
1608+ // / @param[in] session The ARCore session
1609+ // / @param[in] camera The session's camera.
1610+ // / @param[inout] out_camera_intrinsics The camera_intrinsics data.
15651611void ArCamera_getImageIntrinsics (const ArSession *session,
15661612 const ArCamera *camera,
15671613 ArCameraIntrinsics *out_camera_intrinsics);
15681614
15691615// / Retrieves the unrotated and uncropped intrinsics for the texture (GPU)
1570- // / stream.
1571- // / @param camera The intrinsics may change per frame, so this should be called
1616+ // / stream. The intrinsics may change per frame, so this should be called
15721617// / on each frame to get the intrinsics for the current frame.
1618+ // /
1619+ // / @param[in] session The ARCore session
1620+ // / @param[in] camera The session's camera.
1621+ // / @param[inout] out_camera_intrinsics The camera_intrinsics data.
15731622void ArCamera_getTextureIntrinsics (const ArSession *session,
15741623 const ArCamera *camera,
15751624 ArCameraIntrinsics *out_camera_intrinsics);
@@ -1587,6 +1636,9 @@ void ArCamera_release(ArCamera *camera);
15871636// / @{
15881637
15891638// / Allocates a camera intrinstics object.
1639+ // /
1640+ // / @param[in] session The ARCore session
1641+ // / @param[inout] out_camera_intrinsics The camera_intrinsics data.
15901642void ArCameraIntrinsics_create (const ArSession *session,
15911643 ArCameraIntrinsics **out_camera_intrinsics);
15921644
@@ -1647,10 +1699,18 @@ void ArFrame_getTimestamp(const ArSession *session,
16471699 int64_t *out_timestamp_ns);
16481700
16491701// / Sets @c out_pose to the pose of the <a
1650- // / href="https://developer.android.com/guide/topics/sensors/sensors_overview.html#sensors-coords"
1651- // / >Android Sensor Coordinate System</a> in the world coordinate space at the
1652- // / time of capture of the current camera texture. The orientation follows the
1653- // / device's "native" orientation (it is not affected by display orientation).
1702+ // / href="https://developer.android.com/guide/topics/sensors/sensors_overview#sensors-coords">Android
1703+ // / Sensor Coordinate System</a> in the world coordinate space for this frame.
1704+ // / The orientation follows the device's "native" orientation (it is not
1705+ // / affected by display rotation) with all axes corresponding to those of the
1706+ // / Android sensor coordinates.
1707+ // /
1708+ // / See Also:
1709+ // /
1710+ // / * ArCamera_getDisplayOrientedPose() for the pose of the virtual camera.
1711+ // / * ArCamera_getPose() for the pose of the physical camera.
1712+ // / * ArFrame_getTimestamp() for the system time that this pose was estimated
1713+ // / for.
16541714// /
16551715// / Note: This pose is only useful when ArCamera_getTrackingState() returns
16561716// / #AR_TRACKING_STATE_TRACKING and otherwise should not be used.
@@ -2036,13 +2096,12 @@ void ArAnchor_getTrackingState(const ArSession *session,
20362096 ArTrackingState *out_tracking_state);
20372097
20382098// / Tells ARCore to stop tracking and forget this anchor. This call does not
2039- // / release the reference to the anchor - that must be done separately using
2099+ // / release any references to the anchor - that must be done separately using
20402100// / ArAnchor_release().
20412101void ArAnchor_detach (ArSession *session, ArAnchor *anchor);
20422102
2043- // / Releases a reference to an anchor. This does not mean that the anchor will
2044- // / stop tracking, as it will be obtainable from e.g. ArSession_getAllAnchors()
2045- // / if any other references exist.
2103+ // / Releases a reference to an anchor. To stop tracking for this anchor, call
2104+ // / ArAnchor_detach() first.
20462105// /
20472106// / This method may safely be called with @c nullptr - it will do nothing.
20482107void ArAnchor_release (ArAnchor *anchor);
0 commit comments