exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖
MIT License
992 stars 117 forks source link

Mozilla Hubs support #810

Open chrislatorres opened 5 years ago

chrislatorres commented 5 years ago

Issue related to #595 , but this was tested on windows desktop.

Windows 10 Enterprise 2016 LTSB Node v11.0.0 Exokit v0.0.517


Command ran in administrative powershell: node . https://hubs.mozilla.com/4COe4uH/definitive-modern-get-together/ -x webvr


PS C:\exokit> node . https://hubs.mozilla.com/4COe4uH/definitive-modern-get-together/ -x webvr
A-Frame Version: https://github.com/MozillaReality/aframe
three Version: https://github.com/MozillaReality/three.js
core:schema:warn Default value `null` does not match type `string` in component `media-loader`
core:schema:warn Default value `false` does not match type `string` in component `vr-mode-toggle-class`
core:schema:warn Default value `null` does not match type `string` in component `emit-scene-event-on-remove`
TypeError: Cannot read property 'toLowerCase' of undefined
    at Object.36 (https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:433348)
    at o (https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:518)
    at Module.1386 (https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:76418)
    at o (https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:518)
    at i (https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:387)
    at https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:1493
    at https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:1497
    at Object._runJavascript (C:\exokit\src\utils.js:71:15)
    at ownerDocument.defaultView.fetch.then.then.s (C:\exokit\src\DOM.js:1655:17)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
THREE.WebGLRenderer 101
TypeError: Cannot read property 'store' of undefined
    at init (https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:67935)
    at i.e.exports.System (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:1:38656)
    at new i (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:1:39452)
    at HTMLElement.value (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:305408)
    at HTMLElement.value (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:305328)
    at HTMLElement.value (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:304220)
    at HTMLElement.value (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:1:46057)
    at m (https://assets-prod.reticulum.io/assets/js/vendor-d795dd9372c72f6fdaeb.js:579:1381)
    at o (https://assets-prod.reticulum.io/assets/js/vendor-d795dd9372c72f6fdaeb.js:579:80)
    at Document.f (https://assets-prod.reticulum.io/assets/js/vendor-d795dd9372c72f6fdaeb.js:579:719)
THREE.GLTFLoader: Duplicating UVs to support aoMap.
core:a-node:error Failure loading node:   TypeError: Cannot read property 'RENDER_ORDER' of undefined
    at n.init (https://assets-prod.reticulum.io/assets/js/hub-5bfbf04815a48802b778.js:1:511526)
    at n.initComponent (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:161530)
    at n.updateProperties (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:161243)
    at n.e.exports.Component (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:159627)
    at new n (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:165812)
    at HTMLElement.value (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:179779)
    at HTMLElement.value (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:181282)
    at HTMLElement.value (https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:181065)
    at https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:179132
    at https://assets-prod.reticulum.io/assets/js/engine-f248132fbea935ab5d3f.js:5:116906
[mp3 @ 0000024a40b34100] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b34100] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b34100] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b34100] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b34100] Format mp3 detected only with low score of 5, misdetection possible!
[mp3 @ 0000024a40b34100] Format mp3 detected only with low score of 5, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
[mp3 @ 0000024a40b438c0] Format mp3 detected only with low score of 25, misdetection possible!
avaer commented 5 years ago

This should be booting to gl with no errors now, but it doesn’t draw the scene yet. I suspect it’s waiting on some Dom event somewhere.

avaer commented 5 years ago

We are now at the point of the GLTF's loading.

Failed to load glTF model SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at GLTFLoader._parse (/assets/js/engine-e09011c21b70db7e9dac.js:39180:20)
    at Object.onLoad (/assets/js/engine-e09011c21b70db7e9dac.js:39114:12)
    at XMLHttpRequest.<anonymous> (/assets/js/engine-e09011c21b70db7e9dac.js:71020:39)
    at handleListener (C:\Users\kbiedrzycki\Documents\GitHub\exokit4\node_modules\window-xhr\lib\eventtarget.js:91:23)
    at Array.some (<anonymous>)
    at XMLHttpRequest._invoke (C:\Users\kbiedrzycki\Documents\GitHub\exokit4\node_modules\window-xhr\lib\eventtarget.js:89:20)
    at XMLHttpRequest._dispatch (C:\Users\kbiedrzycki\Documents\GitHub\exokit4\node_modules\window-xhr\lib\eventtarget.js:109:13)
    at XMLHttpRequest.dispatchEvent (C:\Users\kbiedrzycki\Documents\GitHub\exokit4\node_modules\window-xhr\lib\eventtarget.js:152:22)
    at IncomingMessage.stream.on (C:\Users\kbiedrzycki\Documents\GitHub\exokit4\node_modules\window-xhr\lib\xmlhttprequest.js:146:10)

However, it seems that Hubs/WDS/AWS serves illegal gzip data in response to a non-gzip request, so we need to more craftfully handle that spec inconsistency.

avaer commented 5 years ago

With the latest changes we have initial XR booting into Hubs as a reality tab.

Capture4

chrislatorres commented 5 years ago

From @netpro2k :

Fwiw you should be able to get a local hubs client working against our dev server pretty easily. This might help to let you just hack apart the client a bit to pave over any roadbumps to get further down the line.

Just check out https://github.com/mozilla/hubs, npm ci and npm start then map hubs.local in your hosts file and open hubs.local:8080

chrislatorres commented 5 years ago

?vr_entry_type=vr_now is needed to auto-enter

avaer commented 5 years ago

With https://github.com/exokitxr/exokit/pull/1322, we have a boot into xr with the tracked model.

Capture 34

avaer commented 5 years ago

The command for the above was:

node . -x none  "https://hubs.local:8080/hub.html?hub_id=ziCzppo&vr_entry_type=2d_now&disable_telemetry=true"
Utopiah commented 3 years ago

using node . -x none "https://hubs.mozilla.com/DBVvfHs/lets-run-and-cycle-in-vr/?vr_entry_type=2d_now&disable_telemetry=true" > log with exokit 0.0.525 on node v12.9.0 on Linux I get

fabien@fabien-CORSAIR-ONE-i160:~/Prototypes/exokit$ grep Error log | sort | uniq
core:a-node:error Failure loading node:   TypeError: Cannot read property 'physicsSystem' of undefined
core:a-node:error Failure loading node:   TypeError: Cannot set property 'raycast' of undefined
ErrorEvent {
Failed to load glTF model TypeError: Cannot read property 'store' of undefined
TypeError: MediaRecorder.isTypeSupported is not a function
    'TypeError: MediaRecorder.isTypeSupported is not a function\n' +
unhandled rejection: TypeError: Cannot read property 'batchManagerSystem' of undefined
unhandled rejection: TypeError: Cannot read property 'store' of undefined
unhandled rejection: TypeError: Cannot read property 'transforming' of undefined

Full logs https://gist.github.com/Utopiah/2761dd6bd26cbb45163b317490fa58ff