Skip to content

系统输入模块

如何配置

  • global.SETTINGS.set('MOUSE_LEFT', 0) 默认0是左键
  • global.SETTINGS.set('MOUDE_MIDDLE', 1) 默认1是中间
  • global.SETTINGS.set('MOUSE_Right', 2) 默认2是右键

示例:通过配置将右键改为相机平移,中间旋转相机

js

global.SETTINGS.set('ORBIT_LEFT', 2);   // 左键平移
global.SETTINGS.set('ORBIT_MIDDLE', 0); // 中间旋转
global.SETTINGS.set('ORBIT_RIGHT', 1);  // 右键移动

// override pan up direction operation,处理thingjs与ue的差异,直接抄即可
global.SETTINGS.set('ORBIT_PANUP_OP', function (objectMatrix) {
    const { Vector3 } = require('../Thing.UE/Three/Vector3');
    var v = new Vector3();
    v.setFromMatrixColumn(objectMatrix, 2);
    v.crossVectors(new Vector3(0, 1, 0), v);
    return v;
});

京ICP备13053130号 京公网安备11010502050947号