Skip to content
Permalink
Browse files

Add test for viewer head pose

  • Loading branch information...
Manishearth committed Jun 12, 2019
1 parent 73bd249 commit f09d1608236976d946bcd76d665133dc05328f96
Showing with 4 additions and 3 deletions.
  1. +1 −1 tests/wpt/mozilla/meta/MANIFEST.json
  2. +3 −2 tests/wpt/mozilla/tests/webxr/obtain_frame.html
@@ -19687,7 +19687,7 @@
"testharness"
],
"webxr/obtain_frame.html": [
"d3c7d85c6cc6fcb65e674e8aeeab59b16db6c0a3",
"5182093b33f0870550157d648e41376a91fd95ce",
"testharness"
],
"webxr/resources/webxr-util.js": [
@@ -24,9 +24,10 @@
let space = await session.requestReferenceSpace("local");
let pose = frame.getViewerPose(space);
for (view of pose.views) {
assert_matrix_approx_equals(view.projectionMatrix, VALID_PROJECTION_MATRIX, 0.001, "left projection matrix");
assert_matrix_approx_equals(pose.transform.matrix, [1,0,0,0,0,0,1,0,0,-1,0,0,0.5,0.1,0.1,1], 0.001, "head pose matrix");
for (view of pose.views) {
assert_matrix_approx_equals(view.projectionMatrix, VALID_PROJECTION_MATRIX, 0.001, "projection matrix");
if (view.eye == "left") {
assert_matrix_approx_equals(view.transform.matrix, [1,0,0,0,0,0,1,0,0,-1,0,0,0.4,0.1,0.1,1], 0.001, "left transform");
assert_matrix_approx_equals(view.transform.inverse.matrix, [1,0,0,0,0,0,-1,0,0,1,0,0,-0.4,-0.1,0.1,1], 0.001, "left inverse transform");

0 comments on commit f09d160

Please sign in to comment.
You can’t perform that action at this time.