A class controls eye gaze movements of a VRM.

Constructors

Properties

_needsUpdate: boolean

Specifies that angles need to be applied to its [@link applier].

_pitch: number

Its current angle around X axis, in degree.

_restHeadWorldQuaternion: any

World rotation of the head in its rest pose.

_yaw: number

Its current angle around Y axis, in degree.

The VRMLookAtApplier of the LookAt.

autoUpdate: boolean

If this is true, the LookAt will be updated automatically by calling update, towarding the direction to the target. true by default.

See also: target

faceFront: Vector3

The front direction of the face. Intended to be used for VRM 0.0 compat (VRM 0.0 models are facing Z- instead of Z+). You usually don't want to touch this.

humanoid: VRMHumanoid

Its associated VRMHumanoid.

offsetFromHeadBone: Vector3

The origin of LookAt. Position offset from the head bone.

target?: null | Object3D<Object3DEventMap>

The target object of the LookAt. Note that it does not make any sense if autoUpdate is disabled.

See also: autoUpdate

EULER_ORDER: "YXZ" = "YXZ"

Accessors

  • get euler(): Euler
  • Returns Euler

    Deprecated

    Use getEuler instead.

  • get pitch(): number
  • Its current angle around X axis, in degree.

    Returns number

  • set pitch(value): void
  • Its current angle around X axis, in degree.

    Parameters

    • value: number

    Returns void

  • get yaw(): number
  • Its current angle around Y axis, in degree.

    Returns number

  • set yaw(value): void
  • Its current angle around Y axis, in degree.

    Parameters

    • value: number

    Returns void

Methods

  • Copy the given VRMLookAt into this one. humanoid must be same as the source one. applier will reference the same instance as the source one.

    Parameters

    Returns this

    this

  • Get its yaw-pitch angles as an Euler. Does NOT consider faceFront; it returns Euler(0, 0, 0; "YXZ") by default regardless of the faceFront value.

    Parameters

    • target: Euler

      The target euler

    Returns Euler

  • Get a quaternion that rotates the +Z unit vector of the humanoid Head to the faceFront direction.

    Parameters

    • target: Quaternion

      A target THREE.Quaternion

    Returns Quaternion

  • Get its LookAt direction in world coordinate.

    Parameters

    • target: Vector3

      A target THREE.Vector3

    Returns Vector3

  • Get its lookAt position in world coordinate.

    Parameters

    • target: Vector3

      A target THREE.Vector3

    Returns Vector3

  • Get its lookAt rotation in world coordinate. Does NOT consider faceFront.

    Parameters

    • target: Quaternion

      A target THREE.Quaternion

    Returns Quaternion

  • Set its lookAt target position.

    Note that its result will be instantly overwritten if VRMLookAtHead.autoUpdate is enabled.

    If you want to track an object continuously, you might want to use target instead.

    Parameters

    • position: Vector3

      A target position, in world space

    Returns void

  • Reset the lookAt direction (yaw and pitch) to the initial direction.

    Returns void

  • Update the VRMLookAtHead. If autoUpdate is enabled, this will make it look at the target.

    Parameters

    • delta: number

      deltaTime, it isn't used though. You can use the parameter if you want to use this in your own extended VRMLookAt.

    Returns void