In my currenty webvr project (which is based on an older webvr-Demo project) I map all vr-requests to the webvr polyfill, as this gives me only one solution to handle and also seems to be better supported on older android devices.
Vr.prototype.enterVr = function(){
console.log(this);
// check support -> currently bypassed to set all devices to webVRPolyfill
if (this.app.xr.isAvailable(pc.XRTYPE_VR && false)) {
// start session
this.cameraEntity.camera.startXr(pc.XRTYPE_VR, pc.XRSPACE_LOCALFLOOR);
} else {
//this.cameraEntity.camera.enterVr(()=>{});
//this.vrPolyfillActive = true;
if (typeof DeviceOrientationEvent.requestPermission === 'function') {
DeviceOrientationEvent.requestPermission()
.then(permissionState => {
if (permissionState === 'granted') {
//var position = this.cameraEntity.getPosition();
//this.cameraEntity.setPosition(position.x, position.y +1.7, position.z);
this.cameraEntity.camera.enterVr(()=>{});
this.vrPolyfillActive = true;
}
}).catch(console.error);
} else {
this.cameraEntity.camera.enterVr(()=>{});
this.vrPolyfillActive = true;
}
}
};
Yaustar recently fixed the camera-position in the current WebXR UI Interaction - Demo by changing the XR Space for the startXr-Call
this.cameraEntity.camera.startXr(pc.XRTYPE_VR, pc.XRSPACE_LOCALFLOOR);
How could this fix also be integraded into my polyfill vr only - Solution?
I tried to wrap my hand around the current WebXR UI Interaction Demo, but I’can’t see where the current call to the polyfill is now located, as there seems to be no other “VR start” besides the call startXR (which shouldn’t work on iOs?). Maybe someone (Yaustar?) could give me some hint on that.
Thanks in advance