Skip to content

Commit 3b49167

Browse files
committed
Update docs
1 parent b78f0d3 commit 3b49167

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ MRTK3 requires Unity 2021.3.21 or higher. In addition, you need the [Mixed Reali
4848

4949
In previous versions of MRTK (HoloToolkit and MRTK v2), all packages were released as a complete set, marked with the same version number (ex: 2.8.0). Starting with MRTK3 GA, each package will be individually versioned, following the [Semantic Versioning 2.0.0 specification](https://semver.org/spec/v2.0.0.html). (As a result, the '3' in MRTK3 is not a version number!)
5050

51-
5251
Individual versioning will enable faster servicing while providing improved developer understanding of the magnitude of changes and reducing the number of packages needing to be updated to acquire the desired fix(es).
5352

54-
For example, if a non-breaking new feature is added to the UX core package, which contains the logic for user interface behavior the minor version number will increase (from 3.0.x to 3.1.0). Since the change is non-breaking, the UX components package, which depends upon UX core, is not required to be updated.
53+
For example, if a non-breaking new feature is added to the UX core package, which contains the logic for user interface behavior the minor version number will increase (from 3.0.x to 3.1.0). Since the change is non-breaking, the UX components package, which depends upon UX core, is not required to be updated.
5554

5655
As a result of this change, there is not a unified MRTK3 product version.
5756

@@ -89,19 +88,19 @@ MRTK3 has been upgraded to use [Unity's XR Interaction Toolkit 3+](https://docs.
8988
* The new controllers and rig retake the original names of the obsolete controllers.
9089
* New controllers structure have been modified so that all of them have the same structure.
9190
* The deprecated XRI2 XRController component has been removed from the controllers and its input actions have been moved to their interactors.
92-
* The new controllers now have a Tracked Pose Driver components that holds references to the device's position, rotation, and tracking state input actions.
91+
* The new controllers now have a Tracked Pose Driver components that holds references to the device's position, rotation, and tracking state input actions.
9392
* Interactors now have a Tracked Pose Driver field that holds a reference to the Tracked Pose Driver component of the parent controller.
9493
* Interactors now have a Mode Managed Root that holds a reference to the parent controller GameObject.
9594
* Added new unity-tests for the new XRI3 functionality + components.
9695
* Updated several unity-tests.
9796
* Updated several scripts so that they work with both obsolete XRI2 and new XRI3 prefabs.
9897
* Updated all scenes to use the new XRI3 rig + controllers.
99-
* Made a copy of the old HandInteractionExamples scene and renamed as ObsoleteHandInteractionExample, this scene still consumes the old rig + controllers.
98+
* Made a copy of the old HandInteractionExamples scene and renamed as ObsoleteHandInteractionExample, this scene still consumes the old rig + controllers.
10099

101100
A more detailed explanation of the changes can be found in [XRI2TOXRI3MIGRATIONGUIDE.md](./XRI2TOXRI3MIGRATIONGUIDE.md). The guide can also help others as a path for migrating their own solutions or MRTK3 forks from XRI2 to XRI3.
102101

103102
## Governance
104103

105104
For information on how the Mixed Reality Toolkit for Unity Project is governed, please read [GOVERNANCE.md](./GOVERNANCE.md).
106105

107-
All projects under the Mixed Reality Toolkit organization are governed by the Steering Committee. The Steering Committee is responsible for all technical oversight, project approval and oversight, policy oversight, and trademark management for the Organization. To learn more about the Steering Committee, visit this link: https://github.com/MixedRealityToolkit/MixedRealityToolkit-MVG/blob/main/org-docs/CHARTER.md
106+
All projects under the Mixed Reality Toolkit organization are governed by the Steering Committee. The Steering Committee is responsible for all technical oversight, project approval and oversight, policy oversight, and trademark management for the Organization. To learn more about the Steering Committee, visit this link: <https://github.com/MixedRealityToolkit/MixedRealityToolkit-MVG/blob/main/org-docs/CHARTER.md>

XRI2TOXRI3MIGRATIONGUIDE.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Introduction
44

5-
Thank you for choosing MRTK as your Mixed Reality framework. MRTK has been upgraded to follow XRI3 patterns and consume [Unity's XR Interaction Toolkit 3+](https://docs.unity3d.com/Packages/[email protected]/manual/whats-new-3.0.html) package. The upgrade encompasses various changes from the previous MRTK version and we want to share our experience during the upgrade so that the community is aware of the changes that had to be implemented. We also want to provide an overall roadmap for others to do their own upgrades in their forks or propietary solutions and therefore we created this guide. We created this guide to empower you and your organization to achieve more in Mixed Reality solutions.
5+
Thank you for choosing MRTK as your Mixed Reality framework. MRTK has been upgraded to follow XRI3 patterns and consume [Unity's XR Interaction Toolkit 3+](https://docs.unity3d.com/Packages/[email protected]/manual/whats-new-3.0.html) package. The upgrade encompasses various changes from the previous MRTK version and we want to share our experience during the upgrade so that the community is aware of the changes that had to be implemented. We also want to provide an overall roadmap for others to do their own upgrades in their forks or proprietary solutions and therefore we created this guide. We created this guide to empower you and your organization to achieve more in Mixed Reality solutions.
66

77
## Original MRTK rig structure
88

99
Previous to XRI3 upgrade the MRTK3 rig had a structure similar to the one shown in the next figure:
1010

1111
![Original MRTK rig structure](Images/XRI2ToXRI3Guide/MRTK3XRI2RigStructure.png)
1212

13-
The MRTK3 rig prefab is the root GameObject with the Camera Offset ([XROrigin](https://docs.unity3d.com/Packages/[email protected]/api/Unity.XR.CoreUtils.XROrigin.html)) child that has the multiple controllers (LeftHand, RightHand, and Gaze) as children. Next is a screenshot of the now obsolete MRTK XR Rig.
13+
The MRTK3 rig prefab is the root GameObject with the Camera Offset ([XROrigin](https://docs.unity3d.com/Packages/[email protected]/api/Unity.XR.CoreUtils.XROrigin.html)) child that has the multiple controllers (LeftHand, RightHand, and Gaze) as children. Next is a screenshot of the now obsolete MRTK XR Rig.
1414

1515
![Obsolete MRTK rig](Images/XRI2ToXRI3Guide/ObsoleteMRTKXRRig.png)
1616

@@ -22,51 +22,51 @@ The new, XRI3, MRTK rig + controllers have a slightly different structure which
2222

2323
![New MRTK rig structure](Images/XRI2ToXRI3Guide/MRTK3XRI3RigStructure.png)
2424

25-
In essence, the main difference is that the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) component has been removed and replaced with a [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component which stores references to the Position, Rotation, and Tracking State actions (these can be and are the same as in the old structure). The other input actions (e.g. Select, Activate, UIPress, etc) are moved from the Controller to the Interactor. They are stored in fields already defined in the [Unity's XR Interaction Toolkit 3+](https://docs.unity3d.com/Packages/[email protected]/manual/whats-new-3.0.html) package.
25+
In essence, the main difference is that the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) component has been removed and replaced with a [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component which stores references to the Position, Rotation, and Tracking State actions (these can be and are the same as in the old structure). The other input actions (e.g. Select, Activate, UIPress, etc) are moved from the Controller to the Interactor. They are stored in fields already defined in the [Unity's XR Interaction Toolkit 3+](https://docs.unity3d.com/Packages/[email protected]/manual/whats-new-3.0.html) package.
2626

27-
The XRI3 migration consisted of a set of steps to remove deprecated components and reference the existing Input Actions in their new homes. We recommend that the first step is to move the Position, Rotation and Tracking State actions to their new home according to the new [Unity's XR Interaction Toolkit 3+](https://docs.unity3d.com/Packages/[email protected]/manual/whats-new-3.0.html).
27+
The XRI3 migration consisted of a set of steps to remove deprecated components and reference the existing Input Actions in their new homes. We recommend that the first step is to move the Position, Rotation and Tracking State actions to their new home according to the new [Unity's XR Interaction Toolkit 3+](https://docs.unity3d.com/Packages/[email protected]/manual/whats-new-3.0.html).
2828

29-
## Step 1 - Move Position, Rotation and Tracking State actions
29+
## Step 1 - Move Position, Rotation, and Tracking State actions
3030

31-
Unity introduced a new [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component which is the new home for the Position, Rotation, and Tracking State input actions. Add such component (or a class derived from it) to your controller(s) and add references to the already existing Position, Rotation, and Tracking State actions that were referenced in the removed XRController, as shown the next figure:
31+
Unity introduced a new [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component which is the new home for the Position, Rotation, and Tracking State input actions. Add such component (or a class derived from it) to your controller(s) and add references to the already existing Position, Rotation, and Tracking State actions that were referenced in the removed XRController, as shown the next figure:
3232

3333
![Step 1](Images/XRI2ToXRI3Guide/XRI2ToXRI3Step1.png)
3434

3535
## Step 2 - Implement your own Model functionality
3636

37-
The next step would be to implement your own controller Model functionality if you use it at all. Unity kindly shared that they have no plans to implement a new home for the Model functionality of the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) because of its simplicity so we had to implement it. Fortunately, they are correct and their implementation is quite easy, we recommend you to check MRTK's HandModel MonoBehaviour for an example of its implementation. The next figure shows the new home for the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) Model functionality in the new MRTK Controller:
37+
The next step would be to implement your own controller Model functionality if you use it at all. Unity kindly shared that they have no plans to implement a new home for the Model functionality of the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) because of its simplicity so we had to implement it. Fortunately, they are correct and their implementation is quite easy, we recommend you to check MRTK's HandModel MonoBehaviour for an example of its implementation. The next figure shows the new home for the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) Model functionality in the new MRTK Controller:
3838

3939
![Step 2](Images/XRI2ToXRI3Guide/XRI2ToXRI3Step2.png)
4040

4141
### Input Compatibility Mode
4242

43-
As you make progress in upgrading your Controllers and Interactors to XRI3 it is a good idea to keep an eye on the deprecated XR Controller Configuration Input Compatibility Mode field. This mode controls whether the Interactor uses the new input readers or use the deprecated XR Controller component as per [Unity's changelog](https://docs.unity3d.com/Packages/[email protected]/changelog/CHANGELOG.html#changed-3). It defaults to *Automatic*, however, **<u>this behavior may show false-positive correct behaviors</u>** if you have not removed the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) component from the Controller.
43+
As you make progress in upgrading your Controllers and Interactors to XRI3, it is a good idea to keep an eye on the deprecated XR Controller Configuration Input Compatibility Mode field. This mode controls whether the Interactor uses the new input readers or use the deprecated XR Controller component as per [Unity's changelog](https://docs.unity3d.com/Packages/[email protected]/changelog/CHANGELOG.html#changed-3). It defaults to *Automatic*, however, **<u>this behavior may show false-positive correct behaviors</u>** if you have not removed the [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) component from the Controller.
4444

45-
The Input Compatibility Mode can be found via Inspector under the *(Deprecated) XR Controller Configuration* group as shown next:
45+
The Input Compatibility Mode can be found via Inspector under the *(Deprecated) XR Controller Configuration* group as shown here:
4646

4747
![Input Compatibility Mode](Images/XRI2ToXRI3Guide/InputCompatibilityMode.png)
4848

4949
## Step 3 - Move the remaining [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) input actions to their respective Interactors
5050

51-
Once you have moved the device tracking input actions to the [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component and implemented your own Model functionality then you can move the remaining input actions from the original [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) to the Interactors themselves. The following image highlights the new controller prefab interactors fields that we needed to update for the XRI3 migration.
51+
Once you have moved the device tracking input actions to the [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component and implemented your own Model functionality then you can move the remaining input actions from the original [XRController](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.XRController.html) to the Interactors themselves. The following image highlights the new controller prefab interactors fields that we needed to update for the XRI3 migration.
5252

5353
![Step 3](Images/XRI2ToXRI3Guide/XRI2ToXRI3Step3.png)
5454

5555
### MRTK InputReaders
5656

57-
As you may have noticed already MRTK controller prefabs now have a new child in which we group Input actions for pinch and UI interaction. These are shown in the next figure:
57+
As you may have noticed that MRTK controller prefabs now have a new child in which we group Input actions for pinch and UI interaction. These are shown in the next figure:
5858

5959
![MRTK Input Readers](Images/XRI2ToXRI3Guide/MRTKInputReaders.png)
6060

61-
We added this child + script as a workaround for devices without interaction profiles for hands, however, if your solution does not have a use-case without hands interactions profiles then you can safely map the MRTK's InputReaders' input actions directly in their corresponding Interactor fields.
61+
We added this child + script as a workaround for devices without interaction profiles for hands; however, if your solution does not have a use-case without hands interactions profiles then you can safely map the MRTK's InputReaders' input actions directly in their corresponding Interactor fields.
6262

6363
### TrackedPoseDriver and ModeManagedRoot references
6464

6565
In addition to the InputReaders child you may have also noticed that MRTK interactors now have two new fields: [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) and Mode Managed Root, as shown next:
6666

6767
![TrackedPoseDriver and ModeManagedRoot](Images/XRI2ToXRI3Guide/TPDandMMR.png)
6868

69-
These are just convenient fields to hold references to the parent controller [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component and GameObject. These are not mandatory for a successful XRI3 migration but they facilitate coding as well as writing Unity-tests.
69+
These are just convenient fields to hold references to the parent controller [Tracked Pose Driver](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.InputSystem.XR.TrackedPoseDriver.html) component and GameObject. These are not mandatory for a successful XRI3 migration but they facilitate coding as well as writing Unity tests.
7070

7171
## Step 4 - Update scripts
7272

@@ -75,12 +75,19 @@ For the XRI3 migration we modified our scripts with two goals:
7575
* Adhere to the new XRI3 patterns.
7676
* Provide backward compatibility.
7777

78-
As you will notice in the code many of our changes query the Input Compatibility Mode field to differentiate between XRI2 functionality and XRI3 functionality. This is not mandatory for a successful XRI3 migration, however, we wanted to create a smooth transition for all of you and did our best to ensure backward compatibily as you migrate your forks or solutions.
78+
As you will notice in the code many of our changes query the Input Compatibility Mode field to differentiate between XRI2 functionality and XRI3 functionality. This is not mandatory for a successful XRI3 migration, however, we wanted to create a smooth transition for all of you and did our best to ensure backward compatibility as you migrate your forks or solutions.
7979

8080
We encourage you to check the code in each script as well as the commit history to get a sense of the changes that were needed.
8181

82-
## Step 5 - Update Unity-tests
82+
If you have any custom interactors based on MRTK interfaces, the following table will help you move from deprecated MRTK interfaces to XRI3-compatible interfaces:
8383

84-
Last but not least, Unity-tests! We created several new Unity-tests to ensure the correct functionality of the new XRI3 MRTK rig as well as the old functionality. We encourage you to visit the code and commit history related to Unity-tests to get a sense of the changes. Note that the changes focus mostly on where and how the input actions are queried but the overall functionality test remains the same.
84+
| MRTK3 interface | XRI3 interface |
85+
| --- | --- |
86+
| `MixedReality.Toolkit.IHandedInteractor` | `UnityEngine.XR.Interaction.Toolkit.Interactors.IXRInteractor` |
87+
| `MixedReality.Toolkit.IVariableSelectInteractor` | `UnityEngine.XR.Interaction.Toolkit.Interactors.IXRInteractionStrengthInteractor` |
8588

86-
Thank you for reading this guide, we hope it empowers you to achieve more. Please feel free to submit an issue if you have comments or questions.
89+
## Step 5 - Update Unity tests
90+
91+
Last but not least, Unity tests! We created several new Unity tests to ensure the correct functionality of the new XRI3 MRTK rig as well as the old functionality. We encourage you to visit the code and commit history related to Unity tests to get a sense of the changes. Note that the changes focus mostly on where and how the input actions are queried but the overall functionality test remains the same.
92+
93+
Thank you for reading this guide, we hope it empowers you to achieve more. Please feel free to submit an issue if you have comments or questions.

0 commit comments

Comments
 (0)