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
410 stars 110 forks source link

local scaling with multiple input based on far interaction #928

Closed nilshof01 closed 1 week ago

nilshof01 commented 2 months ago

Describe the bug

I have one game object in my scene which has an object manipulator attached. When i want to scale or move it with the controllers (Meta quest 3) everything works fine. Then when I switch to my hands, I can move the object by pinching but as soon as I want to rescale it with both hands the scene crashes and the following error appears: ''' transform.localScale assign attempt for '1AFB_bounding_sphere' is not valid. Input localScale is { NaN, NaN, NaN }. UnityEngine.Transform:set_localScale (UnityEngine.Vector3) MixedReality.Toolkit.SpatialManipulation.ObjectManipulator:ApplyTargetTransform () (at ./Library/PackageCache/org.mixedrealitytoolkit.spatialmanipulation@5fe191610f47/ObjectManipulator/ObjectManipulator.cs:882) MixedReality.Toolkit.SpatialManipulation.ObjectManipulator:ProcessInteractable (UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder/UpdatePhase) (at ./Library/PackageCache/org.mixedrealitytoolkit.spatialmanipulation@5fe191610f47/ObjectManipulator/ObjectManipulator.cs:848) UnityEngine.XR.Interaction.Toolkit.XRInteractionManager:Update () ''' Here, "1AFB_bounding_sphere" is the name of my object which has the object manipulator attached.

To reproduce

Hardware:

Software:

Steps to reproduce the behavior:

My XR rig is basically copied from the HandsdemoScene under: Assets/Samples/XR Interaction Toolkit/3.0.3/Hands Interaction Demo/HandsDemoScene.unity. My object has the following components:

Run the scene and use both of your hands with pinching on the same object with the object manipulator to scale it.

Expected behavior

I would have expected no error.

Your setup (please complete the following information)

Target platform (please complete the following information)

Additional context

Add any other context about the problem here.

AMollis commented 1 month ago

@whebertML to attempt repro steps to better understand if the issue only occurs on Quert 3.

nilshof01 commented 1 month ago

Hi, I just wanted to ask if the issue will be fixed in the next release. It seems like that or am I wrong?

whebertML commented 1 month ago

@nilshof01, the fix is under review and should hopefully be merged in soon. So it should make it into the next version 4 preview release I would think, yes.

Also, feel free to test the fix locally and let us know if it works for you and your specific use case.

nilshof01 commented 1 month ago

Hi, yes it works now. Though, the rays coming from my hands are pointing to the same point, although it is scaling. Moreover, they are not pointing on the object or the point which I am pointing at. But I guess, that is an issue with the XR rig configuration...

whebertML commented 1 month ago

@nilshof01 Hey, thanks for testing. And yes, the end of the rays appearing to point to the same position is just how the XRI3 rig's ray interactors work by default. If you were to switch to using the MRTK3 rig, our ray interactors ray ends at the point of ray intersection with the object collider instead.

whebertML commented 1 week ago

Fixed in #933