瀏覽代碼

fix: iframe 的 window 事件也加在parent.window一下

xzw 2 年之前
父節點
當前提交
526b3db7e3
共有 2 個文件被更改,包括 29 次插入15 次删除
  1. 28 14
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map

+ 28 - 14
public/lib/potree/potree.js

@@ -90815,6 +90815,10 @@ void main()
 			this.domElement.addEventListener('click', this.onMouseClick.bind(this), false);
 			this.domElement.addEventListener('mousedown', this.onMouseDown.bind(this), false);
 			window.addEventListener('mouseup', this.onMouseUp.bind(this), false);
+	        if(Potree.isIframeChild){//子页面的话在父页面也要加侦听(应该不会有多层吧?否则要一直加到最外层)
+	            window.parent.addEventListener('mouseup', this.onMouseUp.bind(this), false);
+	        }
+	        
 			this.domElement.addEventListener('mousemove', this.onMouseMove.bind(this), false);
 	        //add
 	       /*  this.domElement.addEventListener("pointerout", this.onMouseUp.bind(this)),
@@ -90839,7 +90843,7 @@ void main()
 			this.domElement.addEventListener('touchend', this.onTouchEnd.bind(this));
 			this.domElement.addEventListener('touchmove', this.onTouchMove.bind(this));
 	          
-	        
+	          
 	        {
 	            this.addEventListener('isMeasuring',(e)=>{ 
 	                //console.log('isMeasuring',e.v,e.cause)
@@ -90851,9 +90855,9 @@ void main()
 	            this.interactHistory = {};  //清空
 	        });
 	        
-	        
-		}
-
+	           
+		}  
+	     
 		/* addInputListener (listener) {
 			this.inputListeners.push(listener);
 		}
@@ -91443,9 +91447,8 @@ void main()
 	                
 	                this.lastClickTime = now;
 	            }
-
-	            this.drag = null;
-	             
+	        
+	            this.drag = null; 
 			}
 
 	        this.dragViewport = null;
@@ -91942,7 +91945,7 @@ void main()
 	                }
 	            )); 
 	        }
-			
+			 
 		}
 
 		/* getMousePointCloudIntersection (mouse) {
@@ -138972,7 +138975,12 @@ ENDSEC
 	    const useParentScreenSpaceError = parent && (!maySkipTile || this._screenSpaceError === 0.0 || parent.hasTilesetContent);
 	    const screenSpaceError = useParentScreenSpaceError ? parent._screenSpaceError : this._screenSpaceError;
 	    const rootScreenSpaceError = traverser.root ? traverser.root._screenSpaceError : 0.0;
-	    return Math.max(rootScreenSpaceError - screenSpaceError, 0);
+	    let v = Math.max(rootScreenSpaceError - screenSpaceError, 0);
+	    if(!this._visible){
+	        v = THREE.Math.clamp(v * 0.1,  -0.9, 100);//xzw add
+	        console.log('v',v);
+	    }
+	    return v
 	  }
 
 	  async loadContent() {
@@ -147613,12 +147621,15 @@ ENDSEC
 
 	lastRootTransform  rootTransformInverse
 
+	tileset._loadTiles 依次加载tiles
+	request.priority = request.getPriority(request.handle);  加载优先级 
+
 
 	笔记:
 
 
 	主要类:
-	class tileset3D 最外层整体。 获取方法: viewer.objs.children[index].runtime.getTileset()。   _tiles包含所有tiles
+	class tileset3D 最外层整体。 获取方法: viewer.objs.children[index].runtime.getTileset()。   .tiles包含所有tiles
 	class tileHeader 也就是tileset里面的一个个tile 。  其上有.tileset
 
 
@@ -147628,8 +147639,8 @@ ENDSEC
 
 	tileset里算的tileTrasnform之后是不会改变的, tile.transform也是,是json里的。
 
-	tileset.modelMatrix会随着位移改变
-	tile.computedTransform 被我修改了,之前左乘了tileset.modelMatrix,现只包含了transform信息     _updateTransform(parentTransfor  其中有_updateBoundingVolume,这个影响可见性, 在computeVisibilityWithPlaneMask中计算
+	tileset.modelMatrix  (通常这个值很大) 会随着位移改变
+	tile.computedTransform   被我修改了,之前左乘了tileset.modelMatrix,现只包含了transform信息     _updateTransform(parentTransfor  其中有_updateBoundingVolume,这个影响可见性, 在computeVisibilityWithPlaneMask中计算
 
 	 
 	 
@@ -147641,7 +147652,7 @@ ENDSEC
 	    return  this._inRequestVolume; //去掉了_visible ||  
 	}
 
-
+	显示所有tile似乎也不会卡顿. 但好像影响了加载顺序从而变慢了
 
 	 */
 
@@ -150489,7 +150500,10 @@ ENDSEC
 	let loaders = {};
 
 	let mapArea; 
-	let shelterHistory = [];
+	let shelterHistory = []; 
+	Potree.isIframeChild = window.parent!=window;  //子页面
+
+
 
 
 

文件差異過大導致無法顯示
+ 1 - 1
public/lib/potree/potree.js.map