From 463bc19e447830dc729e3c9eae9c7137ff395660 Mon Sep 17 00:00:00 2001 From: Michal Dybizbanski Date: Sat, 7 Mar 2020 13:10:58 +0100 Subject: [PATCH] Added DOMPointReadOnly import and its polyfill's fromPoint definition. The polyfill is necessary e.g. for Edge browser, when used in combination with ASUS headset. --- src/api/XRRigidTransform.js | 1 + src/lib/DOMPointReadOnly.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/api/XRRigidTransform.js b/src/api/XRRigidTransform.js index 7ff5dcf..2194ea5 100644 --- a/src/api/XRRigidTransform.js +++ b/src/api/XRRigidTransform.js @@ -16,6 +16,7 @@ import * as mat4 from 'gl-matrix/src/gl-matrix/mat4'; import * as vec3 from 'gl-matrix/src/gl-matrix/vec3'; import * as quat from 'gl-matrix/src/gl-matrix/quat'; +import DOMPointReadOnly from '../lib/DOMPointReadOnly'; export const PRIVATE = Symbol('@@webxr-polyfill/XRRigidTransform'); diff --git a/src/lib/DOMPointReadOnly.js b/src/lib/DOMPointReadOnly.js index 9851761..a147d03 100644 --- a/src/lib/DOMPointReadOnly.js +++ b/src/lib/DOMPointReadOnly.js @@ -60,6 +60,8 @@ if (!domPointROExport) { * @return {number} */ get w() { return this[PRIVATE].w } + + static fromPoint(p) { return new DOMPointReadOnly(p.x, p.y, p.z, p.w); } } }