AugmentedFaceNode

public class AugmentedFaceNode

Node used to render visual effects on a face with ARCore's AugmentedFace feature.

The visual effects can consist of up to two components: The face mesh and the face regions renderable.

The face mesh is used for visualizing 2d images mapped to the surface of someone's face. The face regions renderable is used for visualizing 3d objects (e.g. fox nose and ears) that will move with the regions of the face that are tracked by ARCore.

When creating a face regions Renderable, the regions are mapped to bones in the model. Use the provided sample .fbx file to export a face regions renderable in the correct format.

This node is positioned to match the pose from getCenterPose().

The visual effects will be disabled when the AugmentedFace isn't tracking or the AugmentedFace is set to null.

Public Constructors

AugmentedFaceNode()
Create an AugmentedFaceNode with no AugmentedFace.
AugmentedFaceNode(AugmentedFace augmentedFace)
Create an AugmentedFaceNode with the given AugmentedFace.

Public Methods

AugmentedFace
getAugmentedFace()
Returns the AugmentedFace that this Node is applying visual effects to.
Material
getFaceMeshMaterialOverride()
Returns the material currently overriding how the face mesh is rendered.
Texture
getFaceMeshTexture()
Returns the texture rendered on the face mesh.
ModelRenderable
getFaceRegionsRenderable()
Returns the Renderable that is mapped to the regions o the face.
void
onActivate()
Handles when this node becomes active.
void
onUpdate(FrameTime frameTime)
Handles when this node is updated.
void
setAugmentedFace(AugmentedFace face)
Sets the AugmentedFace that this node is applying visual effects to.
void
setFaceMeshMaterialOverride(Material material)
Sets the material used to render the face mesh.
void
setFaceMeshTexture(Texture texture)
Sets the texture rendered on the face mesh.
void
setFaceRegionsRenderable(ModelRenderable renderable)
Sets the Renderable that is mapped to the regions of the face.

Inherited Methods

Public Constructors

public AugmentedFaceNode ()

Create an AugmentedFaceNode with no AugmentedFace.

public AugmentedFaceNode (AugmentedFace augmentedFace)

Create an AugmentedFaceNode with the given AugmentedFace.

Parameters
augmentedFace

Public Methods

public AugmentedFace getAugmentedFace ()

Returns the AugmentedFace that this Node is applying visual effects to.

public Material getFaceMeshMaterialOverride ()

Returns the material currently overriding how the face mesh is rendered. Defaults to null.

public Texture getFaceMeshTexture ()

Returns the texture rendered on the face mesh. Defaults to null.

Note: This is only used if the face mesh material hasn't been overridden.

public ModelRenderable getFaceRegionsRenderable ()

Returns the Renderable that is mapped to the regions o the face. It must be rigged with bones that match the face regions. Use the provided sample .fbx file to export a face regions renderable in the correct format.

public void onActivate ()

Handles when this node becomes active. A Node is active if it's enabled, part of a scene, and its parent is active.

Override to perform any setup that needs to occur when the node is activated.

public void onUpdate (FrameTime frameTime)

Handles when this node is updated. A node is updated before rendering each frame. This is only called when the node is active.

Override to perform any updates that need to occur each frame.

Parameters
frameTime provides time information for the current frame

public void setAugmentedFace (AugmentedFace face)

Sets the AugmentedFace that this node is applying visual effects to.

Parameters
face

public void setFaceMeshMaterialOverride (Material material)

Sets the material used to render the face mesh. The overriding material will not use getFaceMeshTexture(). Set back to null to revert to the default material.

Parameters
material

public void setFaceMeshTexture (Texture texture)

Sets the texture rendered on the face mesh.

Note: This is only used if the face mesh material hasn't been overridden.

Parameters
texture

public void setFaceRegionsRenderable (ModelRenderable renderable)

Sets the Renderable that is mapped to the regions of the face. It must be rigged with bones that match the face regions. Use the provided sample .fbx file to export a face regions renderable in the correct format.

Parameters
renderable