Options
All
  • Public
  • Public/Protected
  • All
Menu

A mesh that fits to the user's face and deforms as the user's expression changes.

see

https://docs.zap.works/universal-ar/javascript/face-tracking/

Hierarchy

  • FaceMesh

Index

Constructors

constructor

Accessors

indices

  • get indices(): Uint16Array
  • Returns Uint16Array

    The indices of the mesh.

normals

  • get normals(): Float32Array
  • Returns Float32Array

    The normals of the mesh.

uvs

  • get uvs(): Float32Array
  • Returns Float32Array

    The UVs of the mesh.

vertices

  • get vertices(): Float32Array
  • Returns Float32Array

    The vertices of the mesh.

Methods

destroy

  • destroy(): void
  • Destroys the face mesh.

    Returns void

load

  • load(src?: string | ArrayBuffer, fillMouth?: boolean, fillEyeLeft?: boolean, fillEyeRight?: boolean, fillNeck?: boolean): Promise<void>
  • Loads the data for a face mesh.

    Parameters

    • Optional src: string | ArrayBuffer

      A URL or ArrayBuffer of the source mesh data.

    • Optional fillMouth: boolean

      If true, fills this face feature with polygons.

    • Optional fillEyeLeft: boolean

      If true, fills this face feature with polygons.

    • Optional fillEyeRight: boolean

      If true, fills this face feature with polygons.

    • Optional fillNeck: boolean

      If true, fills this face feature with polygons.

    Returns Promise<void>

    A promise that's resolved once the data is loaded.

loadDefault

  • loadDefault(): Promise<void>
  • Loads the default face mesh data.

    Returns Promise<void>

    A promise that's resolved once the data is loaded.

loadDefaultFace

  • loadDefaultFace(fillMouth?: boolean, fillEyeLeft?: boolean, fillEyeRight?: boolean): Promise<void>
  • Loads the default face mesh.

    Parameters

    • Optional fillMouth: boolean

      If true, fills this face feature with polygons.

    • Optional fillEyeLeft: boolean

      If true, fills this face feature with polygons.

    • Optional fillEyeRight: boolean

      If true, fills this face feature with polygons.

    Returns Promise<void>

    A promise that's resolved once the data is loaded.

loadDefaultFullHeadSimplified

  • loadDefaultFullHeadSimplified(fillMouth?: boolean, fillEyeLeft?: boolean, fillEyeRight?: boolean, fillNeck?: boolean): Promise<void>
  • The full head simplified mesh covers the whole of the user's head, including some neck. It's ideal for drawing into the depth buffer in order to mask out the back of 3D models placed on the user's head.

    Parameters

    • Optional fillMouth: boolean

      If true, fills this face feature with polygons.

    • Optional fillEyeLeft: boolean

      If true, fills this face feature with polygons.

    • Optional fillEyeRight: boolean

      If true, fills this face feature with polygons.

    • Optional fillNeck: boolean

      If true, fills this face feature with polygons.

    Returns Promise<void>

    A promise that's resolved once the data is loaded.

updateFromFaceAnchor

  • updateFromFaceAnchor(f: FaceAnchor, mirror?: boolean): void
  • Update the face mesh directly from a FaceAnchor.

    Parameters

    • f: FaceAnchor

      The face anchor.

    • Optional mirror: boolean

      Pass true to mirror the location in the X-axis.

    Returns void

updateFromIdentityExpression

  • updateFromIdentityExpression(identity: Float32Array, expression: Float32Array, mirror?: boolean): void
  • Updates the face mesh directly from a identity and expression coefficients.

    Parameters

    • identity: Float32Array

      The identity coefficients.

    • expression: Float32Array

      The expression coefficients.

    • Optional mirror: boolean

      Pass true to mirror the location in the X-axis.

    Returns void

Legend

  • Constructor
  • Property
  • Method

Generated using TypeDoc