操作模式參數表。

interface MoveModeParameterMap {
    1: {};
    2: {
        disableKeyboard?: boolean;
        disablePan?: boolean;
        disableRotateHorizontal?: boolean;
        disableRotateVertical?: boolean;
        disableZoom?: boolean;
        zoomRate?: number;
    };
    3: {
        allowUpdateFocusPoint?: boolean;
        disableKeyboard?: boolean;
        disableMouse?: boolean;
        disableTouch?: boolean;
        maxDistance?: number;
        maxPolarAngle?: number;
        minDistance?: number;
        minPolarAngle?: number;
        staticAzimuthAngleOffset?: number;
        zoomRate?: number;
    };
    4: {
        collisionDetectFrustumHeight?: number;
        collisionDetectRange?: number;
        considerModel?: boolean;
        disableKeyboard?: boolean;
        disableMouse?: boolean;
        enableMovingShake?: boolean;
        heightAboveGround?: number;
        horizonAmplitude?: number;
        keyboardMoveRate?: number;
        keyboardRotateRate?: number;
        mouseRotateRate?: number;
        standDetectFrustumHeight?: number;
        standDetectRange?: number;
        stopMovingShakeSpeed?: number;
        verticalAmplitude?: number;
    };
    5: {
        collisionBoxHeight?: number;
        collisionBoxWidth?: number;
        collisionDetectFrustumHeight?: number;
        collisionDetectRange?: number;
        considerModel?: boolean;
        disableKeyboard?: boolean;
        disableMouse?: boolean;
        fixSpeed?: boolean;
        focusPoint?: Geo3DPoint | GeoPoint;
        glTFModel?: CustomGLTFEntity;
        glTFModelFunction?: ((glTFEntity, position, speed, rotate, object) => void);
        heightAboveGround?: number;
        maxDistance?: number;
        maxPolarAngle?: number;
        minDistance?: number;
        minPolarAngle?: number;
        moveSpeed?: number;
        object?: any;
        standDetectFrustumHeight?: number;
        standDetectRange?: number;
        staticAzimuthAngleOffset?: number;
        zoomRate?: number;
    };
    6: {
        azimuthAngleRotatePerSecond?: number;
        entity?: CustomGLTFEntity;
        firstPersonViewMovingFunction?: ((entity, event, pos, v, up, offset) => void);
        maxDistance?: number;
        minDistance?: number;
        moveEvent?: MoveEvent;
        polarAngleRotatePerSecond?: number;
        thirdPersonViewMovingFunction?: ((entity, moveEvent, pos, angle) => void);
        view?: FOLLOW_VIEW;
    };
    7: {
        disableKeyboard?: boolean;
        disableZoom?: boolean;
        zoomRate?: number;
    };
}

Properties

1 2 3 4 5 6 7

Properties

1: {}

滑鼠模式參數。

Type declaration

    2: {
        disableKeyboard?: boolean;
        disablePan?: boolean;
        disableRotateHorizontal?: boolean;
        disableRotateVertical?: boolean;
        disableZoom?: boolean;
        zoomRate?: number;
    }

    面板模式參數。

    Type declaration

    • Optional disableKeyboard?: boolean

      關閉鍵盤輸入

    • Optional disablePan?: boolean

      關閉平移

    • Optional disableRotateHorizontal?: boolean

      關閉水平旋轉

    • Optional disableRotateVertical?: boolean

      關閉垂直旋轉

    • Optional disableZoom?: boolean

      關閉縮放

    • Optional zoomRate?: number

      縮放速度

    3: {
        allowUpdateFocusPoint?: boolean;
        disableKeyboard?: boolean;
        disableMouse?: boolean;
        disableTouch?: boolean;
        maxDistance?: number;
        maxPolarAngle?: number;
        minDistance?: number;
        minPolarAngle?: number;
        staticAzimuthAngleOffset?: number;
        zoomRate?: number;
    }

    旋轉模式參數。

    Type declaration

    • Optional allowUpdateFocusPoint?: boolean

      允許更新注視點

    • Optional disableKeyboard?: boolean

      關閉鍵盤輸入

    • Optional disableMouse?: boolean

      關閉滑鼠輸入

    • Optional disableTouch?: boolean

      關閉觸控輸入

    • Optional maxDistance?: number

      距離注視點最大距離

    • Optional maxPolarAngle?: number

      天頂角上限

    • Optional minDistance?: number

      距離注視點最小距離

    • Optional minPolarAngle?: number

      天頂角下限

    • Optional staticAzimuthAngleOffset?: number

      方位角平移量

    • Optional zoomRate?: number

      縮放速度

    4: {
        collisionDetectFrustumHeight?: number;
        collisionDetectRange?: number;
        considerModel?: boolean;
        disableKeyboard?: boolean;
        disableMouse?: boolean;
        enableMovingShake?: boolean;
        heightAboveGround?: number;
        horizonAmplitude?: number;
        keyboardMoveRate?: number;
        keyboardRotateRate?: number;
        mouseRotateRate?: number;
        standDetectFrustumHeight?: number;
        standDetectRange?: number;
        stopMovingShakeSpeed?: number;
        verticalAmplitude?: number;
    }

    地面行走模式參數。

    Type declaration

    • Optional collisionDetectFrustumHeight?: number

      碰撞採樣攝影機高度(相對當前攝影機位置),單位公尺

    • Optional collisionDetectRange?: number

      碰撞偵測範圍,預設為0.5(公尺)

    • Optional considerModel?: boolean

      是否考慮三維模型

    • Optional disableKeyboard?: boolean

      關閉鍵盤輸入

    • Optional disableMouse?: boolean

      關閉滑鼠輸入

    • Optional enableMovingShake?: boolean

      開啟行走搖晃

    • Optional heightAboveGround?: number

      離地高度

    • Optional horizonAmplitude?: number

      水平搖晃幅度

    • Optional keyboardMoveRate?: number

      鍵盤移動速度

    • Optional keyboardRotateRate?: number

      鍵盤旋轉速度

    • Optional mouseRotateRate?: number

      滑鼠旋轉速度

    • Optional standDetectFrustumHeight?: number

      站立採樣攝影機高度(相對當前攝影機位置),單位公尺

    • Optional standDetectRange?: number

      站立偵測範圍,預設為0.1(公尺)

    • Optional stopMovingShakeSpeed?: number

      停止搖晃速度

    • Optional verticalAmplitude?: number

      垂直搖晃幅度

    5: {
        collisionBoxHeight?: number;
        collisionBoxWidth?: number;
        collisionDetectFrustumHeight?: number;
        collisionDetectRange?: number;
        considerModel?: boolean;
        disableKeyboard?: boolean;
        disableMouse?: boolean;
        fixSpeed?: boolean;
        focusPoint?: Geo3DPoint | GeoPoint;
        glTFModel?: CustomGLTFEntity;
        glTFModelFunction?: ((glTFEntity, position, speed, rotate, object) => void);
        heightAboveGround?: number;
        maxDistance?: number;
        maxPolarAngle?: number;
        minDistance?: number;
        minPolarAngle?: number;
        moveSpeed?: number;
        object?: any;
        standDetectFrustumHeight?: number;
        standDetectRange?: number;
        staticAzimuthAngleOffset?: number;
        zoomRate?: number;
    }

    第三人稱模式參數。 熱鍵說明:

    • W: 向前移動
    • S: 向後移動
    • A: 向左移動
    • D: 向右移動
    • 上: 面對注視點視角向上
    • 下: 面對注視點視角向下
    • 左: 面對注視點向左移動
    • 右: 面對注視點向右移動
    • +: 面對注視點逆時針移動
    • -: 面對注視點順時針移動
    • 滑鼠左鍵: 視角拖曳
    • 滑鼠中鍵: 移動到游標所指座標

    Type declaration

    • Optional collisionBoxHeight?: number

      碰撞方塊高度

    • Optional collisionBoxWidth?: number

      碰撞方塊寬度

    • Optional collisionDetectFrustumHeight?: number

      碰撞採樣攝影機高度(相對當前攝影機位置),單位公尺

    • Optional collisionDetectRange?: number

      站立偵測範圍,預設為0.1(公尺)

    • Optional considerModel?: boolean

      是否考慮三維模型

    • Optional disableKeyboard?: boolean

      關閉鍵盤輸入

    • Optional disableMouse?: boolean

      關閉滑鼠輸入

    • Optional fixSpeed?: boolean

      固定速度,不隨攝影機高度調整

    • Optional focusPoint?: Geo3DPoint | GeoPoint

      初始注視點

    • Optional glTFModel?: CustomGLTFEntity

      使用的模型

    • Optional glTFModelFunction?: ((glTFEntity, position, speed, rotate, object) => void)
        • (glTFEntity, position, speed, rotate, object): void
        • 模型處理函式

          Parameters

          • glTFEntity: CustomGLTFEntity

            所使用的模型。

          • position: Geo3DPoint

            當前注視點。

          • speed: number

            理論值移動速度(m/s)。

          • rotate: {
                offset: number;
                x: number;
                y: number;
                z: number;
            }

            out參數,調整旋轉軸及角度偏移。

            • offset: number
            • x: number
            • y: number
            • z: number
          • object: any

            傳入的物件參數。

          Returns void

          Example

          const glTFModelFunction = (glTFEntity, position, speed, rotate, object) => {
          //設定旋轉軸
          rotate.x = 1;
          rotate.y = 0;
          rotate.z = 0;
          //設定偏移角度
          rotate.offset = 30;
          glTFEntity.update({ position: position });
          glTFEntity.playAll();
          let list = glTFEntity.getAnimationList();
          if (speed < 1.5) {
          let weight = speed / 1.5;
          glTFEntity.setAnimationWeight(0, 1 - weight);
          glTFEntity.setAnimationWeight(1, 0);
          glTFEntity.setAnimationWeight(3, weight);
          if (list.length !== 0) {
          glTFEntity.setPlaySpeed(0, list[0].cycleTime \* (1 + weight));
          glTFEntity.setPlaySpeed(1, list[1].cycleTime \* (1 + weight));
          glTFEntity.setPlaySpeed(3, list[3].cycleTime \* (1 + weight));
          }
          } else {
          let weight = (speed - 1.5) / 1.5;
          if (weight > 1.0) {
          weight = 1.0;
          }
          glTFEntity.setAnimationWeight(0, 0);
          glTFEntity.setAnimationWeight(1, weight);
          glTFEntity.setAnimationWeight(3, 1 - weight);
          if (list.length !== 0) {
          glTFEntity.setPlaySpeed(0, list[0].cycleTime \* (1 + weight));
          glTFEntity.setPlaySpeed(1, list[1].cycleTime \* (1 + weight));
          glTFEntity.setPlaySpeed(3, list[3].cycleTime \* (1 + weight));
          }
          }
          };
    • Optional heightAboveGround?: number

      離地高度

    • Optional maxDistance?: number

      距離注視點最大距離

    • Optional maxPolarAngle?: number

      天頂角上限

    • Optional minDistance?: number

      距離注視點最小距離

    • Optional minPolarAngle?: number

      天頂角下限

    • Optional moveSpeed?: number

      移動速度,若fixSpeedfalse,為初始速度;若fixSpeedtrue,為最終速度

    • Optional object?: any

      物件參數

    • Optional standDetectFrustumHeight?: number

      站立採樣攝影機高度(相對注視點),單位公尺

    • Optional standDetectRange?: number

      碰撞偵測範圍,預設為0.5(公尺)

    • Optional staticAzimuthAngleOffset?: number

      方位角平移量

    • Optional zoomRate?: number

      縮放速度

    6: {
        azimuthAngleRotatePerSecond?: number;
        entity?: CustomGLTFEntity;
        firstPersonViewMovingFunction?: ((entity, event, pos, v, up, offset) => void);
        maxDistance?: number;
        minDistance?: number;
        moveEvent?: MoveEvent;
        polarAngleRotatePerSecond?: number;
        thirdPersonViewMovingFunction?: ((entity, moveEvent, pos, angle) => void);
        view?: FOLLOW_VIEW;
    }

    跟隨模式參數。

    Type declaration

    • Optional azimuthAngleRotatePerSecond?: number

      方位角每秒旋轉角度 (deg/s)

    • Optional entity?: CustomGLTFEntity

      自畫圖素 CustomGLTFEntity

    • Optional firstPersonViewMovingFunction?: ((entity, event, pos, v, up, offset) => void)
        • (entity, event, pos, v, up, offset): void
        • 第一人稱處理函式

          Parameters

          Returns void

          Example

          const firstPersonViewMovingFunction = (entity, moveEvent, pos, v, up, offset) => {
          let position = entity.getParameter().position;
          let vDir = moveEvent.getV();
          let upDir = moveEvent.getUp();
          //設定座標
          pos.x = position.x;
          pos.y = position.y;
          pos.z = position.z;
          //設定面向
          v.x = vDir.x;
          v.y = vDir.y;
          v.z = vDir.z;
          //設定頭頂方向
          up.x = upDir.x;
          up.y = upDir.y;
          up.z = upDir.z;
          //設定偏移量
          offset.x = -0.5;
          offset.y = 2;
          offset.z = 2;
          }
    • Optional maxDistance?: number

      距離注視點最大距離

    • Optional minDistance?: number

      距離注視點最小距離

    • Optional moveEvent?: MoveEvent

      移動事件 ov.MoveEvent

    • Optional polarAngleRotatePerSecond?: number

      天頂角每秒旋轉角度 (deg/s)

    • Optional thirdPersonViewMovingFunction?: ((entity, moveEvent, pos, angle) => void)
        • (entity, moveEvent, pos, angle): void
        • 第三人稱處理函式

          Parameters

          • entity: null | CustomGLTFEntity

            所使用的圖素。

          • moveEvent: null | MoveEvent

            所使用的移動事件。

          • pos: Geo3DPoint

            out參數,注視座標。

          • angle: {
                azimuthAngle: number;
                polarAngle: number;
            }

            out參數,方位角與天頂角。

            • azimuthAngle: number

              方位角。

            • polarAngle: number

              天頂角。

          Returns void

          Example

          const thirdPersonViewMovingFunction = (entity, moveEvent, pos, angle) => {
          //設定注視座標
          let position = entity.getParameter().position;
          pos.x = position.x;
          pos.y = position.y;
          pos.z = position.z;
          //設定方位角與天頂角
          angle.azimuthAngle = moveEvent.getAzimuthAngle()
          angle.polarAngle = moveEvent.getPolarAngle()
          }
    • Optional view?: FOLLOW_VIEW

      跟隨視角 ov.FOLLOW_VIEW

    7: {
        disableKeyboard?: boolean;
        disableZoom?: boolean;
        zoomRate?: number;
    }

    GoogleEarth模式參數。

    Type declaration

    • Optional disableKeyboard?: boolean

      關閉鍵盤輸入

    • Optional disableZoom?: boolean

      關閉縮放

    • Optional zoomRate?: number

      縮放速度

    Generated using TypeDoc