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

Fix XRFrame.getPose matrix math #20571

Merged
merged 1 commit into from Dec 3, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 3, 2019

There were a few issues here. Most of them either cancelled each other
out or (due to overrides) weren't hit.

  • The comment above XRFrame::getPose was incorrect
    • This has now been updated, and the parameters were renamed to better
      match the spec, and hopefully prevent further confusion
  • XRSpace::getPose was returning other_from_base and not base_from_other
    • TargetRaySpace and GripSpace actually have overrides that do the
      right thing in this case, and so were unaffected.
    • XRReferenceSpace did call up to this, but mostly cancelled out this
      inversion due to the next issue.
  • XRReferenceSpace::MojoFromSpace was returning SpaceFromMojo
    • This caused the error above to not be as noticed.

As a result, the xrFrame_getPose test has had it's matrix updated and a
new test has been added which should hopefully help catch this.

Note that if a grip or target space is supplied as the first parameter
to getPose (the common case), the math is being done correctly.
Also note that the two inversions for references spaces also mostly
cancels each other right.
The main issue that was affected is if a reference space with an origin
offset was supplied as the first parameter to xrFrame.getPose

Fixed: 1030049
Change-Id: I0184607dbd0fef991c382289e1c764f9a1b336a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947629
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721105}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

There were a few issues here. Most of them either cancelled each other
out or (due to overrides) weren't hit.
* The comment above XRFrame::getPose was incorrect
  - This has now been updated, and the parameters were renamed to better
    match the spec, and hopefully prevent further confusion
* XRSpace::getPose was returning other_from_base and not base_from_other
  - TargetRaySpace and GripSpace actually have overrides that do the
    right thing in this case, and so were unaffected.
  - XRReferenceSpace did call up to this, but mostly cancelled out this
    inversion due to the next issue.
* XRReferenceSpace::MojoFromSpace was returning SpaceFromMojo
  - This caused the error above to not be as noticed.

As a result, the xrFrame_getPose test has had it's matrix updated and a
new test has been added which should hopefully help catch this.

Note that if a grip or target space is supplied as the first parameter
to getPose (the common case), the math is being done correctly.
Also note that the two inversions for references spaces also mostly
cancels each other right.
The main issue that was affected is if a reference space with an origin
offset was supplied as the first parameter to xrFrame.getPose

Fixed: 1030049
Change-Id: I0184607dbd0fef991c382289e1c764f9a1b336a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1947629
Commit-Queue: Alexander Cooper <alcooper@chromium.org>
Auto-Submit: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721105}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants