Do click several times and different positions on the screen and you will see how the ray is just under your mouse cursor position. It's working right.
Now you press the "Enter VR" button to enter in VR mode and try to do the same. You will see how the ray is offset from your mouse cursor position. It's not working right.
I already changed the camera to renderer.xr.getCamera(), for function raycaster.setFromCamera(mouse, camera)
What is going on??
How I could fix this problem???
When you enter in the VR Mode, the raycast from mouse cursor has a big offset. If you try in a mobile phone WebXR, the offset is different and bigger.
You can check it out in this simple jsfiddle https://jsfiddle.net/foxfairlane/d3t7khvu/4/
Do click several times and different positions on the screen and you will see how the ray is just under your mouse cursor position. It's working right.
Now you press the "Enter VR" button to enter in VR mode and try to do the same. You will see how the ray is offset from your mouse cursor position. It's not working right.
I already changed the camera to renderer.xr.getCamera(), for function raycaster.setFromCamera(mouse, camera)
What is going on?? How I could fix this problem???