API

Function computeYawPitchFromLookAt

  • Inverse of computeLookAtFromYawPitch: given a lookAt direction and centre, recover the yaw/pitch that would produce it. Writes [yaw, pitch] into result. currentYaw is used as a fallback when looking straight down/up (yaw undefined).

    Parameters

    • lookAt: Vec3
    • center: Vec3
    • currentYaw: number
    • result: { x: number; y: number }

    Returns { x: number; y: number }