0.7.0 • Published 10 months ago

@vis-three/plugin-first-person-controls v0.7.0

Weekly downloads
-
License
MPL-2.0
Repository
-
Last release
10 months ago

@vis-three/plugin-first-person-controls

第一人称控制器插件。(此第一人称控件原理和我们玩 FPS 的第一人称原理有些不同。)

  • 此插件会跟随场景,相机,dom 进行自动适配和切换。

最新版本

license

插件名称

FirstPersonControlsPlugin

:::tip 可以使用枚举:FIRST_PERSON_CONTROLS_PLUGIN :::

插件依赖

插件传参

export interface FirstPersonControlsParameters {
  /**移动速度 */
  movementSpeed?: number;
  /**转向速度 */
  lookSpeed?: number;

  /**垂直查看 */
  lookVertical?: boolean;
  /**是否会自动前进 */
  autoForward?: boolean;

  activeLook?: boolean;
  /**升高速度 */
  heightSpeed?: boolean;
  /**升高系数 */
  heightCoef?: number;
  /**最低高度 */
  heightMin?: number;
  /**最高高度 */
  heightMax?: number;
}

引擎拓展

export interface FirstPersonControlsEngine extends Engine {
  firstPersonControls: FirstPersonControls;
}

FirstPersonControls

参照:https://threejs.org/docs/index.html#examples/zh/controls/FirstPersonControls