-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raycaster component fails to follow camera in immersive mode (mobile) #4521
Comments
This is an example of a reticle style cursor that works on both VR / AR / 2D mode: https://aframe.io/aframe/examples/test/cursor/ You can see that children follow the camera as expected. I see calls to |
I apologize for the confusion; I have removed the references to getWorld* from my example for exactly that reason, as we have already discussed at length. I am having difficulty locating the raycaster scripting API calls in your example. a-frame-event-set-component.js appears to only contain event binding & unbinding logic, and all other interactions look to be set up by relatively passive virtual-click triggering. It appears that the raycaster component does work independently in immersive modes, and behaves fine when applied to a child element of the camera as in your example and a new tweak to my example ( https://dev.nextnowagency.com/camera_ray_test/index3.html ), just not when applied directly to the camera. This observation does further strengthen my suspicion that the A-Frame raycaster component itself is using the problematic getWorld* calls. |
Removed use of getWorldPosition from the raycaster component to work around THREE bug mrdoob/three.js#18448. Does it solve your issue? You can try with master builds: https://cdn.jsdelivr.net/gh/aframevr/aframe@0edd9871b9d47ca60a305c5ea7369f8dbab34ead/dist/aframe-master.min.js |
Afaict, that did it! ( https://dev.nextnowagency.com/camera_ray_test/index4.html ; raycaster on camera, but sourcing the master build aframe) Thanks- I had honestly planned to just jump into the code today and see if it was that quick a fix to pull-request myself, but a catastrophic cascade failure of the whole office's version control server AND backup kinda derailed any development work. I am now willing to consider this closed. The current behavior of locking the camera downwards when outside of immersive mode remains a concern, and if it persists after chrome 82 reaches release (having shown up between 80 and 82), I may re-raise that as an independent issue, but I'm willing to leave that at the feet of the google devs for now until their feature updates are stable. |
Description:
Likely tangential to #4412 which is in turn tied to underlying THREE issue mrdoob/three.js#18448
On Android mobile chrome, in immersive WebXR mode (AR or VR), 'raycaster' components on the a-camera cease follow the camera.
In the linked demo,
Expected behavior:
Observed behavior:
Short of diving into the A-Frame raycaster component source, I would guess it's using something akin to Object3D.getWorldDirection() for its ray generation, which would mean it will be broken due to the getWorld* immersive-mode THREE breakage until and unless it is rewritten to e.g. transform a ray independently through the available and demonstrably correct raw transform matrices.
Chrome 80, AR unavailable, expected behavior outside immersive mode
Chrome 82, AR available, stuck view outside immersive mode
Chrome 82, in AR immersive mode, hit test result stuck at origin
Chrome 82 in VR immersive mode; essentially identical to Chrome 80 in VR immersive mode, hit test result equally stuck at origin.
The text was updated successfully, but these errors were encountered: