pmndrs / xr

🤳 VR/AR for react-three-fiber
https://pmndrs.github.io/xr/docs/
Other
2.2k stars 157 forks source link

OnDemand Grab Pointer #356

Closed WawasCode closed 1 month ago

WawasCode commented 1 month ago

This is the current behavior with the default createXRStore setup: Imagine following scenario where we have a sphere and behind it a plane.

image

If I point the Ray at the plane the target will be on it.

image

Once we move close enough we enable the grab pointer.

image

My issue is shown in the image above. If the ray is targeting something else and I move the controller close enough to the sphere that I should be able to trigger the grab, I can’t click on it because the ray is still active.

Would it be possible to have a sphere around the controller/hands that checks for intersections with objects? If so, could it switch to grab mode when an intersection is detected?

What are your thoughts on that?

bbohlender commented 1 month ago

exactly what you describe is already the case. You can modify the hover radius of the controller to make the intersection with the sphere happen earlier. Feel free to reopen if the behavior is not what you expect