Skip to main content

Class: DetectedFace

Defined in: src/world/faces/DetectedFace.ts:100

Represents a single human face detected in physical space. Inherits from THREE.Object3D to fit naturally into the Three.js scene graph, positioning itself at the estimated nose tip of the tracked face. When a facial transformation matrix is emitted by the backend it is decomposed onto position, quaternion, and scale so the Object3D directly represents the rigid head pose.

Extends

Constructors

Constructor

new DetectedFace(faceId, landmarks, detection2DBoundingBox, blendshapes, facialTransformationMatrix): DetectedFace

Defined in: src/world/faces/DetectedFace.ts:115

Creates an instance of DetectedFace.

Parameters

faceId

number

A unique tracking identifier for this face.

landmarks

FaceLandmark[]

The 478 raw + 3D-projected facial landmarks.

detection2DBoundingBox

Box2

The 2D bounding box of the face in normalized screen space.

blendshapes

FaceBlendshape[] = []

Optional 52 ARKit-style blendshape weights. Empty when the backend was configured with outputFaceBlendshapes: false.

facialTransformationMatrix

Optional 4x4 rigid head pose matrix in world space. Null when the backend was configured with outputFacialTransformationMatrixes: false.

Matrix4 | null

Returns

DetectedFace

Overrides

THREE.Object3D.constructor

Properties

blendshapes

blendshapes: FaceBlendshape[] = []

Defined in: src/world/faces/DetectedFace.ts:119

Optional 52 ARKit-style blendshape weights. Empty when the backend was configured with outputFaceBlendshapes: false.


detection2DBoundingBox

detection2DBoundingBox: Box2

Defined in: src/world/faces/DetectedFace.ts:118

The 2D bounding box of the face in normalized screen space.


faceId

faceId: number

Defined in: src/world/faces/DetectedFace.ts:116

A unique tracking identifier for this face.


facialTransformationMatrix

facialTransformationMatrix: Matrix4 | null = null

Defined in: src/world/faces/DetectedFace.ts:120

Optional 4x4 rigid head pose matrix in world space. Null when the backend was configured with outputFacialTransformationMatrixes: false.


landmarks

landmarks: FaceLandmark[]

Defined in: src/world/faces/DetectedFace.ts:117

The 478 raw + 3D-projected facial landmarks.

Methods

getBlendshape()

getBlendshape(categoryName): number

Defined in: src/world/faces/DetectedFace.ts:163

Returns the score for a blendshape category, or 0 if the category isn't present in the current detection.

Parameters

categoryName

string

The ARKit category name, e.g. jawOpen.

Returns

number


getLandmarkPosition()

getLandmarkPosition(name): Vector3 | null

Defined in: src/world/faces/DetectedFace.ts:150

Returns the 3D world-space position of a named facial landmark.

Parameters

name

FaceLandmarkName

The landmark name to look up.

Returns

Vector3 | null

A clone of the landmark's world position, or null if the index is out of range or depth back-projection was unsuccessful.