Hands misplaced when Playspace has non-identity transform
Articulated hands display incorrectly.
When the Playspace (or another transform ancestor of the camera further up the chain) has a non-identity transform, the articulated hands display incorrectly (HL2 only).
The hand skeleton displays in the correct location, but the hands' shells are displaced away from the users hands.
To reproduce
Simplest case to reproduce:
First, no error:
- Create empty MRTK scene MyTest.
- Add a sphere at (0,0,1).
- Deploy and run.
- On startup, sphere is directly in front of you.
- Look at your hands, they display correctly.
Now error:
- Go back to MyTest scene.
- Change Playspace transform position to (-1, 0, -1)
- Build and deploy and run.
- Note sphere is farther ahead and to your right, as expected.
- Look at your hands. You only have the skeleton.
- While holding your hands in front of you, look forward and right.
- See the shell of your hands forward and right.
Expected behavior
Shell of your hands should match your hand positions, like the skeletal display does.
Screenshots
See screenshot. I've highlighted with arrows the incorrect shells in orange, and the correct skeleton with green arrows. Sorry about the clutter.

Your setup (please complete the following information)
- Unity Version: 2019.3.3f1 (but using legacy XR).
- MRTK Version: mrtk_development branch as of April 21, 2020.
Target platform (please complete the following information)
- HoloLens 2
Additional context
Related to #7695
This is impacting our use of Hand Meshes with the World Locking Tools.
On the mrtk docs, there's a note about moving the playspace (which is basically, don't move the playspace itself from 0, 0 0):
https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/GettingStartedWithTheMRTK.html#add-mrtk-to-a-new-scene-or-new-project
(Scroll down a bit to see the note: While working in your scene, DO NOT move the Main Camera (or the MixedRealityPlayspace) from the scene origin (0,0,0). This is controlled by the MRTK and the active SDK. If you need to move the players start point, then move the scene content and NOT the camera!
@fast-slow-still is there any possibility in your use case of not moving the playspace itself, instead having some subheirarchy where content is parented to stuff below that?
@keveleigh @davidkline-ms for background on the requirement around keeping stuff at the origin
@wiwei The way in which the World Locking Tools functions requires moving the main camera. It would be great to find a solution in the MRTK that makes this work.
You can find more info about the World Locking Tools here: https://github.com/microsoft/MixedReality-WorldLockingTools-Unity
This is currently by-design, but maybe something we can adjust. ~The reason this is currently happening is that the hand joints aren't transformed according to the playspace location. The reason that's not happening is because transforming positions and rotations for 52 joints every frame would likely be an expensive operation (and moving the playspace location hasn't been a high priority scenario on HoloLens before).~ Then, adding the hand mesh on top of that...
Maybe there's a world where we specify that the ~hand joint~ mesh data is in local space, but we adjust the visualization as one gameobject in world space. ~Then we'd need to update the finger data for the poke pointer to be world space. I think there might be too many things that depend on various ways of getting this data to cherry-pick the point at which we update without just updating the data at the root.~
Now that we have @davidkline-ms's perf markers, we could actually measure the impact of this change on-device.
Oh! This is specific to the hand mesh? Interesting...
Yeah, looks like we already transform the hand joints
https://github.com/microsoft/MixedRealityToolkit-Unity/blob/76922618bb14f59534ef3748f6088779f4b6a6b4/Assets/MRTK/Providers/WindowsMixedReality/XR2018/Controllers/WindowsMixedRealityArticulatedHand.cs#L158-L161
Transforming the hand mesh would likely be expensive. Maybe this is one we can adjust from a single point instead of adjusting every mesh vertex etc
@wiwei I will reiterate here a couple of things. First, the whole point of the Playspace node is to move the camera relative to the scene. It is easy to forget how useful that is when working with small demos, but on a full blown application, it is essential to be able to move the user relative to the virtual scenery. The camera and the Playspace transforms are modified by the SDK and MRTK respectively. The transform I actually modify is the parent of the Playspace.
Moving everything in the scene instead of moving the camera seems attractive when you are only responsible for the camera and want to make it someone else's problem, but in addition to the obvious downside, it has more subtle issues.
First, imposing a restriction that everything in the scene must be attached to a single node breaks your additive scene loading. Multiple scenes can't be loaded onto a single node.
Next, it means that you can't have arbitrary objects as root nodes in the scene, you only get one root node. That limits some Unity scenarios.
Third, you've just broken physics. Intuitively, when you want a closer look at the china cabinet, instead of moving yourself to the china cabinet, you have to grab the china cabinet and pull it to you. By the time it gets to you, there's not much china left to examine.
But more to the point, real world applications (and WLT) need this capability. It's no simpler if pushed out of MRTK and onto the application's domain, in fact it's even more difficult. Plus then every application needs to deal with it, rather than it being dealt with once.
MRTK mostly deals with this correctly already. As Kurtis pointed out, the hand joints are already corrected by the Playspace transform. Leaving it in an inconsistent state, partly compensating for the Playspace (hand-joints, spatial mapping, ray tests, etc. all working fine), but with a small number of places failing to compensate seems bad.
@wiwei To be clear, the repro steps I gave are a minimal easy way to reproduce the issue. A more real-world (but less helpful to whomever is trying to debug this) repro would be to set up a scene using MRTK's teleport mechanism, teleport, and then note that the hands are displaying incorrectly.
The fix is pretty trivial, both in extent and performance cost. Here's a PR for it: https://github.com/microsoft/MixedRealityToolkit-Unity/pull/7708. Of particular note in the PR is that this fix applies only to the WMR articulated hands implementation. I wouldn't know if there are other similar platform implementations (which might require a similar fix (if they don't already have it)).