src/button.js
function (evt) {
    var threshold = 30;
    if (!this.pressed) {
      this.pressed = true;
      this.emit('touchdown');
      var self = this;
      this.interval = setInterval(function() {
        var delta = performance.now() - self.lastTime;
        if (delta > threshold) {
          self.pressed = false;
          self.lastTime = 0;
          self.emit('touchup');
          clearInterval(self.interval);
        }
      }, threshold);
    }
    this.lastTime = performance.now();
  }
function (evt) {
    var threshold = 30;
    if (!this.pressed) {
      this.pressed = true;
      this.emit('touchdown');
      var self = this;
      this.interval = setInterval(function() {
        var delta = performance.now() - self.lastTime;
        if (delta > threshold) {
          self.pressed = false;
          self.lastTime = 0;
          self.emit('touchup');
          clearInterval(self.interval);
        }
      }, threshold);
    }
    this.lastTime = performance.now();
  }
function ( evt ) { var threshold = 30 ; if ( ! this . pressed ) { this . pressed = true ; this . emit ( 'touchdown' ) ; var self = this ; this . interval = setInterval ( function ( ) { var delta = performance . now ( ) - self . lastTime ; if ( delta > threshold ) { self . pressed = false ; self . lastTime = 0 ; self . emit ( 'touchup' ) ; clearInterval ( self . interval ) ; } } , threshold ) ; } this . lastTime = performance . now ( ) ; }
handles hand controller collisions
handles hand controller collisions