瀏覽代碼

Grid hiding

master
Pete Shadbolt 6 年之前
父節點
當前提交
479817bf13
共有 2 個檔案被更改,包括 12 行新增0 行删除
  1. +9
    -0
      static/scripts/editor.js
  2. +3
    -0
      static/scripts/mouse.js

+ 9
- 0
static/scripts/editor.js 查看文件

@@ -3,6 +3,8 @@ var pi2 = Math.PI / 2;

editor.selection = undefined;
editor.mouseOver = undefined;
editor.gridTimeOut = 0;


editor.orientations = [
new THREE.Euler(pi2, 0, 0),
@@ -10,6 +12,11 @@ editor.orientations = [
new THREE.Euler(pi2, 0, pi2),
];

editor.checkTimeOut = function() {
editor.gridTimeOut += 1;
console.log(editor.gridTimeOut);
editor.grid.visible = editor.gridTimeOut < 10;
}

editor.onFreeMove = function() {
var found = editor.findNodeOnRay(mouse.ray);
@@ -198,3 +205,5 @@ editor.localComplementation = function() {
abj.local_complementation(editor.selection);
gui.serverMessage("Inverted neighbourhood of " + editor.selection + ".");
};

setInterval(editor.checkTimeOut, 500);

+ 3
- 0
static/scripts/mouse.js 查看文件

@@ -70,4 +70,7 @@ mouse.onMove = function(event) {
} else {
mouse.onFreeMove();
}

// Update editor
editor.gridTimeOut = 0;
};

Loading…
取消
儲存