@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 ​
new FaceMeshComponent(options?): FaceMeshComponent;Defined in: components/FaceMesh.ts:67
Parameters ​
| Parameter | Type |
|---|---|
options? | FaceMeshOptions |
Returns ​
FaceMeshComponent
Overrides ​
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
texture | string | The picture: a path or localasset:// URL. Empty paints FaceMeshComponent.tint alone. | components/FaceMesh.ts:45 |
opacity | number | How much of it shows, 0 to 1. | components/FaceMesh.ts:47 |
tint | string | Multiplies the picture, as #rrggbb. White leaves it as it is. | components/FaceMesh.ts:49 |
blend | FaceMeshBlend | How it mixes: normal paints over, multiply darkens like make-up, additive adds light like a glow. | components/FaceMesh.ts:51 |
cutEyes | boolean | Leave the eyes open, so the real ones show. They still open and close with the face. | components/FaceMesh.ts:53 |
cutMouth | boolean | Leave the mouth open, so it can open without the picture stretching across it. | components/FaceMesh.ts:55 |
layer | number | Higher 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.x | number | - | components/FaceMesh.ts:63 |
textureOffset.y | number | - | 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.x | number | - | components/FaceMesh.ts:65 |
textureScale.y | number | - | components/FaceMesh.ts:65 |

