title: threejs - raycasting in AR with controller after repositioning
body: <p>I'm rather new to threejs, so what I'm doing might not be the most efficient way.</p>
  <p>I have an object in AR on a mobile device and I want to know if I intersect with it when touching on the screen.<br />
  I use the following code to generate the raycast, and it works initally.</p>
  <pre class="lang-js prettyprint-override"><code>    const tempMatrix = new THREE.Matrix4();
      tempMatrix.identity().extractRotation(this.controller.matrixWorld);
      this.raycaster.ray.origin.setFromMatrixPosition(this.controller.matrixWorld);
      this.raycaster.ray.direction.set(0, 0, -1).applyMatrix4(tempMatrix);
  </code></pre>
  <p>However, I have the ability to reposition the object (i.e. reset the position so the object is in front, relative to the current camera direction and position) by moving and rotating the whole scene.</p>
  <p>After the repositioning, the raycasting is completely offset and is not casting rays anywhere near where I touch the screen.</p>
  <p>Repositioning is done like this (while it works, if there's a better way, let me know!) :</p>
  <pre class="lang-js prettyprint-override"><code>public handleReposition(): void {
      const xRotation = Math.abs(this.camera.rotation.x) &gt; Math.PI / 2 ? -Math.PI : 0;
      const yRotation = this.camera.rotation.y;
  
      this.scene.rotation.set(xRotation, yRotation, xRotation);
      this.scene.position.set(this.camera.position.x, this.camera.position.y, this.camera.position.z);
    }
  </code></pre>
  <p>How can I achieve to raycast to the correct new location?</p>
  <p>Thanks!</p>