Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct parenting of spatial mesh to preserve local transform. #9819

Merged
merged 1 commit into from
May 14, 2021

Conversation

fast-slow-still
Copy link
Contributor

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.

This optional section is a place where you can detail the specific type of verification
you want from reviewers. For example, if you want reviewers to checkout the PR locally
and validate the functionality of specific scenarios, provide instructions
on the specific scenarios and what you want verified.

If there are specific areas of concern or question feel free to highlight them here so
that reviewers can watch out for those issues.

As a reviewer, it is possible to check out this change locally by using the following
commands (substituting {PR_ID} with the ID of this pull request):

git fetch origin pull/{PR_ID}/head:name_of_local_branch

git checkout name_of_local_branch

Copy link

@david-c-kline david-c-kline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice clean fix!

@david-c-kline
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@david-c-kline david-c-kline merged commit 969c7d1 into microsoft:main 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XR SDK Spatial meshes partially broken with non-identity playspace
3 participants