microsoft / mixed-reality-extension-sdk

The Mixed Reality Extension SDK enables developers to build 3D world extensions for AltspaceVR, using Node.JS.
MIT License
142 stars 61 forks source link

Need onTouch callback #665

Open djzielin opened 4 years ago

djzielin commented 4 years ago

Was thinking about the latency issues. I'm trying to detect if the user is touching an object. currently adding an actor object with a collider on it attached to hands to register when the user touches an object.

The onButton callback is much more responsive then this physics based touch detection.

So I think it would be nice if there was a onTouch for buttonBehavior. if that ran locally (the same way onClick seems to do) I think it would make interactions faster/smoother.

tombuMS commented 4 years ago

Hi David! Proximity interaction with buttons is something that we want to implement with the button behavior. Much of the infrastructure is in place to do this, it just needs a bit more implementation to get it working. The plan was to have this just fire off existing events for onButton and onClick, just through proximity interaction. Do you find a need for a separate event, when it would be raised as a button and click event?

djzielin commented 4 years ago

Hmmm. Thinking about it now. Not sure I have a use case for a seperate event type. Re-using onButton should work.

djzielin commented 4 years ago

I think as long as there was a distance/proximity parameter, this would work. P.S. The new physics sync seems to interpolate, so my previous method (of attaching kinematic rigidbodies to the users hand attachment point), performs even worse (sluggish as the hand collider needs to "catch up" to the hand. ie, the onButton proximity is even more needed.