Skip to content

Commit

Permalink
Bug 1641593 - Apply sensor orientation in XRNativeOriginViewer refere…
Browse files Browse the repository at this point in the history
…nce space r=kip,daoshengmu

Differential Revision: https://phabricator.services.mozilla.com/D77283
  • Loading branch information
MortimerGoro committed May 28, 2020
1 parent 7e6883c commit af94e32
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dom/vr/XRNativeOriginViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@ gfx::PointDouble3D XRNativeOriginViewer::GetPosition() {
sensorState.pose.position[2]);
}

gfx::QuaternionDouble XRNativeOriginViewer::GetOrientation() {
const gfx::VRHMDSensorState& sensorState = mDisplay->GetSensorState();
return gfx::QuaternionDouble(
sensorState.pose.orientation[0], sensorState.pose.orientation[1],
sensorState.pose.orientation[2], sensorState.pose.orientation[3]);
}

} // namespace dom
} // namespace mozilla
1 change: 1 addition & 0 deletions dom/vr/XRNativeOriginViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class XRNativeOriginViewer : public XRNativeOrigin {
explicit XRNativeOriginViewer(gfx::VRDisplayClient* aDisplay);

gfx::PointDouble3D GetPosition() override;
gfx::QuaternionDouble GetOrientation() override;

private:
~XRNativeOriginViewer() = default;
Expand Down

0 comments on commit af94e32

Please sign in to comment.