webxr-polyfill icon indicating copy to clipboard operation
webxr-polyfill copied to clipboard

Eventual crash on HoloLens from GamepadXRInputSource

Open speigg opened this issue 4 years ago • 1 comments

Runs fine for several minutes w/ hand tracking, until the following crash occurs:

Unable to get property '0' of undefined or null reference
TypeError: Unable to get property '0' of undefined or null reference
   at fromRotationTranslation (https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js:301:3)
   at GamepadXRInputSource.prototype.updateBasePoseMatrix (https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js:5541:7)
   at GamepadXRInputSource.prototype.getXRPose (https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js:5548:5)
   at WebVRDevice.prototype.getInputPose (https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js:5897:9)
   at XRFrame.prototype.getPose (https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js:1295:7)
   at update (https://10.0.0.72:1234/index.4ca7163e.js:17013:11)
   at onAnimationFrame (https://10.0.0.72:1234/index.4ca7163e.js:17380:7)
   at onAnimationFrame (https://10.0.0.72:1234/index.4ca7163e.js:10529:5)
   at Anonymous function[PRIVATE$15].onDeviceFrame (https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js:1465:7)

Note, I had to include a DOMPointReadOnly polyfill in order to run on HoloLens2 (as per #144)

speigg avatar Nov 12 '20 19:11 speigg

The problem seems to be that GamepadXRInputSource.prototype.updateBasePoseMatrix() assumes that the gamepad's pose orientation will always be available when position is available.

speigg avatar Nov 12 '20 19:11 speigg