ArAugmentedFace
Describes a face detected by ARCore and provides functions to access additional center and face region poses as well as face mesh related data.
Augmented Faces supports front-facing (selfie) camera only, and does not support attaching anchors nor raycast hit testing. Calling ArTrackable_acquireNewAnchor
will return AR_ERROR_ILLEGAL_STATE
.
Summary
Enumerations |
|
---|---|
ArAugmentedFaceRegionType{
|
enum Defines face regions to query the pose for. |
Typedefs |
|
---|---|
ArAugmentedFace
|
typedefstruct ArAugmentedFace_
A detected face trackable (reference type, long-lived). |
Functions |
|
---|---|
ArAugmentedFace_getCenterPose(const ArSession *session, const ArAugmentedFace *face, ArPose *out_pose)
|
void
Returns the pose of the center of the face.
|
ArAugmentedFace_getMeshNormals(const ArSession *session, const ArAugmentedFace *face, const float **out_normals, int32_t *out_number_of_normals)
|
void
Returns a pointer to an array of 3D normals in (x, y, z) packing, where each (x, y, z) is a unit vector of the normal to the surface at each vertex.
|
ArAugmentedFace_getMeshTextureCoordinates(const ArSession *session, const ArAugmentedFace *face, const float **out_texture_coordinates, int32_t *out_number_of_texture_coordinates)
|
void
Returns a pointer to an array of UV texture coordinates in (u, v) packing.
|
ArAugmentedFace_getMeshTriangleIndices(const ArSession *session, const ArAugmentedFace *face, const uint16_t **out_triangle_indices, int32_t *out_number_of_triangles)
|
void
Returns a pointer to an array of triangles indices in consecutive triplets.
|
ArAugmentedFace_getMeshVertices(const ArSession *session, const ArAugmentedFace *face, const float **out_vertices, int32_t *out_number_of_vertices)
|
void
Returns a pointer to an array of 3D vertices in (x, y, z) packing.
|
ArAugmentedFace_getRegionPose(const ArSession *session, const ArAugmentedFace *face, const ArAugmentedFaceRegionType region_type, ArPose *out_pose)
|
void
Returns the pose of a face region in world coordinates when the face trackable state is
AR_TRACKING_STATE_TRACKING . |
Enumerations
ArAugmentedFaceRegionType
ArAugmentedFaceRegionType
Defines face regions to query the pose for.
Left and right are defined relative to the person that the mesh belongs to. To retrieve the center pose use ArAugmentedFace_getCenterPose
.
Properties | |
---|---|
AR_AUGMENTED_FACE_REGION_FOREHEAD_LEFT
|
The region at the detected face's left side of the forehead. |
AR_AUGMENTED_FACE_REGION_FOREHEAD_RIGHT
|
The region at the detected face's right side of the forehead. |
AR_AUGMENTED_FACE_REGION_NOSE_TIP
|
The region at the tip of the nose. |
Typedefs
ArAugmentedFace
struct ArAugmentedFace_ ArAugmentedFace
A detected face trackable (reference type, long-lived).
- Trackable type:
AR_TRACKABLE_FACE
- Release with:
ArTrackable_release
Functions
ArAugmentedFace_getCenterPose
void ArAugmentedFace_getCenterPose( const ArSession *session, const ArAugmentedFace *face, ArPose *out_pose )
Returns the pose of the center of the face.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
ArAugmentedFace_getMeshNormals
void ArAugmentedFace_getMeshNormals( const ArSession *session, const ArAugmentedFace *face, const float **out_normals, int32_t *out_number_of_normals )
Returns a pointer to an array of 3D normals in (x, y, z) packing, where each (x, y, z) is a unit vector of the normal to the surface at each vertex.
There is exactly one normal vector for each vertex. These normals are relative to the center pose of the face.
The pointer returned by this function is valid until ArTrackable_release
or the next ArSession_update
is called. The application must copy the data if they wish to retain it for longer.
If the face's tracking state is AR_TRACKING_STATE_PAUSED
, then the value of the size of the returned array is 0.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
ArAugmentedFace_getMeshTextureCoordinates
void ArAugmentedFace_getMeshTextureCoordinates( const ArSession *session, const ArAugmentedFace *face, const float **out_texture_coordinates, int32_t *out_number_of_texture_coordinates )
Returns a pointer to an array of UV texture coordinates in (u, v) packing.
There is a pair of texture coordinates for each vertex. These values never change.
The pointer returned by this function is valid until ArTrackable_release
or the next ArSession_update
is called. The application must copy the data if they wish to retain it for longer.
If the face's tracking state is AR_TRACKING_STATE_PAUSED
, then the value of the size of the returned array is 0.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
ArAugmentedFace_getMeshTriangleIndices
void ArAugmentedFace_getMeshTriangleIndices( const ArSession *session, const ArAugmentedFace *face, const uint16_t **out_triangle_indices, int32_t *out_number_of_triangles )
Returns a pointer to an array of triangles indices in consecutive triplets.
Every three consecutive values are indices that represent a triangle. The vertex position and texture coordinates are mapped by the indices. The front face of each triangle is defined by the face where the vertices are in counter clockwise winding order. These values never change.
The pointer returned by this function is valid until ArTrackable_release
or the next ArSession_update
is called. The application must copy the data if they wish to retain it for longer.
If the face's tracking state is AR_TRACKING_STATE_PAUSED
, then the value of the size of the returned array is 0.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
ArAugmentedFace_getMeshVertices
void ArAugmentedFace_getMeshVertices( const ArSession *session, const ArAugmentedFace *face, const float **out_vertices, int32_t *out_number_of_vertices )
Returns a pointer to an array of 3D vertices in (x, y, z) packing.
These vertices are relative to the center pose of the face with units in meters.
The pointer returned by this function is valid until ArTrackable_release
or the next ArSession_update
is called. The application must copy the data if they wish to retain it for longer.
If the face's tracking state is AR_TRACKING_STATE_PAUSED
, then the value of the size of the returned array is 0.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
ArAugmentedFace_getRegionPose
void ArAugmentedFace_getRegionPose( const ArSession *session, const ArAugmentedFace *face, const ArAugmentedFaceRegionType region_type, ArPose *out_pose )
Returns the pose of a face region in world coordinates when the face trackable state is AR_TRACKING_STATE_TRACKING
.
When face trackable state is AR_TRACKING_STATE_PAUSED
, the identity pose will be returned.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|