Correct parenting of spatial mesh to preserve local transform.#9819
Merged
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
RogPodge
approved these changes
May 14, 2021
david-c-kline
pushed a commit
that referenced
this pull request
May 15, 2021
Merge pull request #9819 from fast-slow-still/spatFix
david-c-kline
pushed a commit
that referenced
this pull request
May 24, 2021
[2.6.2] Cherry-pick #9819
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
When the spatial mesh's transform was getting attached to the ObservedObjectParent using the parent property, the default behavior of preserving world space position was kicking in.
This sounds right, but isn't. It meant that the current ObservedObjectParent's transform (which ultimately resolves to the MRTK Playspace transform) was getting discarded (or more specifically, absorbed into the mesh's local transform).
This led to the observed behavior, that when the MRTK Playspace transform changed, existing spatial meshes remained in correct position (because they were attached to the MRTK Playspace). But new spatial meshes, because they essentially discarded the playspace transform, would appear offset from their physical counterparts.
Changes
Verification
The issue was most easily seen by clearing the hololens spatial map via WDP before running.
Only XRSDK was affected. WSA worked fine, OpenXR doesn't seem to have spatial meshes yet.