<commit_before>elation.component.add('janusweb.elements.raycaster', {
  createChildren() {
    this.lasthitobject = null;
  },
  update() {
    var hits = this.raycast(null, null, this.class);
    if (hits.length > 0) {
      var hit = hits[0],
          hitobject = hit.object;
      
      if (hitobject != this.lasthitobject) {
        if (this.lasthitobject) {
          this.dispatchEvent({type: 'raycastleave', data: {object: this.lasthitobject, intersection: hit}});
        }
        this.dispatchEvent({type: 'raycastenter', data: {object: hit.object, intersection: hit}});
        this.lasthitobject = hitobject;
      }
    } else if (this.lasthitobject) {
      this.dispatchEvent({type: 'raycastleave', data: {object: this.lasthitobject, intersection: null}});
      this.dispatchEvent({type: 'raycastenter', data: {object: this.lasthitobject.room, intersection: null}});
      this.lasthitobject = this.lasthitobject.room;
    }<commit_msg>Emit raycastmove event while looking at no object (eg, skybox)<commit_after>elation.component.add('janusweb.elements.raycaster', {
  createChildren() {
    this.lasthitobject = null;
    this.lasthitpos = V();
    this.fwdvec = V();
  },
  update() {
    var hits = this.raycast(null, null, this.class);
    if (hits.length > 0) {
      var hit = hits[0],
          hitobject = hit.object;
      
      if (hitobject != this.lasthitobject) {
        if (this.lasthitobject) {
          this.dispatchEvent({type: 'raycastleave', data: {object: this.lasthitobject, intersection: hit}});
        }
        this.dispatchEvent({type: 'raycastenter', data: {object: hit.object, intersection: hit}});
        this.lasthitobject = hitobject;
      }

      if (!hit.point.equals(this.lasthitpos)) {
        this.dispatchEvent({type: 'raycastmove', data: {object: hit.object, intersection: hit}});
      }
      this.lasthitpos.copy(hit.point);
    } else {
      if (this.lasthitobject) {
        this.dispatchEvent({type: 'raycastleave', data: {object: this.lasthitobject, intersection: null}});
        this.dispatchEvent({type: 'raycastenter', data: {object: this.lasthitobject.room, intersection: null}});
        this.lasthitobject = this.lasthitobject.room;
      }
      this.localToWorld(this.fwdvec.set(0,0,-1));
      if (!this.fwdvec.equals(this.lasthitpos)) {
        this.dispatchEvent({type: 'raycastmove', data: {object: this.lasthitobject, intersection: this.fwdvec}});
      }
      this.lasthitpos.copy(this.fwdvec);
    }
{'fraction_non_alphanumeric': 0.14843121480289623, 'fraction_numerical': 0.0028157683024939663, 'mean_word_length': 3.1658291457286434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2463653', 'n_tokens_mistral': 815, 'n_tokens_neox': 808, 'n_words': 150}