mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add test for viewer head pose
This commit is contained in:
parent
73bd249b7a
commit
f09d160823
2 changed files with 4 additions and 3 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue