-
Notifications
You must be signed in to change notification settings - Fork 71
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
Feature/set grab target #124
base: master
Are you sure you want to change the base?
Conversation
The way this works is that you modify the incoming button press event with the new target before it goes to I'm trying to think of how to incorporate this as a fully documented and supported api feature so that others could put it to use as well, and my concern is that this conflicts with the general goal of Would you be open to exploring a refactor that accomplishes this entirely within |
This is how it's used in hubs right now: https://github.com/mozilla/hubs/blob/master/src/components/super-spawner.js I could see a path where this spawner behavior is added as a reaction component, but I also see this functionality being used in other ways. There is general usefulness in being able to retarget what you are trying to grab. E.g. how "Job Simulator" lets you remotely grab objects on the ground by hovering your hand above them (could be defined as a larger grab sphere/cylinder around the object that retargets the hand on grab). So perhaps its a "retarget" component? Regardless, while I am happy to explore other approaches (I do agree this current approach does feel weird, but it was the most obvious given the current API), I am somewhat concerned about trying to have too much functionality all in one place. I feel that the more you try to encompass all the functionality at a high-level, the more likely you'll start to run into interference with other libraries and making it more difficult for developers to add their own more complex functionality. (E.g. should it really be a All that said, I really don't know what the right approach is, but would be happy to talk about any ideas you might have. |
The part that feels most weird about the current implementation to me is that we are having to syntehsise an event to do a programatic grab. Instead I would expect to just be able to call a funciton on a I would also second the idea that |
It seems the API gap here is the ability for a reaction component to modify the super-hands state. i.e. your spawner could have a component that listened for This would also aid in the networking solution as the grabbed entity needs the ability to clear the active grab when ownership is lost. @netpro2k I appreciate this input. It's tempting to cram in networking because the built-in reaction components (which were originally intended to be more template/inspiration than workhorse) have grown so complex that asking library users to recreate them to add in networking seems like too much. Perhaps the API change above could also allow for external components to act as an intermediary such that networking could be easily integrated without replacing Do you have plans to publish standalone components to enable networked interactions with |
We do. |
I have run
npm run test:machinima
, and this patch passes all machinima tests: yesOptionally explicitly specify which entity to grab when
grab-start
is fired. This is useful for things like "spawners" (imagine a box spawner that when you grab, spawns a new box in your hand, leaving the original spawner in place).