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
369 stars 93 forks source link

[FEATURE REQUEST] ObjectManipulator observes XRSocketInteractor selection as expected. #492

Closed whebertML closed 7 months ago

whebertML commented 11 months ago

When being selected by an XRSocketInteractor, an ObjectManipulator does not move into the socket transform as expected, like an XRGrabInteractable would. This is due to the default manipulation logic for ObjectManipulator, which is to retain the relative pose offset of an interactor's attach transform. So when selected by an XRSocketInteractor, the ObjectManipulator stays where it is instead of moving into the socket.

With the intent to increase MRTK3's compatibility with continuing XRI features, the request is to modify ObjectManipulator's behavior so that it properly observes the XRSocketInteraction selection and moves into the socket transform.

Video demonstrating both current and new behavior with the changes from #567 :

https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/assets/58860572/e79cb0fb-60bb-4549-b457-725df993720e

shaynie commented 11 months ago

@whebertML please provide a brief description to pass on to Unity for interface suggestions

whebertML commented 11 months ago

@AMollis @shaynie

The below noted issues are only within XRI versions post 2.3.2 - I happened to have 2.5 at the time I was investigating. This does not impact us currently, please disregard. Though if Unity will be refactoring this, that will be good for future cases potentially.

XRSocketInteractor has direct dependencies on, and calls into, XRGrabInteractable to perform some of the socket features, like snap hovering. Below are links to several places in the code for reference (links from a mirror of Unity UPM packages for convenience). Would be preferable if such features were done via some IXRSocketInteractable interface or similar.

https://github.com/needle-mirror/com.unity.xr.interaction.toolkit/blob/master/Runtime/Interaction/Interactors/XRSocketInteractor.cs#L458-L459 https://github.com/needle-mirror/com.unity.xr.interaction.toolkit/blob/master/Runtime/Interaction/Interactors/XRSocketInteractor.cs#L483-L484 https://github.com/needle-mirror/com.unity.xr.interaction.toolkit/blob/master/Runtime/Interaction/Interactors/XRSocketInteractor.cs#L771-L817

shaynie commented 10 months ago

@whebertML please update regarding xri 2.5 vs 2.3

shaynie commented 9 months ago

@whebertML please add unit tests for this