Skip to main content

faceloading

facecontroller.faceloading

Description

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

Event Properties

facecontroller.faceloading.data : { maxDetections, pointsPerDetection, indices, uvs }

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

ecs.registerComponent({
name: 'faceloading',
add: (world, component) => {

const loading = ({data}) => {
const {pointsPerDetection, uvs, indices} = data
doSomething(pointsPerDetection, uvs, indices)
}

world.events.addListener(world.events.globalId, 'facecontroller.faceloading', loading)
},
})