Class ARFaceAnchor
java.lang.Object
com.codename1.ar.ARAnchor
com.codename1.ar.ARFaceAnchor
An anchor tracking a face in a ARTrackingMode#FACE session. The anchor
pose is centered on the head; named regions and an optional face mesh give
finer geometry for effects such as filters or virtual try-on.
Platform capabilities differ: region poses and the mesh may be null on
platforms that do not supply them - always handle the null case. Delivered
through the session's ARAnchorListener; use instanceof to distinguish
face anchors from plain anchors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint[]The face mesh triangle indices (three per triangle into#getMeshVertices()), or null when the platform supplies no mesh.float[]The face mesh vertices asx, y, ztriples in the anchor's local frame, or null when the platform supplies no mesh.getRegionPose(ARFaceRegion region) The pose of a named face region in world space, or null when the platform does not supply that region.Methods inherited from class ARAnchor
detach, getId, getNode, getPose, getTrackingState, isDetached, setNode
-
Constructor Details
-
ARFaceAnchor
-
-
Method Details
-
getRegionPose
The pose of a named face region in world space, or null when the platform does not supply that region.
Parameters
region: the face region to query
Returns
the region pose or null
-
getMeshVertices
public float[] getMeshVertices()The face mesh vertices asx, y, ztriples in the anchor's local frame, or null when the platform supplies no mesh. The array is the live buffer updated each frame; copy it if you need a stable snapshot. -
getMeshTriangles
public int[] getMeshTriangles()The face mesh triangle indices (three per triangle into#getMeshVertices()), or null when the platform supplies no mesh.
-