c-frame / aframe-super-hands-component

👐All-in-one natural hand controller, pointer, and gaze interaction library for A-Frame
https://c-frame.github.io/aframe-super-hands-component/examples/
MIT License
355 stars 72 forks source link

Add suppressX suppressZ to grabbable? #125

Open SBUtltmedia opened 6 years ago

SBUtltmedia commented 6 years ago

Hi, We're trying to adapt http://apps.tlt.stonybrook.edu/tarski/ to your excellent super-hands component.

We need a lever which only has freedom in the Y direction.

We modified https://github.com/wmurphyrd/aframe-super-hands-component/blob/master/reaction_components/grabbable.js to have functionality similar to suppressY but now we would need to keep a local version of this component and maintain it in case of further updates.

Is there a preferred way to extend grabbable without modifying the existing code?

I am unsure why suppresssY exists without the other axes, could we ask for a feature request to include suppresssX and suppresssZ ?

BTW we've already used super-hands on the following (only tested in Vive)

http://apps.tlt.stonybrook.edu/hanoi/

wmurphyrd commented 6 years ago

Thanks for using super-hands. The reason I only added the suppressY option was it was all I needed at the time for a-locomotor. I'd be open to a pull request that added the other axes. (although, rather than added two more schema properties, I'd probably favor changing to a single suppress string property that could have any combination of x, y, and/or z, i.e. for your case it would be suppress: xz).

super-hands is also designed to be extensible with custom reaction components, so you could just copy the code for grabbable and register a new component under a different name that did exactly what you wanted.

Have you considered using physics simulation to power your lever interaction? I think you'd find a much more satisfying experience using aframe-physics-system and some constraints to get a nice lever action going. In my experience, however, the lock constraint that my grabbable component uses doesn't play too well with constrained objects; it works much better if alter it to use a point-to-point constraint with a small maximum force. Here's an example of a spinnable wheel made using that technique with a hinge constraint.

omolds commented 6 years ago

Would love for this to happen!