JSAPI Three API Reference
    正在准备搜索索引...

    类 PointerLockControl

    第一人称视角控制控件 使用方法:激活控件后,通过键盘进行移动,可以开启lock进行视野旋转

    • W:向前移动
    • A:向左移动
    • S:向后移动
    • D:向右移动
    • L:旋转视野
    const control = new mapvthree.PointerLockControl(engine);
    // 开启鼠标控制
    control.enableKeyboardEvent = true;
    // 设置移动距离
    control.forwardStepSize = 10;
    control.rightStepSize = 20;

    层级

    • PointerLockControls
      • PointerLockControl
    索引

    方法

    • Adds a listener to an event type.

      类型参数

      • T extends string

      参数

      • type: T

        The type of event to listen to.

      • listener: EventListener<any, T, PointerLockControl>

        The function that gets called when the event is fired.

      返回 void

    • Fire an event type.

      类型参数

      • T extends string

      参数

      • event: any

        The event that gets fired.

      返回 void

    • Checks if listener is added to an event type.

      类型参数

      • T extends string

      参数

      • type: T

        The type of event to listen to.

      • listener: EventListener<any, T, PointerLockControl>

        The function that gets called when the event is fired.

      返回 boolean

    • Removes a listener from an event type.

      类型参数

      • T extends string

      参数

      • type: T

        The type of the listener that gets removed.

      • listener: EventListener<any, T, PointerLockControl>

        The listener function that gets removed.

      返回 void

    访问器

    • get forwardStepSize(): any

      前后方向步进

      返回 any

    • get rightStepSize(): any

      左右方向步进

      返回 any

    • get topStepSize(): any

      上下方向步进

      返回 any