src/components/look-controls.js
function (evt) {
    if (!this.data.enabled) { return; }
    // Handle only primary button.
    if (evt.button !== 0) { return; }

    var sceneEl = this.el.sceneEl;
    var canvasEl = sceneEl && sceneEl.canvas;

    this.mouseDown = true;
    this.previousMouseEvent = evt;
    this.showGrabbingCursor();

    if (this.data.pointerLockEnabled && !this.pointerLocked) {
      if (canvasEl.requestPointerLock) {
        canvasEl.requestPointerLock();
      } else if (canvasEl.mozRequestPointerLock) {
        canvasEl.mozRequestPointerLock();
      }
    }
  }
function (evt) {
    if (!this.data.enabled) { return; }
    // Handle only primary button.
    if (evt.button !== 0) { return; }

    var sceneEl = this.el.sceneEl;
    var canvasEl = sceneEl && sceneEl.canvas;

    this.mouseDown = true;
    this.previousMouseEvent = evt;
    this.showGrabbingCursor();

    if (this.data.pointerLockEnabled && !this.pointerLocked) {
      if (canvasEl.requestPointerLock) {
        canvasEl.requestPointerLock();
      } else if (canvasEl.mozRequestPointerLock) {
        canvasEl.mozRequestPointerLock();
      }
    }
  }
function ( evt ) { if ( ! this . data . enabled ) { return ; } // Handle only primary button. if ( evt . button !== 0 ) { return ; } var sceneEl = this . el . sceneEl ; var canvasEl = sceneEl && sceneEl . canvas ; this . mouseDown = true ; this . previousMouseEvent = evt ; this . showGrabbingCursor ( ) ; if ( this . data . pointerLockEnabled && ! this . pointerLocked ) { if ( canvasEl . requestPointerLock ) { canvasEl . requestPointerLock ( ) ; } else if ( canvasEl . mozRequestPointerLock ) { canvasEl . mozRequestPointerLock ( ) ; } } }
Register mouse down to detect mouse drag.
Register mouse down to detect mouse drag .