Saltar al contenido principal

facescanning

facecontroller.facescanning

Description

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

Event Properties

facecontroller.facescanning.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: 'facescanning',
add: (world, component) => {

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

world.events.addListener(world.events.globalId, 'facecontroller.facescanning', scanning)
},
})