Skip to content

@relu-interactives/spatial-ecs


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

Class: FaceAttachmentComponent ​

Defined in: components/FaceAttachment.ts:74

Fixes an entity to a place on its parent FaceHeadComponent: glasses to the bridge of the nose, a hat to the top of the head.

The entity's ParentId stays the head; this names the place. The ObjectManagementSystem hangs the entity's object under a socket at that place, so its Transform is its offset FROM the place, in head units. The same thing happens in the editor and at runtime, except that at runtime the place is measured on the person in front of the camera.

Attach and detach with ObjectManagementSystem.attachToFace / detachFromFace.

Extends ​

Constructors ​

Constructor ​

ts
new FaceAttachmentComponent(options?): FaceAttachmentComponent;

Defined in: components/FaceAttachment.ts:82

Parameters ​

ParameterType
options?FaceAttachmentOptions

Returns ​

FaceAttachmentComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDescriptionDefined in
pointFaceAttachPointIdThe place on the head.components/FaceAttachment.ts:76
followExpressionboolean | nullFollow expression (true, false), or null for what suits the place.components/FaceAttachment.ts:78
enabledbooleanWhether it follows the place. Off: an ordinary child of the head.components/FaceAttachment.ts:80