Browse Source

Grid hiding

master
Pete Shadbolt 7 years ago
parent
commit
479817bf13
2 changed files with 12 additions and 0 deletions
  1. +9
    -0
      static/scripts/editor.js
  2. +3
    -0
      static/scripts/mouse.js

+ 9
- 0
static/scripts/editor.js View File

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


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



editor.orientations = [ editor.orientations = [
new THREE.Euler(pi2, 0, 0), new THREE.Euler(pi2, 0, 0),
@@ -10,6 +12,11 @@ editor.orientations = [
new THREE.Euler(pi2, 0, pi2), 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() { editor.onFreeMove = function() {
var found = editor.findNodeOnRay(mouse.ray); var found = editor.findNodeOnRay(mouse.ray);
@@ -198,3 +205,5 @@ editor.localComplementation = function() {
abj.local_complementation(editor.selection); abj.local_complementation(editor.selection);
gui.serverMessage("Inverted neighbourhood of " + editor.selection + "."); gui.serverMessage("Inverted neighbourhood of " + editor.selection + ".");
}; };

setInterval(editor.checkTimeOut, 500);

+ 3
- 0
static/scripts/mouse.js View File

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

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

Loading…
Cancel
Save