|
@@ -18438,9 +18438,9 @@ window.Modernizr = function(n, e, t) {
|
|
side: r.DoubleSide,
|
|
side: r.DoubleSide,
|
|
opacity: 0,
|
|
opacity: 0,
|
|
transparent: !0,
|
|
transparent: !0,
|
|
- depthWrite: !1,
|
|
|
|
- visible:this.showFloorMarker // 隐藏/显示地面标志
|
|
|
|
|
|
+ depthWrite: !1
|
|
})),
|
|
})),
|
|
|
|
+ this.marker.visible = this.showFloorMarker,
|
|
this.marker.renderOrder = s.panoMarker,
|
|
this.marker.renderOrder = s.panoMarker,
|
|
this.marker.name = "marker",
|
|
this.marker.name = "marker",
|
|
this.marker.pano = this,
|
|
this.marker.pano = this,
|
|
@@ -23433,9 +23433,25 @@ window.Modernizr = function(n, e, t) {
|
|
n.prototype.render = function() {
|
|
n.prototype.render = function() {
|
|
this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
|
|
this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
|
|
}
|
|
}
|
|
- ,
|
|
|
|
|
|
+
|
|
/******************************************************************************************************徐世廷**********************************************************************/
|
|
/******************************************************************************************************徐世廷**********************************************************************/
|
|
- n.prototype.boluoVrInit = function() {
|
|
|
|
|
|
+
|
|
|
|
+ var vrPermission = {};
|
|
|
|
+ var vrPermissionCallBack = function(info1,info2){
|
|
|
|
+ if(info1 == "reset"){
|
|
|
|
+ vrPermission = {};
|
|
|
|
+ }else{
|
|
|
|
+ vrPermission[info1] = info2
|
|
|
|
+ if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
|
|
|
|
+ alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ n.prototype.boluoVrInit = function() {
|
|
|
|
|
|
console.log("boluoVrInit")
|
|
console.log("boluoVrInit")
|
|
|
|
|
|
@@ -23462,9 +23478,76 @@ window.Modernizr = function(n, e, t) {
|
|
a.setSize(window.innerWidth, window.innerHeight),
|
|
a.setSize(window.innerWidth, window.innerHeight),
|
|
window._vrEnabled = b
|
|
window._vrEnabled = b
|
|
|
|
|
|
-
|
|
|
|
- setTimeout(function(){console.log(player.cameraControls.activeControl.camera.fov)},500)
|
|
|
|
|
|
+ if(b){
|
|
|
|
+ setTimeout(function(){
|
|
|
|
+ console.log("orientEnable"+window.orientEnable)
|
|
|
|
+ if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
|
|
|
|
+ if(m.detectIOS()/* && m.detectSafari() */){
|
|
|
|
+ var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
|
|
|
|
+ //console.log("开始获取权限 major"+b.major)
|
|
|
|
+ if(b.major == 12 && b.minor>=2){
|
|
|
|
+ if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
|
|
|
|
+ else{//app??
|
|
|
|
+ alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
|
|
|
|
+ }
|
|
|
|
+ }else if(b.major >= 13){
|
|
|
|
+ var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
|
|
|
|
+ hasFailed || alert("'请点击“允许”'");
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ if(!window.vrEnabled || window.orientEnable)return;
|
|
|
|
+ vrPermissionCallBack("reset")
|
|
|
|
+ if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
|
|
|
|
+ console.log("开始获取权限1")
|
|
|
|
+ ///注意:需要https 本地服务器permissionState会得到denied
|
|
|
|
+ window.DeviceMotionEvent.requestPermission().then(permissionState => {
|
|
|
|
+ console.log("permissionState1: "+permissionState)
|
|
|
|
+ vrPermissionCallBack("deviceMotion", permissionState)
|
|
|
|
+
|
|
|
|
+ }).catch(function(e){
|
|
|
|
+ vrPermissionCallBack("deviceMotion", false)
|
|
|
|
+ console.log(e)
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ console.log("window.DeviceMotionEvent undefined")
|
|
|
|
+ vrPermissionCallBack("deviceMotion", false)
|
|
|
|
+ }
|
|
|
|
+ if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
|
|
|
|
+ console.log("开始获取权限2")
|
|
|
|
+ window.DeviceOrientationEvent.requestPermission().then(permissionState => {
|
|
|
|
+ console.log("permissionState2: "+permissionState)
|
|
|
|
+
|
|
|
|
+ vrPermissionCallBack("deviceOrientation", permissionState)
|
|
|
|
+ }).catch(function(e){
|
|
|
|
+ vrPermissionCallBack("deviceOrientation", false)
|
|
|
|
+ console.log(e)
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ console.log("window.DeviceOrientationEvent undefined")
|
|
|
|
+ vrPermissionCallBack("deviceOrientation", false)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },hasFailed ? 0 : 150)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /* /* setTimeout(function(){
|
|
|
|
+ if(settings.vrEnabled && !window.orientEnable){
|
|
|
|
+ $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
|
|
|
|
+ }
|
|
|
|
+ },4000) */
|
|
|
|
|
|
|
|
+
|
|
|
|
+ }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
|
|
|
|
+ }else{
|
|
|
|
+ //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ //已经触发了
|
|
|
|
+ }
|
|
|
|
+ },200);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}),
|
|
}),
|
|
this.createCursor(.5, !1, 1, 16777215, 0);
|
|
this.createCursor(.5, !1, 1, 16777215, 0);
|
|
@@ -23530,6 +23613,7 @@ window.Modernizr = function(n, e, t) {
|
|
}
|
|
}
|
|
|
|
|
|
,
|
|
,
|
|
|
|
+ window.orientEnable = 0; //是否能触发deviceorientation
|
|
n.prototype.CursorAnimation = function(a, b, c) {
|
|
n.prototype.CursorAnimation = function(a, b, c) {
|
|
function d() {
|
|
function d() {
|
|
g.orient = r.Math.degToRad(window.orientation || 0)
|
|
g.orient = r.Math.degToRad(window.orientation || 0)
|
|
@@ -23537,7 +23621,9 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
|
|
|
|
function e(a) {
|
|
function e(a) {
|
|
- //console.log("ro")
|
|
|
|
|
|
+ if(!window.vrEnabled && window.orientEnable) return;
|
|
|
|
+ window.orientEnable || (window.orientEnable = 1);
|
|
|
|
+
|
|
var b = r.Math.degToRad(a.alpha)
|
|
var b = r.Math.degToRad(a.alpha)
|
|
, c = r.Math.degToRad(a.beta)
|
|
, c = r.Math.degToRad(a.beta)
|
|
, d = r.Math.degToRad(a.gamma);
|
|
, d = r.Math.degToRad(a.gamma);
|
|
@@ -23602,9 +23688,10 @@ window.Modernizr = function(n, e, t) {
|
|
}(c)
|
|
}(c)
|
|
}),
|
|
}),
|
|
this.update = function(a) {
|
|
this.update = function(a) {
|
|
- TWEEN.update(),
|
|
|
|
- window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
|
|
|
|
- this.triggerTargetEvent())
|
|
|
|
|
|
+ TWEEN.update();
|
|
|
|
+ if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
|
|
|
|
+ else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
|
|
|
|
+ this.triggerTargetEvent())
|
|
}
|
|
}
|
|
,
|
|
,
|
|
this.triggerTargetEvent = function() {
|
|
this.triggerTargetEvent = function() {
|
|
@@ -23744,9 +23831,11 @@ window.Modernizr = function(n, e, t) {
|
|
this._overlap = .064,
|
|
this._overlap = .064,
|
|
this.cameraL = new r.PerspectiveCamera,
|
|
this.cameraL = new r.PerspectiveCamera,
|
|
this.cameraL.layers.enable(1),
|
|
this.cameraL.layers.enable(1),
|
|
|
|
+ this.cameraL.near = 0.01,//xzw add
|
|
this.cameraL.matrixAutoUpdate = !1,
|
|
this.cameraL.matrixAutoUpdate = !1,
|
|
this.cameraR = new r.PerspectiveCamera,
|
|
this.cameraR = new r.PerspectiveCamera,
|
|
this.cameraR.layers.enable(2),
|
|
this.cameraR.layers.enable(2),
|
|
|
|
+ this.cameraR.near = 0.01,//xzw add
|
|
this.cameraR.matrixAutoUpdate = !1,
|
|
this.cameraR.matrixAutoUpdate = !1,
|
|
this.eyeRight = new r.Matrix4,
|
|
this.eyeRight = new r.Matrix4,
|
|
this.eyeLeft = new r.Matrix4,
|
|
this.eyeLeft = new r.Matrix4,
|