Lens Scripting API

    Class Head

    Used to move and rotate SceneObjects in sync with the user's head movements.

    // 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);

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    faceIndex: number

    The index of the face this head is attached to.

    onLandmarksUpdate: event1<vec2[], void>
    sceneObject: SceneObject

    The scene object this component is on.

    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

    MMNEPVFCICPMFPCPTTAAATR