Flutter Engine
The Flutter Engine
Typedefs | Functions
Anchor

Typedefs

typedef struct ArAnchor_ ArAnchor
 
typedef struct ArAnchorList_ ArAnchorList
 

Functions

void ArAnchorList_create (const ArSession *session, ArAnchorList **out_anchor_list)
 Creates an anchor list object. More...
 
void ArAnchorList_destroy (ArAnchorList *anchor_list)
 
void ArAnchorList_getSize (const ArSession *session, const ArAnchorList *anchor_list, int32_t *out_size)
 Retrieves the number of anchors in this list. More...
 
void ArAnchorList_acquireItem (const ArSession *session, const ArAnchorList *anchor_list, int32_t index, ArAnchor **out_anchor)
 
void ArAnchor_getPose (const ArSession *session, const ArAnchor *anchor, ArPose *out_pose)
 
void ArAnchor_getTrackingState (const ArSession *session, const ArAnchor *anchor, ArTrackingState *out_tracking_state)
 Retrieves the current state of the pose of this anchor. More...
 
void ArAnchor_detach (ArSession *session, ArAnchor *anchor)
 
void ArAnchor_release (ArAnchor *anchor)
 
void ArAnchor_acquireCloudAnchorId (ArSession *session, ArAnchor *anchor, char **out_cloud_anchor_id)
 
void ArAnchor_getCloudAnchorState (const ArSession *session, const ArAnchor *anchor, ArCloudAnchorState *out_state)
 

Detailed Description

Describes a fixed location and orientation in the real world.

Typedef Documentation

◆ ArAnchor

typedef struct ArAnchor_ ArAnchor

A position in space attached to a trackable (reference type, long-lived).

Create with ArSession_acquireNewAnchor() or ArHitResult_acquireNewAnchor()
Release with ArAnchor_release()

Definition at line 349 of file arcore_c_api.h.

◆ ArAnchorList

typedef struct ArAnchorList_ ArAnchorList

A list of anchors (value type).

Allocate with ArAnchorList_create()
Release with ArAnchorList_destroy()

Definition at line 355 of file arcore_c_api.h.

Function Documentation

◆ ArAnchor_acquireCloudAnchorId()

void ArAnchor_acquireCloudAnchorId ( ArSession session,
ArAnchor anchor,
char **  out_cloud_anchor_id 
)

Acquires the cloud anchor ID of the anchor. The ID acquired is an ASCII null-terminated string. The acquired ID must be released after use by the ArString_release function. For anchors with cloud state #AR_CLOUD_ANCHOR_STATE_NONE or #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS, this will always be an empty string.

Parameters
[in]sessionThe ARCore session.
[in]anchorThe anchor to retrieve the cloud ID of.
[in,out]out_cloud_anchor_idA pointer to the acquired ID string.

◆ ArAnchor_detach()

void ArAnchor_detach ( ArSession session,
ArAnchor anchor 
)

Tells ARCore to stop tracking and forget this anchor. This call does not release the reference to the anchor - that must be done separately using ArAnchor_release().

◆ ArAnchor_getCloudAnchorState()

void ArAnchor_getCloudAnchorState ( const ArSession session,
const ArAnchor anchor,
ArCloudAnchorState *  out_state 
)

Gets the current cloud anchor state of the anchor. This state is guaranteed not to change until update() is called.

Parameters
[in]sessionThe ARCore session.
[in]anchorThe anchor to retrieve the cloud state of.
[in,out]out_stateThe current cloud state of the anchor.

◆ ArAnchor_getPose()

void ArAnchor_getPose ( const ArSession session,
const ArAnchor anchor,
ArPose out_pose 
)

Retrieves the pose of the anchor in the world coordinate space. This pose produced by this call may change each time ArSession_update() is called. This pose should only be used for rendering if ArAnchor_getTrackingState() returns #AR_TRACKING_STATE_TRACKING.

Parameters
[in]sessionThe ARCore session.
[in]anchorThe anchor to retrieve the pose of.
[in,out]out_poseAn already-allocated ArPose object into which the pose will be stored.

◆ ArAnchor_getTrackingState()

void ArAnchor_getTrackingState ( const ArSession session,
const ArAnchor anchor,
ArTrackingState *  out_tracking_state 
)

Retrieves the current state of the pose of this anchor.

◆ ArAnchor_release()

void ArAnchor_release ( ArAnchor anchor)

Releases a reference to an anchor. This does not mean that the anchor will stop tracking, as it will be obtainable from e.g. ArSession_getAllAnchors() if any other references exist.

This method may safely be called with nullptr - it will do nothing.

◆ ArAnchorList_acquireItem()

void ArAnchorList_acquireItem ( const ArSession session,
const ArAnchorList anchor_list,
int32_t  index,
ArAnchor **  out_anchor 
)

Acquires a reference to an indexed entry in the list. This call must eventually be matched with a call to ArAnchor_release().

◆ ArAnchorList_create()

void ArAnchorList_create ( const ArSession session,
ArAnchorList **  out_anchor_list 
)

Creates an anchor list object.

◆ ArAnchorList_destroy()

void ArAnchorList_destroy ( ArAnchorList anchor_list)

Releases the memory used by an anchor list object, along with all the anchor references it holds.

◆ ArAnchorList_getSize()

void ArAnchorList_getSize ( const ArSession session,
const ArAnchorList anchor_list,
int32_t *  out_size 
)

Retrieves the number of anchors in this list.