-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Grabbing #75
Comments
I'm curious as to what this would look like. We have the |
Me too :D However, today I would prefer event abstractions like onGrabStart, onGrabMove, onGrabEnd. Especially for Multiuser a differentiation between state and events is much more helpful. I think in general react-xr should provide a good event abstraction like what react-gesture does for mouse and touch events, but now for mouse, touch and controllers. Additionally there could be something like react-xr-drei that has convenience components like SingleHandGrabbable / MultiHandGrabbable that simply transform the object / group. Unfortunately I do not yet have time to get my hands dirty on this |
I've been playing about with grabbing too! Before I jumped into it I had a look at what was already provided by existing interactions. My take was that they all expect some form of ray to be intersecting the object rather then the user interacting with the object directly. In short: Good for raycasting events, but not extensible beyond that. I've copied a couple of files (warts and all) to a gist from my project to demonstrate my approach. The key file being Code OutlineA little bit of commentry on what I've done here: https://gist.github.com/micmania1/6a189a51691b8239826a0a3ecad7f0d5 XRInteractions.tsx
Level1.tsx The ball uses physics through cannon-es which is why the grab events are being handled by the component - ie. any library wouldn't know if physics was available or not, so grabbing & positioning the ball may require different steps. Maybe any library implementation would depend on physics? RequirementsI'm still discovering 3D development so I tried to set the barrier pretty low for what I was trying to achieve to begin with. No fancy double hand grabs or grabbing multiple items at once. Here's my basic requirements:
Some things I purposely ignored were:
Example Usage
I could extend this to add onGrabStart/End props too to make it a little nicer to use. Video examplecom.oculus.shellenv-20220727-222329_Trim.mp4 |
I would love to see this implemented as well. I really enjoy working with this framework, but it's far too lacking to be able to make anything serious in VR. Adding built in grabbing support would go a long way to boosting the usefulness of the framework. Is anybody against grabbing? If someone were to submit a pull request, would it be shot down out of principle or does it have a good chance of going through? |
I'd be happy to accept a PR. We could use some work on interactions, and I'd have to concur as to why. |
After 3 years I'll close this issue myself :D |
For my application, I am planning on implementing the following gestures today:
Having grab different from pinch is needed for manipulating a robot gripper. |
Since this library contains the pointing interaction, I think a grabbing interaction would be a very good fit to implement in here. Especially cause both Interaction paradigms should possibly coexist regardless of the input (Controller, Hand, Mouse, ...).
Maybe we can discuss If Grabbing would fit into this library and how it can interoperate with the current pointing interaction.
(I've already started a POC for two- & one-handed grabbing but It would need some refinement to be submitted as a PR)
The text was updated successfully, but these errors were encountered: