Bug #126
closedCrash after loading gltf
0%
Description
Found that there is a fatal VR crash just after loading gltf, preventing VR users to enter worlds:
Loaded asset /content/char/male/bruce_lee/scene.gltf
asset-loader.js:44 Error in callback for /content/char/male/bruce_lee/scene.gltf DOMException: Failed to execute 'getViewerPose' on 'XRFrame': XRFrame access outside the callback that produced it is invalid.
at t.get (https://cdn.babylonjs.com/babylon.js:1:2729957)
at VRHelper.trackXrDevices (https://www.vrspace.org/babylon/js/ui/vr-helper.js:154:36)
at c.tracker [as callback] (https://www.vrspace.org/babylon/js/ui/vr-helper.js:46:33)
at e.notifyObservers (https://cdn.babylonjs.com/babylon.js:1:63927)
at t.render (https://cdn.babylonjs.com/babylon.js:1:534623)
at Avatar.headPos (https://www.vrspace.org/babylon/js/ui/avatar.js:515:16)
at Avatar._processContainer (https://www.vrspace.org/babylon/js/ui/avatar.js:248:42)
at https://www.vrspace.org/babylon/js/ui/avatar.js:495:18
at https://www.vrspace.org/babylon/js/ui/asset-loader.js:42:17
at p (https://cdn.babylonjs.com/babylon.js:1:1098457)
While debugging I found that it stops at avatar.js -> headPos()
There is a call:
this.scene.render(); // FIXME workaround
Which is not allowed from inside the callback.
Commenting this line makes the VR load "properly" again.