Binds the SceneObject to a tracked face. See the Head Attached 3D Objects Guide for more information.

// Switch to the next available face
//@input Component.Head head
var nextFaceIndex = script.head.faceIndex + 1;
if(nextFaceIndex >= script.head.getFacesCount())
nextFaceIndex = 0;
script.head.faceIndex = nextFaceIndex;
// Change the attachment point type to HeadCenter
//@input Component.Head head
script.head.setAttachmentPointType(AttachmentPointType.HeadCenter);
interface Head {
    enabled: boolean;
    faceIndex: number;
    sceneObject: SceneObject;
    uniqueIdentifier: string;
    destroy(): void;
    getFacesCount(): number;
    getLandmark(index: number): vec2;
    getLandmarkCount(): number;
    getLandmarks(): vec2[];
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    setAttachmentPointType(attachmentPointType: AttachmentPointType): void;
}

Hierarchy (view full)

Properties

enabled: boolean

If disabled, the Component will stop enacting its behavior.

faceIndex: number

The index of the face this head is attached to.

sceneObject: SceneObject
uniqueIdentifier: string

Methods

  • Destroys the component.

    Returns void

  • Returns the total number of faces currently being tracked.

    Returns number

  • Returns the screen position of the face landmark at the passed in index.

    Parameters

    • index: number

    Returns vec2

  • Returns the number of face landmarks being tracked.

    Returns number

  • Returns a list of screen positions of all tracked landmarks.

    Returns vec2[]

  • Returns the name of this object's type.

    Returns string

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Changes the attachment point type used to anchor this object to a face.

    Parameters

    Returns void