Flutter Engine
The Flutter Engine
|
Typedefs | |
typedef struct ArHitResult_ | ArHitResult |
typedef struct ArHitResultList_ | ArHitResultList |
Functions | |
void | ArHitResultList_create (const ArSession *session, ArHitResultList **out_hit_result_list) |
Creates a hit result list object. More... | |
void | ArHitResultList_destroy (ArHitResultList *hit_result_list) |
void | ArHitResultList_getSize (const ArSession *session, const ArHitResultList *hit_result_list, int32_t *out_size) |
Retrieves the number of hit results in this list. More... | |
void | ArHitResultList_getItem (const ArSession *session, const ArHitResultList *hit_result_list, int32_t index, ArHitResult *out_hit_result) |
void | ArHitResult_create (const ArSession *session, ArHitResult **out_hit_result) |
Allocates an empty hit result object. More... | |
void | ArHitResult_destroy (ArHitResult *hit_result) |
void | ArHitResult_getDistance (const ArSession *session, const ArHitResult *hit_result, float *out_distance) |
Returns the distance from the camera to the hit location, in meters. More... | |
void | ArHitResult_getHitPose (const ArSession *session, const ArHitResult *hit_result, ArPose *out_pose) |
void | ArHitResult_acquireTrackable (const ArSession *session, const ArHitResult *hit_result, ArTrackable **out_trackable) |
ArStatus | ArHitResult_acquireNewAnchor (ArSession *session, ArHitResult *hit_result, ArAnchor **out_anchor) |
Defines an intersection between a ray and estimated real-world geometry.
typedef struct ArHitResult_ ArHitResult |
A single trackable hit (value type).
Allocate with ArHitResult_create()
Populate with ArHitResultList_getItem()
Release with ArHitResult_destroy()
Definition at line 369 of file arcore_c_api.h.
typedef struct ArHitResultList_ ArHitResultList |
A list of hit test results (value type).
Allocate with ArHitResultList_create()
Release with ArHitResultList_destroy()
Definition at line 375 of file arcore_c_api.h.
ArStatus ArHitResult_acquireNewAnchor | ( | ArSession * | session, |
ArHitResult * | hit_result, | ||
ArAnchor ** | out_anchor | ||
) |
Creates a new anchor at the hit location. See ArHitResult_getHitPose() for details. This is equivalent to creating an anchor on the hit trackable at the hit pose.
void ArHitResult_acquireTrackable | ( | const ArSession * | session, |
const ArHitResult * | hit_result, | ||
ArTrackable ** | out_trackable | ||
) |
Acquires reference to the hit trackable. This call must be paired with a call to ArTrackable_release().
void ArHitResult_create | ( | const ArSession * | session, |
ArHitResult ** | out_hit_result | ||
) |
Allocates an empty hit result object.
void ArHitResult_destroy | ( | ArHitResult * | hit_result | ) |
Releases the memory used by a hit result object, along with any trackable reference it holds.
void ArHitResult_getDistance | ( | const ArSession * | session, |
const ArHitResult * | hit_result, | ||
float * | out_distance | ||
) |
Returns the distance from the camera to the hit location, in meters.
void ArHitResult_getHitPose | ( | const ArSession * | session, |
const ArHitResult * | hit_result, | ||
ArPose * | out_pose | ||
) |
Returns the pose of the intersection between a ray and detected real-world geometry. The position is the location in space where the ray intersected the geometry. The orientation is a best effort to face the user's device, and its exact definition differs depending on the Trackable that was hit.
ArPlane : X+ is perpendicular to the cast ray and parallel to the plane, Y+ points along the plane normal (up, for #AR_PLANE_HORIZONTAL_UPWARD_FACING planes), and Z+ is parallel to the plane, pointing roughly toward the user's device.
ArPoint : Attempt to estimate the normal of the surface centered around the hit test. Surface normal estimation is most likely to succeed on textured surfaces and with camera motion. If ArPoint_getOrientationMode() returns ESTIMATED_SURFACE_NORMAL, then X+ is perpendicular to the cast ray and parallel to the physical surface centered around the hit test, Y+ points along the estimated surface normal, and Z+ points roughly toward the user's device. If ArPoint_getOrientationMode() returns INITIALIZED_TO_IDENTITY, then X+ is perpendicular to the cast ray and points right from the perspective of the user's device, Y+ points up, and Z+ points roughly toward the user's device.
If you wish to retain the location of this pose beyond the duration of a single frame, create an anchor using ArHitResult_acquireNewAnchor() to save the pose in a physically consistent way.
[in] | session | The ARCore session. |
[in] | hit_result | The hit result to retrieve the pose of. |
[in,out] | out_pose | An already-allocated ArPose object into which the pose will be stored. |
void ArHitResultList_create | ( | const ArSession * | session, |
ArHitResultList ** | out_hit_result_list | ||
) |
Creates a hit result list object.
void ArHitResultList_destroy | ( | ArHitResultList * | hit_result_list | ) |
Releases the memory used by a hit result list object, along with all the trackable references it holds.
void ArHitResultList_getItem | ( | const ArSession * | session, |
const ArHitResultList * | hit_result_list, | ||
int32_t | index, | ||
ArHitResult * | out_hit_result | ||
) |
Copies an indexed entry in the list. This acquires a reference to any trackable referenced by the item, and releases any reference currently held by the provided result object.
[in] | session | The ARCore session. |
[in] | hit_result_list | The list from which to copy an item. |
[in] | index | Index of the entry to copy. |
[in,out] | out_hit_result | An already-allocated ArHitResult object into which the result will be copied. |
void ArHitResultList_getSize | ( | const ArSession * | session, |
const ArHitResultList * | hit_result_list, | ||
int32_t * | out_size | ||
) |
Retrieves the number of hit results in this list.