Flutter Engine
The Flutter Engine
Typedefs | Functions
Trackable

Typedefs

typedef struct ArTrackable_ ArTrackable
 Trackable base type (reference type, long-lived). More...
 
typedef struct ArTrackableList_ ArTrackableList
 

Functions

 AR_DEFINE_ENUM (ArTrackableType)
 
void ArTrackableList_create (const ArSession *session, ArTrackableList **out_trackable_list)
 Creates a trackable list object. More...
 
void ArTrackableList_destroy (ArTrackableList *trackable_list)
 
void ArTrackableList_getSize (const ArSession *session, const ArTrackableList *trackable_list, int32_t *out_size)
 Retrieves the number of trackables in this list. More...
 
void ArTrackableList_acquireItem (const ArSession *session, const ArTrackableList *trackable_list, int32_t index, ArTrackable **out_trackable)
 
void ArTrackable_release (ArTrackable *trackable)
 
void ArTrackable_getType (const ArSession *session, const ArTrackable *trackable, ArTrackableType *out_trackable_type)
 Retrieves the type of the trackable. See ::ArTrackableType for valid types. More...
 
void ArTrackable_getTrackingState (const ArSession *session, const ArTrackable *trackable, ArTrackingState *out_tracking_state)
 
ArStatus ArTrackable_acquireNewAnchor (ArSession *session, ArTrackable *trackable, ArPose *pose, ArAnchor **out_anchor)
 
void ArTrackable_getAnchors (const ArSession *session, const ArTrackable *trackable, ArAnchorList *out_anchor_list)
 

Detailed Description

Something that can be tracked and that Anchors can be attached to.

Typedef Documentation

◆ ArTrackable

typedef struct ArTrackable_ ArTrackable

Trackable base type (reference type, long-lived).

Definition at line 265 of file arcore_c_api.h.

◆ ArTrackableList

typedef struct ArTrackableList_ ArTrackableList

A list of ArTrackables (value type).

Allocate with ArTrackableList_create()
Release with ArTrackableList_destroy()

Definition at line 271 of file arcore_c_api.h.

Function Documentation

◆ AR_DEFINE_ENUM()

AR_DEFINE_ENUM ( ArTrackableType  )

Object types for heterogeneous query/update lists.

The base Trackable type. Can be passed to ArSession_getAllTrackables() and ArFrame_getUpdatedTrackables() as the filter_type to get all/updated Trackables of all types.

The ArPlane subtype of Trackable.

The ArPoint subtype of Trackable.

The ArAugmentedImage subtype of Trackable.

An invalid Trackable type.

Definition at line 450 of file arcore_c_api.h.

450 {
451 /// The base Trackable type. Can be passed to ArSession_getAllTrackables()
452 /// and ArFrame_getUpdatedTrackables() as the @c filter_type to get
453 /// all/updated Trackables of all types.
454 AR_TRACKABLE_BASE_TRACKABLE = 0x41520100,
455
456 /// The ::ArPlane subtype of Trackable.
457 AR_TRACKABLE_PLANE = 0x41520101,
458
459 /// The ::ArPoint subtype of Trackable.
460 AR_TRACKABLE_POINT = 0x41520102,
461
462 /// The ::ArAugmentedImage subtype of Trackable.
463 AR_TRACKABLE_AUGMENTED_IMAGE = 0x41520104,
464
465 /// An invalid Trackable type.
466 AR_TRACKABLE_NOT_VALID = 0};

◆ ArTrackable_acquireNewAnchor()

ArStatus ArTrackable_acquireNewAnchor ( ArSession session,
ArTrackable trackable,
ArPose pose,
ArAnchor **  out_anchor 
)

Creates an Anchor at the given pose in the world coordinate space, attached to this Trackable, and acquires a reference to it. The type of Trackable will determine the semantics of attachment and how the Anchor's pose will be updated to maintain this relationship. Note that the relative offset between the pose of multiple Anchors attached to a Trackable may adjust slightly over time as ARCore updates its model of the world.

Returns
#AR_SUCCESS or any of:
  • #AR_ERROR_NOT_TRACKING if the trackable's tracking state was not #AR_TRACKING_STATE_TRACKING
  • #AR_ERROR_SESSION_PAUSED if the session was paused
  • #AR_ERROR_RESOURCE_EXHAUSTED if too many anchors exist

◆ ArTrackable_getAnchors()

void ArTrackable_getAnchors ( const ArSession session,
const ArTrackable trackable,
ArAnchorList out_anchor_list 
)

Gets the set of anchors attached to this trackable.

Parameters
[in]sessionThe ARCore session
[in]trackableThe trackable to query the anchors of.
[in,out]out_anchor_listThe list to fill. This list must have already been allocated with ArAnchorList_create(). If previously used, the list will first be cleared.

◆ ArTrackable_getTrackingState()

void ArTrackable_getTrackingState ( const ArSession session,
const ArTrackable trackable,
ArTrackingState *  out_tracking_state 
)

Retrieves the current state of ARCore's knowledge of the pose of this trackable.

◆ ArTrackable_getType()

void ArTrackable_getType ( const ArSession session,
const ArTrackable trackable,
ArTrackableType *  out_trackable_type 
)

Retrieves the type of the trackable. See ::ArTrackableType for valid types.

◆ ArTrackable_release()

void ArTrackable_release ( ArTrackable trackable)

Releases a reference to a trackable. This does not mean that the trackable will necessarily stop tracking. The same trackable may still be included in from other calls, for example ArSession_getAllTrackables().

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

◆ ArTrackableList_acquireItem()

void ArTrackableList_acquireItem ( const ArSession session,
const ArTrackableList trackable_list,
int32_t  index,
ArTrackable **  out_trackable 
)

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

◆ ArTrackableList_create()

void ArTrackableList_create ( const ArSession session,
ArTrackableList **  out_trackable_list 
)

Creates a trackable list object.

◆ ArTrackableList_destroy()

void ArTrackableList_destroy ( ArTrackableList trackable_list)

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

◆ ArTrackableList_getSize()

void ArTrackableList_getSize ( const ArSession session,
const ArTrackableList trackable_list,
int32_t *  out_size 
)

Retrieves the number of trackables in this list.