Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / FaceMeshComponent

Class: FaceMeshComponent ​

Defined in: components/FaceMesh.ts:43

A surface that follows the face and wears a picture: face paint, a mask, make-up, a glow. It sits on the skin and moves with expression, so a painted cheek stays on the cheek through a smile.

The picture goes on through the face's UV layout, the same one at runtime and in the editor, so a picture made for that layout wraps and a plain photo doesn't. Several can stack: FaceMeshComponent.layer says which is on top, and FaceMeshComponent.blend how each mixes with the one under it.

An entity with this is a child of the head, at the head's own origin, and FaceMeshSystem draws it. Its Transform isn't used: the face says where it is.

Extends ​

Constructors ​

Constructor ​

ts
new FaceMeshComponent(options?): FaceMeshComponent;

Defined in: components/FaceMesh.ts:67

Parameters ​

ParameterType
options?FaceMeshOptions

Returns ​

FaceMeshComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDescriptionDefined in
texturestringThe picture: a path or localasset:// URL. Empty paints FaceMeshComponent.tint alone.components/FaceMesh.ts:45
opacitynumberHow much of it shows, 0 to 1.components/FaceMesh.ts:47
tintstringMultiplies the picture, as #rrggbb. White leaves it as it is.components/FaceMesh.ts:49
blendFaceMeshBlendHow it mixes: normal paints over, multiply darkens like make-up, additive adds light like a glow.components/FaceMesh.ts:51
cutEyesbooleanLeave the eyes open, so the real ones show. They still open and close with the face.components/FaceMesh.ts:53
cutMouthbooleanLeave the mouth open, so it can open without the picture stretching across it.components/FaceMesh.ts:55
layernumberHigher draws over lower. Equal layers draw in the order they were made.components/FaceMesh.ts:57
textureOffset{ x: number; y: number; }Moves the picture on the face, as a share of its width and height: x + moves it to the viewer's right, y + moves it up. For a picture that's nearly lined up.components/FaceMesh.ts:63
textureOffset.xnumber-components/FaceMesh.ts:63
textureOffset.ynumber-components/FaceMesh.ts:63
textureScale{ x: number; y: number; }Scales the picture about its centre. 1 is as it is.components/FaceMesh.ts:65
textureScale.xnumber-components/FaceMesh.ts:65
textureScale.ynumber-components/FaceMesh.ts:65