Rotation with controller input values

Howdy!

I'm creating a manual calibration system for our application, the idea being that the user can manually match a unity scene to the real world by setting the floor level, moving horizontally in a direction, and rotating the world. I will create an automatic system using plane detection later.

Ideally, I should be able to stand in a room with a table, and if that same table's dimensions is in the unity scene, I should be able to match it up perfectly.

What I need is a click and drag rotation, if I press the trigger and move my arm to the right 100 degrees, I want my world to rotate by the same 100 degrees.

To do this, I have implemented a controller input where if I squeeze the trigger, I am reading the controller's rotation value and setting the rotation of the XRRig gameObject to the difference between the moment it started being pressed, to when it ends. I am not getting the full 360 degree range of motion I need, it seems that when I rotate the controller to a certain amount in one direction, the rotation begins to switch directions even when the controller is still moving in its original direction.

I think this is because the rotation value is between 0 and 360, and then once I cross over that edge from 360 back to 0, it switches direction (I know it's a quaternion I'm just simplifying for explanation).

Is there a better way to get the desired rotation I want while maintaining accuracy? Is there another game object besides the XRRig I can use as my rotating gameObject?

Unity Editor version: 2022.3.5f1
ML2 OS version: 1.4.0-dev2 (secure)
MLSDK version: v1.3.0
Host OS: Windows

@ssal To make sure I understand the question correctly, you want to implement a click and drag rotation for your XRRig game object, and set the rotation of the object to match the rotation of the controller? Or are you creating a turn table mechanic, when you click and pull to the left or right to rotate the object?

Here's a quick video explaining exactly what I mean.

Thank you for the video that helped a lot. It looks like the issue you are running into is not directly related to Magic Leap, as much as it is related to XRI, you may want to try asking this question on the Unity Discussion page https://discussions.unity.com/.

You may also want to test using other interaction toolkits such as MRTK 3. Quick Start | MagicLeap Developer Documentation