xzw 1 rok pred
rodič
commit
33b0f96987

+ 20 - 5
src/custom/modules/panos/Images360.js

@@ -1991,6 +1991,21 @@ export class Images360 extends THREE.EventDispatcher{
                         if(Potree.settings.isTest){
                             var colorHue = Math.random();
                             tile.material.color = (new THREE.Color()).setHSL(colorHue, 0.6, 0.7)  
+                            
+                            
+                            tile.scoreLabel = new TextSprite(  { 
+                                backgroundColor: { r: 0, g: 0, b: 0, a: 0 },
+                                textColor: { r: 0, g: 0, b: 0, a: 1 },
+                                borderRadius: 15,
+                                renderOrder: 50,  fontsize : 13,
+                                text: '' ,
+                                dontFixOrient:true
+                            })  
+                            tile.scoreLabel.sprite.material.side = 2;
+                            tile.scoreLabel.rotation.x = Math.PI
+                            
+                            tile.add(tile.scoreLabel) 
+                            
                         }
                         
                         tile.visible = false 
@@ -2097,14 +2112,14 @@ export class Images360 extends THREE.EventDispatcher{
                 let pos = e.getWorldPosition(new THREE.Vector3())
                 let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
 
-                let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
+                let hcos_ = dir.clone().setZ(direction.z).normalize().dot(direction) //在direction的斜面上水平角度差
                 let hRad = Math.acos(hcos_)
                 let vRad = -200
-                if (hRad > hfov + 0.1) {
+                if (/* hRad > hfov + 0.08 */ hRad / hfov > 1.5 ) {   
                     e.score = -100
                 } else {
-                    vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
-                    if (vRad > vfov + 0.1) {
+                    vRad = Math.abs(Math.acos(dir.z) - Math.acos(direction.z))
+                    if (/* vRad > vfov + 0.08 */ vRad / vfov > 1.5 ) {
                         e.score = -100
                     } else {
                         e.score = -(hRad / hfov + vRad / vfov)
@@ -2117,7 +2132,7 @@ export class Images360 extends THREE.EventDispatcher{
                 }
             })
             this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
-            //list.forEach(e=>e.scoreLabel.setText(e.scores))
+            list.forEach(e=>e.scoreLabel.setText(e.scores))
         }
 
         let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)

+ 5 - 7
src/custom/viewer/ViewerNew.js

@@ -86,10 +86,10 @@ let shelterHistory = []
 
 
 Potree.isIframeChild = window.parent!=window  //子页面
-if(Potree.isIframeChild){ 
+/* if(Potree.isIframeChild){ 
     let rootWin = Common.getRootWindow() 
     rootWin && rootWin.viewer.dispatchEvent({type:'createIframe', window}) //给祖先页面发送信息,得不到可能跨域了或无viewer
-} 
+}  */
 /* window.addEventListener('focus',()=>{
     console.log('focus',window.winIndex)
 })
@@ -786,17 +786,15 @@ export class Viewer extends ViewerBase{
         } 
         
         
-        if(!Potree.isIframeChild){
+        /* if(!Potree.isIframeChild){
             window.winIndex = 0;
             let index = 1;
             this.addEventListener('createIframe',(e)=>{//创建了子页面
                 let child = e.window;
-                child.winIndex = index ++;
-                
-                
+                child.winIndex = index ++; 
             }) 
             //不知道删除iframe时是否那些模型还在内存里,需要释放吗? 如果要需要加一个事件
-        }
+        } */