Commit 78361aa5 authored by Piotr Bialecki's avatar Piotr Bialecki Committed by Commit Bot

Fix DOMPointReadOnly creation in XRRay polyfill

This fixes plane detection sample when running w/o WebXRHitTest.

Change-Id: Ic48751677a1e1d2aef702513346993909f783bfa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1663314
Commit-Queue: Piotr Bialecki <bialpio@chromium.org>
Commit-Queue: Bill Orr <billorr@chromium.org>
Auto-Submit: Piotr Bialecki <bialpio@chromium.org>
Reviewed-by: default avatarBill Orr <billorr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669892}
parent 371610cb
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
// |matrix| - Float32Array representing 4x4 matrix (column major) // |matrix| - Float32Array representing 4x4 matrix (column major)
// |point| - DOMPointReadOnly // |point| - DOMPointReadOnly
const transformByMatrix = function(matrix, point){ const transformByMatrix = function(matrix, point){
return new DOMPointReadOnly({ return new DOMPointReadOnly(
x : matrix[0] * point.x + matrix[4] * point.y + matrix[8] * point.z + matrix[12] * point.w, matrix[0] * point.x + matrix[4] * point.y + matrix[8] * point.z + matrix[12] * point.w,
y : matrix[1] * point.x + matrix[5] * point.y + matrix[9] * point.z + matrix[13] * point.w, matrix[1] * point.x + matrix[5] * point.y + matrix[9] * point.z + matrix[13] * point.w,
z : matrix[2] * point.x + matrix[6] * point.y + matrix[10] * point.z + matrix[14] * point.w, matrix[2] * point.x + matrix[6] * point.y + matrix[10] * point.z + matrix[14] * point.w,
w : matrix[3] * point.x + matrix[7] * point.y + matrix[11] * point.z + matrix[15] * point.w, matrix[3] * point.x + matrix[7] * point.y + matrix[11] * point.z + matrix[15] * point.w,
}); );
}; };
// |lhs|, |rhs| - Float32Arrays representing 4x4 matrices (column major) // |lhs|, |rhs| - Float32Arrays representing 4x4 matrices (column major)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment