我在桌面chrome上收到一个错误,那就是utils.device.checkHasPositionalTracking() is "not a function".
如果它已过时,我在哪里可以找到用于设备检测的utils.device方法的更新列表?官方文档似乎已经过时,并列出了设备检测的过时方法。浏览器似乎根本不能识别这一点。
let mobile = AFRAME.utils.device.isMobile ();
//// isOculusGo and isGearVR have been replaced with isMobileVR
//let gearVR = AFRAME.utils.device.isGearVR();
//let oculusGo = AFRAME.utils.device.isOculusGo();
let mobileVR = AFRAME.utils.device.isMobileVR
//let tracking = AFRAME.utils.device.checkHasPositionalTracking(); //not working
let headset =AFRAME.utils.device.checkHeadsetConnected();
if(mobile){
console.log("Viewer is mobile.");
}
if(mobileVR){
console.log("Viewer is MobileVR.");
}
/*if(tracking){
console.log("Viewer has positional tracking.");
}*/
if(headset){
console.log("Headset Connected.");
}前面的代码结果是"Viewer is MobileVR“,即使我是在台式机上测试。
发布于 2019-08-15 00:05:39
是的,它不见了,我在A-Frame的源代码中也找不到它。
我在文档中删除的拉取请求刚才被批准了:https://github.com/aframevr/aframe/pull/4255
https://stackoverflow.com/questions/56957045
复制相似问题