When attempting to launch a scene with controllers, an error occurs where the var position = sourcePose.transform.position line will be given a null value and the application crashes in Chrome if no controller is found or tracking is lost. A temporary fix was to check (in a not so DRY) manner the following in the webxr.js file:
...
let sourcePose = frame.getPose(source.gripSpace, this.refSpace);
if(sourcePose != null){
var position = sourcePose.transform.position;
} else {
var position = [0,0,0];
}
if(sourcePose != null){
var orientation = sourcePose.transform.orientation;
} else {
var orientation = [0,0,0];
}
//Structure of this corresponds with WebXRControllerData.cs
When attempting to launch a scene with controllers, an error occurs where the var position = sourcePose.transform.position line will be given a null value and the application crashes in Chrome if no controller is found or tracking is lost. A temporary fix was to check (in a not so DRY) manner the following in the webxr.js file:
... let sourcePose = frame.getPose(source.gripSpace, this.refSpace); if(sourcePose != null){ var position = sourcePose.transform.position; } else { var position = [0,0,0]; }
if(sourcePose != null){ var orientation = sourcePose.transform.orientation; } else { var orientation = [0,0,0]; }
//Structure of this corresponds with WebXRControllerData.cs
...