BIM.works SDKs - v2.0.6
    Preparing search index...

    Type Alias NavigationModeSettings

    Defines one custom navigation mode. The four predefined modes are available as presets through extends:

    • default: regular orbit/pan/zoom mouse navigation, no keyboard movement.
    • walk: keyboard forward/back/up/down movement, left/right keyboard turning and Alt+left-button look-around.
    • game: pointer-lock look-around with horizontal WASD/arrow movement.
    • drone: pointer-lock look-around with camera-direction WASD/arrow movement.

    Custom modes can map one or more keyboard or mouse combinations to any action supported by NavigationModeSettings with keyBindings. A KeyBinding uses DOM KeyboardEvent.code values such as KeyW, ArrowUp or PageDown, and DOM mouse button numbers: 0 main/left button, 1 middle button and 2 secondary/right button. Navigation movement bindings can set speed to scale that binding's movement or turn speed. For example, { keyCode: "ArrowUp", speed: 1 } and { keyCode: "ArrowUp", shiftKey: true, speed: 5 } keep the current fast-shift behavior configurable per binding.

    const viewer = new Viewer3d(objectStateManager, undefined, {
    navigationMode: "inspection",
    navigationModes: {
    inspection: {
    extends: "game",
    pointerLock: false,
    keyBindings: {
    lookAround: [{ button: 0, altKey: true }],
    navigationForward: [{ keyCode: "KeyW" }, { keyCode: "ArrowUp" }],
    navigationBackward: [{ keyCode: "KeyS" }, { keyCode: "ArrowDown" }],
    navigationLeft: [{ keyCode: "KeyA" }],
    navigationRight: [{ keyCode: "KeyD" }]
    }
    }
    }
    });
    type NavigationModeSettings = {
        extends?: PredefinedNavigationMode;
        forwardMode?: "horizontal" | "camera" | "orbit";
        keyBindings?: ViewerKeyBindings;
        keyboardNavigation?: boolean;
        lookAround?: boolean;
        navigationSpeed?: number;
        pointerLock?: boolean;
        turnWithKeyboard?: boolean;
        type?: PredefinedNavigationMode;
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index

    Properties

    Predefined mode to use as the base configuration. Defaults to default.

    forwardMode?: "horizontal" | "camera" | "orbit"

    horizontal keeps forward/back movement level with the world; camera follows the camera direction.

    keyBindings?: ViewerKeyBindings

    Mode-specific shortcut overrides. Empty arrays disable the default bindings for that action.

    keyboardNavigation?: boolean

    Enable keyboard movement actions. Automatically enabled when navigation key bindings are supplied.

    lookAround?: boolean

    Enable drag look-around when a binding maps to lookAround.

    navigationSpeed?: number

    Mode-level multiplier for free keyboard navigation speed. The predefined drone mode defaults to 3.

    pointerLock?: boolean

    Request pointer lock when the mode starts and use mouse movement for look-around.

    turnWithKeyboard?: boolean

    Use left/right keyboard bindings to yaw instead of strafe. Used by the predefined walk mode.

    Alias for extends, kept for callers that prefer describing the movement type.