<commit_before>if (typeof AFRAME === 'undefined') {
  throw new Error('Component attempted to register before AFRAME was available.');
}
AFRAME.registerComponent('editor', {
  _setSelectedObject: function (event) {
      if(event.target.el.dataset.editorAsset) { return; }
      if (this.placingObject) { this.placingObject = null; }
      this.selectedObject = event.target;
  },
  _moveSelectedObject: function (event) {
    if (!this.selectedObject) { return; }
    var el = this.selectedObject.el
    var pos = Object.assign({}, el.components.position.data);
    switch (event.keyCode) {
      case 'I'.charCodeAt(0): pos.z--; break;
      case 'J'.charCodeAt(0): pos.x--; break;
      case 'K'.charCodeAt(0): pos.z++; break;
      case 'L'.charCodeAt(0): pos.x++; break;
      case 'P'.charCodeAt(0): pos.y+=0.25; break;
      case ';'.charCodeAt(0): pos.y-=0.25; break;
    }
    el.setAttribute('position', pos);
  },
  _placeObject: function (event) {
    if (!this.placingObject) { return; }
    this.raycaster.set(event.ray.origin, event.ray.direction);
    var intersection = this.raycaster.intersectObject(this.raycastFloor)[0];
    if (!intersection) { return; }
    var pos = intersection.point.clone().multiplyScalar(1/this.scene.object3D.scale.x);
    pos.x = Math.floor(pos.x);
    pos.z = Math.floor(pos.z);
    pos.x += 0.5;
    pos.z -= 0.5;
    this.placingObject.setAttribute('position',  pos);
  },
  _assets: [
    'Architecture/Ceiling_2Wx2L',
    'Architecture/Ceiling_2Wx4L',
    'Architecture/Ceiling_4Wx2L',
    'Architecture/Ceiling_4Wx4L',
    'Architecture/Ceiling_Skylight_4Wx4L',<commit_msg>Trying to fix asset placing<commit_after>if (typeof AFRAME === 'undefined') {
  throw new Error('Component attempted to register before AFRAME was available.');
}
AFRAME.registerComponent('editor', {
  _setSelectedObject: function (event) {
      if(event.target.el.dataset.editorAsset) { return; }
      if (this.placingObject) {
        this.placingObject = null;
      this.raycastFloor.userData.altspace.collider.enabled = false;
      }
      this.selectedObject = event.target;
  },
  _moveSelectedObject: function (event) {
    if (!this.selectedObject) { return; }
    var el = this.selectedObject.el
    var pos = Object.assign({}, el.components.position.data);
    switch (event.keyCode) {
      case 'I'.charCodeAt(0): pos.z--; break;
      case 'J'.charCodeAt(0): pos.x--; break;
      case 'K'.charCodeAt(0): pos.z++; break;
      case 'L'.charCodeAt(0): pos.x++; break;
      case 'P'.charCodeAt(0): pos.y+=0.25; break;
      case ';'.charCodeAt(0): pos.y-=0.25; break;
    }
    el.setAttribute('position', pos);
  },
  _placeObject: function (event) {
    if (!this.placingObject) { return; }
    this.raycastFloor.userData.altspace.collider.enabled = true;
    this.raycaster.set(event.ray.origin, event.ray.direction);
    var intersection = this.raycaster.intersectObject(this.raycastFloor)[0];
    if (!intersection) { return; }
    var pos = intersection.point.clone().multiplyScalar(1/this.scene.object3D.scale.x);
    pos.x = Math.ceil(pos.x);
    pos.z = Math.floor(pos.z);
    pos.x += 0.5;
    pos.z -= 0.5;
    this.placingObject.setAttribute('position',  pos);
  },
  _assets: [
    'Architecture/Ceiling_2Wx2L',
    'Architecture/Ceiling_2Wx4L',
    'Architecture/Ceiling_4Wx2L',
    'Architecture/Ceiling_4Wx4L',
    'Architecture/Ceiling_Skylight_4Wx4L',
{'fraction_non_alphanumeric': 0.15953079178885632, 'fraction_numerical': 0.017008797653958945, 'mean_word_length': 3.4471968709256844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3556287', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1187, 'n_words': 207}