MixedRealityToolkit / MixedRealityToolkit-Unity

This repository holds the third generation of the Mixed Reality Toolkit for Unity. The latest version of the MRTK can be found here.
BSD 3-Clause "New" or "Revised" License
355 stars 89 forks source link

[XRI3] [FEATURE REQUEST] ObjectManipulator support for XRSocketInteractor parameters `Hover Socket Snapping` and `Socket Scale Mode` #621

Open anonymous2585 opened 6 months ago

anonymous2585 commented 6 months ago

Describe the problem

567 fixed the ObjectManipulator behaviour with Unity XRI XRSocketInteractor.

In Unity XRI 2.5.0 (mrtk uses 2.3.0 by default), parameters Hover Socket Snapping and Socket Scale Mode were added in XRSocketInteractor.

Right now, the ObjectManipulator behaviour doesn't use these parameters when moving an object in the socket.

Describe the solution you'd like

Add support for this parameter when the installed XRI package is >= 2.5.0

AMollis commented 6 months ago

@whebertML , @marlenaklein-msft thought there was a conversation about this already, and we decided to hold off until we update min version to XRI 2.5

whebertML commented 6 months ago

@AMollis Sounds good. Not sure what our policy is in general on supporting future package version features when we only depend on an earlier version, anyway. But once we make the move to a later version of XRI, sounds reasonable to support.

AMollis commented 6 months ago

@whebertML ... sorry maybe the conversation was about holding off with this unity we move to XRI 3.0 .

Either way I'm fine with adding support now (using #if's to handle < 2.5) or waiting until we update MRTK3's min XRI

MaxPalmer-UH commented 2 weeks ago

I guess this can be resurrected with the work going on for XRI3.

AMollis commented 1 week ago

@whebertML or @MaxPalmer-UH want to make this change in XRI3 branch?

AMollis commented 1 week ago

I added this issue to the things we want to fix before releasing

whebertML commented 1 week ago

@AMollis I can take a look I think. When you mention "before releasing", does that mean before the eventual full 4.0.0 release, or before the pre-release? Nevermind, adding to #645 I guess means not preview release? 👍

MaxPalmer-UH commented 1 week ago

I'll try to take a look tomorrow, I've had something bump everything else today so it's shifted back.

MaxPalmer-UH commented 1 week ago

@whebertML - were you going to take a look, if not I'm happy to.

whebertML commented 1 week ago

Hey @MaxPalmer-UH,

I was planning on taking a look, yes, but might not be able to get to it until next week. I had some initial stuff done to address the XRI 2.5+ features back when I implemented the initial compatibility (up till like XRI 2.3.2), but put it on hold when we started the XRI 3 stuff. I can dust it off and see where it is in comparison, probably needs some refactor if not redoing.

Though again, maybe not till next week some time. If you have ideas and/or have something ready, that works too?

MaxPalmer-UH commented 6 days ago

We had to get a release out the door last week at the last minute so I'm only back to MRTK today and have prioritised testinfg the pre release. I don't have anything ready as a starting point for this issue, I was just reading up on how the socket support differs from most interactions in that it's typically based around an object interacting with another site/object in the world (the socket site) - not necessarily a controller - e.g. putting an object into or onto another object. I was wondering if there is a suitable scene that contains those types of iinteraction already - maybe docking pens to the whiteboard? If you have somthing that's a starting point, it might be worth going with that.

whebertML commented 4 days ago

@AMollis @MaxPalmer-UH

I sent out an email to discuss the main issue I see with trying to add this feature:

XRSocketInteractor is specifically looking for only XRGrabInteractables to hover snap with. So for interactables like MRTK's ObjectManipulator, which isn't derived from XRGrabInteractable, there is no way to officially participate in a hover snap. We can mimic the behavior and appear to hover snap, and perhaps that is sufficient, but the XRSocketInteractor won't know about it and that could potentially lead to issues - like possibly hover snapping to some other XRGabInteractable at the same time.

The way to do this properly would be for Unity to switch to using an interface, like IXRSocketSnapInteractable or whatever for the socket snapping behavior, allowing ObjectManipulator to implement that interface and participate officially. The system also uses XRSocketGrabTransformer, itself also depending directly on XRGrabInteractable, which calculates the transform when socket selected or socket hover snapped. Hopefully that whole system could be converted to using interfaces.

MaxPalmer-UH commented 3 days ago

@whebertML you make a good point, being able to implement an interface for the snapping behaviour seems far more attractive a solution to me. Sounds like it's worth checking with Unity again, I'm happy to chase them through my contacts.

whebertML commented 3 days ago

That sounds good, @MaxPalmer-UH . Though I am also curious about what the Unity contact @AMollis previously spoke to might have mentioned regarding this specific issue, if there were any plans regarding XRSocketInteractor itself, or if it was just more about XRI 3 upcoming changes in general.