src/components/cursor.js
function (evt) {
    var currentIntersection;
    var cursorEl = this.el;
    var index;
    var intersectedEl;
    var intersection;

    // Select closest object, excluding the cursor.
    index = evt.detail.els[0] === cursorEl ? 1 : 0;
    intersection = evt.detail.intersections[index];
    intersectedEl = evt.detail.els[index];

    // If cursor is the only intersected object, ignore the event.
    if (!intersectedEl) { return; }

    // Already intersecting this entity.
    if (this.intersectedEl === intersectedEl) { return; }

    // Ignore events further away than active intersection.
    if (this.intersectedEl) {
      currentIntersection = this.el.components.raycaster.getIntersection(this.intersectedEl);
      if (currentIntersection && currentIntersection.distance <= intersection.distance) { return; }
    }

    // Unset current intersection.
    this.clearCurrentIntersection(true);

    this.setIntersection(intersectedEl, intersection);
  }
function (evt) {
    var currentIntersection;
    var cursorEl = this.el;
    var index;
    var intersectedEl;
    var intersection;

    // Select closest object, excluding the cursor.
    index = evt.detail.els[0] === cursorEl ? 1 : 0;
    intersection = evt.detail.intersections[index];
    intersectedEl = evt.detail.els[index];

    // If cursor is the only intersected object, ignore the event.
    if (!intersectedEl) { return; }

    // Already intersecting this entity.
    if (this.intersectedEl === intersectedEl) { return; }

    // Ignore events further away than active intersection.
    if (this.intersectedEl) {
      currentIntersection = this.el.components.raycaster.getIntersection(this.intersectedEl);
      if (currentIntersection && currentIntersection.distance <= intersection.distance) { return; }
    }

    // Unset current intersection.
    this.clearCurrentIntersection(true);

    this.setIntersection(intersectedEl, intersection);
  }
function ( evt ) { var currentIntersection ; var cursorEl = this . el ; var index ; var intersectedEl ; var intersection ; // Select closest object, excluding the cursor. index = evt . detail . els [ 0 ] === cursorEl ? 1 : 0 ; intersection = evt . detail . intersections [ index ] ; intersectedEl = evt . detail . els [ index ] ; // If cursor is the only intersected object, ignore the event. if ( ! intersectedEl ) { return ; } // Already intersecting this entity. if ( this . intersectedEl === intersectedEl ) { return ; } // Ignore events further away than active intersection. if ( this . intersectedEl ) { currentIntersection = this . el . components . raycaster . getIntersection ( this . intersectedEl ) ; if ( currentIntersection && currentIntersection . distance <= intersection . distance ) { return ; } } // Unset current intersection. this . clearCurrentIntersection ( true ) ; this . setIntersection ( intersectedEl , intersection ) ; }
Handle intersection.
Handle intersection .