3D-City Model
    Preparing search index...

    FirstPersonState – Application UI state to enable interactive first-person (pedestrian/walking) camera mode.

    Implements singleton pattern to ensure only one active instance. Handles camera setup, FOV transitions, event wiring for controls, disables inappropriate layers, shows information windows, and manages custom UI button state. Resets scene and restores interaction when exited.

    The UI button for toggling/activating this state.

    instance - Singleton reference.

    const fpState = new FirstPersonState(fpBtn);
    fpState.apply(app);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    button: undefined | HTMLButtonElement
    dependentStates: string[]

    Required/precondition states.

    exclusiveStates: string[]

    States that are deactivated when this state activates.

    keyDown: undefined | ((e: any) => void)

    Handler for keydown events.

    keyUp: undefined | ((e: any) => void)

    Handler for keyup events.

    name: string

    Name/identifier for the state.

    restoreStates: string[]

    States that should be restored when this state ends.

    Methods

    • Animates a smooth change to the camera's field of view (FOV) over a given duration.

      Parameters

      • camera: Camera

        Cesium Camera object.

      • end: number

        Target FOV value.

      • duration: number

        Duration in milliseconds.

      Returns Promise<void>

      Resolves when animation completes.

    • Enters first-person navigation mode: disables selection, animates camera FOV, hides table checkboxes, sets event handlers, shows information window, disables inputs, and manages button state.

      Parameters

      • app: any

      Returns Promise<void>

    • Exits first-person mode: animates camera FOV back, removes UI/event handlers, restores layer interaction/UI state.

      Parameters

      • app: any

      Returns boolean

      Always true.