Passer au contenu principal

Face Events

Events

facefound

This event is emitted by Face Effects when a face is first found.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face
transformTransformObjectTransform information of the located face.
vertices[{x, y, z}]Position of face points, relative to transform.
normals[{x, y, z}]Normal direction of vertices, relative to transform.
attachmentPoints{ name, position: {x,y,z} }See XR8.FaceController.AttachmentPoints for list of available attachment points. position is relative to the transform.
uvsInCameraFrame[{u, v}]The list of uv positions in the camera frame corresponding to the returned vertex points.
TransformObject
PropertyTypeDescription
position{x, y, z}The 3d position of the located face.
rotation{w, x, y, z}The 3d local orientation of the located face.
scaleNumberA scale factor that should be applied to objects attached to this face.
scaledWidthNumberApproximate width of the head in the scene when multiplied by scale.
scaledHeightNumberApproximate height of the head in the scene when multiplied by scale.
scaledDepthNumberApproximate depth of the head in the scene when multiplied by scale.

Example

world.events.addListener(world.events.globalId, 'facecontroller.facefound', (e) => {
console.log(e)
})

faceloading

This event is emitted by Face Effects when loading begins for additional face AR resources.

Properties

PropertyTypeDescription
maxDetectionsNumberThe maximum number of faces that can be simultaneously processed.
pointsPerDetectionNumberNumber of vertices that will be extracted per face.
indices[{a, b, c}]Indexes into the vertices array that form the triangles of the requested mesh, as specified with meshGeometry on configure.
uvs[{u, v}]uv positions into a texture map corresponding to the returned vertex points.

Example

world.events.addListener(world.events.globalId, 'facecontroller.faceloading', (e) => {
console.log(e)
})

facelost

This event is emitted by Face Effects when a face is no longer being tracked.

Properties

PropertyTypeDescription
idNumberA numerical id of the face that was lost.

Example

world.events.addListener(world.events.globalId, 'facecontroller.facelost', (e) => {
console.log(e)
})

facescanning

This event is emitted by Face Effects when all face AR resources have been loaded and scanning has begun.

Properties

PropertyTypeDescription
maxDetectionsNumberThe maximum number of faces that can be simultaneously processed.
pointsPerDetectionNumberNumber of vertices that will be extracted per face.
indices[{a, b, c}]Indexes into the vertices array that form the triangles of the requested mesh, as specified with meshGeometry on configure.
uvs[{u, v}]uv positions into a texture map corresponding to the returned vertex points.

Example

world.events.addListener(world.events.globalId, 'facecontroller.facescanning', (e) => {
console.log(e)
})

faceupdated

This event is emitted by Face Effects when faces are subsequently found.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face
transformTransformObjectTransform information of the located face.
vertices[{x, y, z}]Position of face points, relative to transform.
normals[{x, y, z}]Normal direction of vertices, relative to transform.
attachmentPoints{ name, position: {x,y,z} }See XR8.FaceController.AttachmentPoints for list of available attachment points. position is relative to the transform.
uvsInCameraFrame[{u, v}]The list of uv positions in the camera frame corresponding to the returned vertex points.

Example

world.events.addListener(world.events.globalId, 'facecontroller.faceupdated', (e) => {
console.log(e)
})

blinked

This event is emitted by Face Effects when a tracked face's eyes blink.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face

Example

world.events.addListener(world.events.globalId, 'facecontroller.blinked', (e) => {
console.log(e)
})

interpupillarydistance

This event is emitted by Face Effects when a tracked face's distance in millimeters between the centers of each pupil is first detected.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.
interpupillaryDistanceNumberApproximate distance in millimeters between the centers of each pupil.

Example

world.events.addListener(world.events.globalId, 'facecontroller.interpupillarydistance', (e) => {
console.log(e)
})

lefteyebrowlowered

This event is emitted by Face Effects when a tracked face's distance in millimeters between the centers of each pupil is first detected.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.lefteyebrowlowered', (e) => {
console.log(e)
})

lefteyebrowraised

This event is emitted by Face Effects when a tracked face's left eyebrow is raised from its initial position when the face was found.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.lefteyebrowraised', (e) => {
console.log(e)
})

lefteyeclosed

This event is emitted by Face Effects when a tracked face's left eye closes.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.lefteyeclosed', (e) => {
console.log(e)
})

lefteyeopened

This event is emitted by Face Effects when a tracked face's left eye opens.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.lefteyeopened', (e) => {
console.log(e)
})

lefteyewinked

This event is emitted by Face Effects when a tracked face's left eye closes and opens within 750ms while the right eye remains open.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.lefteyewinked', (e) => {
console.log(e)
})

mouthclosed

This event is emitted by Face Effects when a tracked face's mouth closes.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.mouthclosed', (e) => {
console.log(e)
})

mouthopened

This event is emitted by Face Effects when a tracked face's mouth opens.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.mouthopened', (e) => {
console.log(e)
})

righteyebrowlowered

This event is emitted by Face Effects when a tracked face's right eyebrow is lowered to its initial position when the face was found.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.righteyebrowlowered', (e) => {
console.log(e)
})

righteyebrowraised

This event is emitted by Face Effects when a tracked face's right eyebrow is raised from its initial position when the face was found.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.righteyebrowraised', (e) => {
console.log(e)
})

righteyeclosed

This event is emitted by Face Effects when a tracked face's right eye closes.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.righteyeclosed', (e) => {
console.log(e)
})

righteyeopened

This event is emitted by Face Effects when a tracked face's right eye opens.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.righteyeopened', (e) => {
console.log(e)
})

righteyewinked

This event is emitted by Face Effects when a tracked face's right eye closes and opens within 750ms while the left eye remains open.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face.

Example

world.events.addListener(world.events.globalId, 'facecontroller.righteyewinked', (e) => {
console.log(e)
})

earpointfound

This event is emitted by Face Effects when an ear point is found.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face
pointStringEar point name. One of the following: leftLobe, leftCanal, leftHelix, rightLobe, rightCanal, rightHelix

Example

world.events.addListener(world.events.globalId, 'facecontroller.earpointfound', (e) => {
console.log(e)
})

earpointlost

This event is emitted by Face Effects when an ear point is lost.

Properties

PropertyTypeDescription
idNumberA numerical id of the located face
pointStringEar point name. One of the following: leftLobe, leftCanal, leftHelix, rightLobe, rightCanal, rightHelix

Example

world.events.addListener(world.events.globalId, 'facecontroller.earpointfound', (e) => {
console.log(e)
})