Engine API Reference - v2.23.0-beta.17
    Preparing search index...

    Class CameraFly

    Flies a camera the app keeps drawing with. The app may move the camera itself, from a script or from code of its own, so the camera is not taken over: its transform is swapped for the flown one on the app's prerender event, after every update has run, and put back on postrender, so the frame is drawn from the flown pose while the app keeps seeing and moving its own. Its projection is held the same way, at the field of view or orthographic height it had when the flight started, as an app may animate those too. Leaving fly mode needs no restoring. An orthographic view shows no movement along its direction, so there forward and back zoom instead, and panning scales with the height of the view. The keyboard and the pointer on the canvas are taken ahead of the app while flying, and the flight runs on the wall clock, so a paused app can be flown through.

    Index
    _capture: CanvasCapture
    _controller: FlyController = ...
    _fov: number = 0

    The field of view the flown view keeps.

    _frame: InputFrame<{ move: number[]; rotate: number[] }> = ...
    _keys: Set<string> = ...
    _ortho: boolean = false

    Whether the camera is orthographic, which zooms rather than moving forward.

    _orthoHeight: number = 0

    The orthographic height the flown view keeps, changed by zooming.

    _pose: Pose = ...
    _saved:
        | { fov: number; orthoHeight: number; position: Vec3; rotation: Quat }
        | null = null
    app: AppBase
    speed: number = FLY_SPEED

    Units a second, changed with the wheel.