BIM.works SDKs - v3.0.0-b.115
    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. With the walkable-surfaces artifact present, walk physics adds wall collision, gravity with stair/step climbing and PageUp/PageDown storey jumps (see collision and the character parameters).
    • 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 = {
        characterHeightMm?: number;
        characterRadiusMm?: number;
        climbHeightMm?: number;
        collision?: boolean;
        extends?: PredefinedNavigationMode;
        eyeHeightMm?: number;
        forwardMode?: "horizontal" | "camera" | "orbit";
        gravity?: boolean;
        jumpHeightMultiplier?: number;
        keyBindings?: ViewerKeyBindings;
        keyboardNavigation?: boolean;
        lookAround?: boolean;
        navigationSpeed?: number;
        pointerLock?: boolean;
        turnWithKeyboard?: boolean;
        type?: PredefinedNavigationMode;
        walkThroughWalls?: boolean;
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index

    Properties

    characterHeightMm?: number

    Character height in millimetres for headroom checks. Defaults to 1800.

    characterRadiusMm?: number

    Character radius in millimetres for lateral clearance checks. Defaults to 250.

    climbHeightMm?: number

    Highest step (mm) climbed automatically; also the ground-snap reach. Defaults to 250.

    collision?: boolean

    Enable walk physics (wall collision, ground clamping, gravity, PageUp/PageDown storey jumps) in the walk and game modes. Requires the server-generated walkable-surfaces artifact; without it navigation silently behaves as before. Defaults to true when the artifact is present.

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

    eyeHeightMm?: number

    Eye height above the floor in millimetres. Defaults to 1650.

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

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

    gravity?: boolean

    Fall when no floor is in reach (through slab holes, off edges). Defaults to true.

    jumpHeightMultiplier?: number

    Space jump height as a multiple of climbHeightMm. Defaults to 2.5 (625 mm). Requires gravity.

    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.

    walkThroughWalls?: boolean

    Keep the ground clamp and gravity but skip wall collision. Defaults to false.