xzw 3 سال پیش
والد
کامیت
963318d35c
3فایلهای تغییر یافته به همراه167 افزوده شده و 86 حذف شده
  1. 125 69
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 41 16
      src/sdk/cover/index.js

+ 125 - 69
public/lib/potree/potree.js

@@ -2193,7 +2193,7 @@
 
     let textureId = 0;
 
-    function Texture( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
+    function Texture$1( image = Texture$1.DEFAULT_IMAGE, mapping = Texture$1.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
 
     	Object.defineProperty( this, 'id', { value: textureId ++ } );
 
@@ -2242,12 +2242,12 @@
 
     }
 
-    Texture.DEFAULT_IMAGE = undefined;
-    Texture.DEFAULT_MAPPING = UVMapping;
+    Texture$1.DEFAULT_IMAGE = undefined;
+    Texture$1.DEFAULT_MAPPING = UVMapping;
 
-    Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+    Texture$1.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
 
-    	constructor: Texture,
+    	constructor: Texture$1,
 
     	isTexture: true,
 
@@ -2502,7 +2502,7 @@
 
     } );
 
-    Object.defineProperty( Texture.prototype, 'needsUpdate', {
+    Object.defineProperty( Texture$1.prototype, 'needsUpdate', {
 
     	set: function ( value ) {
 
@@ -3206,7 +3206,7 @@
 
     	options = options || {};
 
-    	this.texture = new Texture( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );
+    	this.texture = new Texture$1( undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );
 
     	this.texture.image = {};
     	this.texture.image.width = width;
@@ -13123,7 +13123,7 @@
     	mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
     	format = format !== undefined ? format : RGBFormat;
 
-    	Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+    	Texture$1.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
     	this.flipY = false;
 
@@ -13141,7 +13141,7 @@
 
     }
 
-    CubeTexture.prototype = Object.create( Texture.prototype );
+    CubeTexture.prototype = Object.create( Texture$1.prototype );
     CubeTexture.prototype.constructor = CubeTexture;
 
     CubeTexture.prototype.isCubeTexture = true;
@@ -13296,7 +13296,7 @@
 
     function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
 
-    	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+    	Texture$1.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
     	this.image = { data: data || null, width: width || 1, height: height || 1 };
 
@@ -13311,7 +13311,7 @@
 
     }
 
-    DataTexture.prototype = Object.create( Texture.prototype );
+    DataTexture.prototype = Object.create( Texture$1.prototype );
     DataTexture.prototype.constructor = DataTexture;
 
     DataTexture.prototype.isDataTexture = true;
@@ -16580,7 +16580,7 @@
 
     function DataTexture2DArray( data = null, width = 1, height = 1, depth = 1 ) {
 
-    	Texture.call( this, null );
+    	Texture$1.call( this, null );
 
     	this.image = { data, width, height, depth };
 
@@ -16596,7 +16596,7 @@
 
     }
 
-    DataTexture2DArray.prototype = Object.create( Texture.prototype );
+    DataTexture2DArray.prototype = Object.create( Texture$1.prototype );
     DataTexture2DArray.prototype.constructor = DataTexture2DArray;
     DataTexture2DArray.prototype.isDataTexture2DArray = true;
 
@@ -16610,7 +16610,7 @@
     	//
     	// See #14839
 
-    	Texture.call( this, null );
+    	Texture$1.call( this, null );
 
     	this.image = { data, width, height, depth };
 
@@ -16627,7 +16627,7 @@
 
     }
 
-    DataTexture3D.prototype = Object.create( Texture.prototype );
+    DataTexture3D.prototype = Object.create( Texture$1.prototype );
     DataTexture3D.prototype.constructor = DataTexture3D;
     DataTexture3D.prototype.isDataTexture3D = true;
 
@@ -16674,7 +16674,7 @@
      *
      */
 
-    const emptyTexture = new Texture();
+    const emptyTexture = new Texture$1();
     const emptyTexture2dArray = new DataTexture2DArray();
     const emptyTexture3d = new DataTexture3D();
     const emptyCubeTexture = new CubeTexture();
@@ -28260,7 +28260,7 @@
 
     function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
 
-    	Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+    	Texture$1.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
     	this.format = format !== undefined ? format : RGBFormat;
 
@@ -28286,7 +28286,7 @@
 
     }
 
-    VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
+    VideoTexture.prototype = Object.assign( Object.create( Texture$1.prototype ), {
 
     	constructor: VideoTexture,
 
@@ -28315,7 +28315,7 @@
 
     function CompressedTexture( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
 
-    	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+    	Texture$1.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
     	this.image = { width: width, height: height };
     	this.mipmaps = mipmaps;
@@ -28332,20 +28332,20 @@
 
     }
 
-    CompressedTexture.prototype = Object.create( Texture.prototype );
+    CompressedTexture.prototype = Object.create( Texture$1.prototype );
     CompressedTexture.prototype.constructor = CompressedTexture;
 
     CompressedTexture.prototype.isCompressedTexture = true;
 
     function CanvasTexture( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
 
-    	Texture.call( this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+    	Texture$1.call( this, canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
     	this.needsUpdate = true;
 
     }
 
-    CanvasTexture.prototype = Object.create( Texture.prototype );
+    CanvasTexture.prototype = Object.create( Texture$1.prototype );
     CanvasTexture.prototype.constructor = CanvasTexture;
     CanvasTexture.prototype.isCanvasTexture = true;
 
@@ -28362,7 +28362,7 @@
     	if ( type === undefined && format === DepthFormat ) type = UnsignedShortType;
     	if ( type === undefined && format === DepthStencilFormat ) type = UnsignedInt248Type$1;
 
-    	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+    	Texture$1.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
 
     	this.image = { width: width, height: height };
 
@@ -28374,7 +28374,7 @@
 
     }
 
-    DepthTexture.prototype = Object.create( Texture.prototype );
+    DepthTexture.prototype = Object.create( Texture$1.prototype );
     DepthTexture.prototype.constructor = DepthTexture;
     DepthTexture.prototype.isDepthTexture = true;
 
@@ -38114,7 +38114,7 @@
 
     	load: function ( url, onLoad, onProgress, onError ) {
 
-    		const texture = new Texture();
+    		const texture = new Texture$1();
 
     		const loader = new ImageLoader( this.manager );
     		loader.setCrossOrigin( this.crossOrigin );
@@ -42412,7 +42412,7 @@
 
     					} else {
 
-    						texture = new Texture( image );
+    						texture = new Texture$1( image );
 
     					}
 
@@ -42932,9 +42932,9 @@
 
     			scope.manager.itemEnd( url );
 
-    		} ).catch( function ( e ) {
+    		} ).catch( function ( e ) { 
                 //console.log('error', url, e)
-    			if ( onError ) onError( e );
+    			if ( onError ) onError( e, url );
 
     			scope.manager.itemError( url );
     			scope.manager.itemEnd( url );
@@ -52704,7 +52704,7 @@
         TetrahedronGeometry: TetrahedronGeometry,
         TextBufferGeometry: TextBufferGeometry,
         TextGeometry: TextGeometry,
-        Texture: Texture,
+        Texture: Texture$1,
         TextureLoader: TextureLoader,
         TorusBufferGeometry: TorusBufferGeometry,
         TorusGeometry: TorusGeometry,
@@ -56989,7 +56989,7 @@ void main() {
     	
     	constructor( options={}){ 
             super();
-    		let map = new Texture();
+    		let map = new Texture$1();
     		map.minFilter = LinearFilter;
     		map.magFilter = LinearFilter;
             
@@ -57105,7 +57105,7 @@ void main() {
     			this.textColor.b + ',' + this.textColor.a + ')';
     		context.fillText(this.text , this.rectBorderThick + margin.x, spriteHeight/2  + diff );//x,y
 
-    		let texture = new Texture(canvas);
+    		let texture = new Texture$1(canvas);
     		texture.minFilter = LinearFilter;
     		texture.magFilter = LinearFilter;
     		texture.needsUpdate = true;
@@ -71553,7 +71553,7 @@ void main() {
     				width, height, border, srcFormat, srcType,
     				data);
     		}/* else if(texture instanceof THREE.CubeTexture){//add 
-            } */else if ((texture instanceof CanvasTexture) || (texture instanceof Texture)) {
+            } */else if ((texture instanceof CanvasTexture) || (texture instanceof Texture$1)) {
     			data = texture.image;
 
     			gl.texParameteri(this.target, gl.TEXTURE_WRAP_S, paramThreeToGL(gl, texture.wrapS));
@@ -71565,7 +71565,7 @@ void main() {
     			gl.texImage2D(this.target, level, internalFormat,
     				internalFormat, srcType, data);
 
-    			if (texture instanceof Texture) {gl.generateMipmap(gl.TEXTURE_2D);}
+    			if (texture instanceof Texture$1) {gl.generateMipmap(gl.TEXTURE_2D);}
     		}
 
     		gl.bindTexture(this.target, null);
@@ -81385,7 +81385,7 @@ void main() {
             context.clearRect(0,0,canvas.width,canvas.height);
             context.fillText(text, (canvas.width - textWidth) / 2 , (canvas.height + fontSize) / 2);
              
-            var tex = new Texture(canvas); 
+            var tex = new Texture$1(canvas); 
             tex.needsUpdate = true;
 
 
@@ -85471,9 +85471,9 @@ void main() {
         getIntersect(viewport,   onlyGetIntersect, pickWindowSize, dontIntersect, usePointcloud, prop={}){
             let intersectPoint;  
             let camera = viewport.camera;
-            
+            let raycaster; 
             if(Potree.settings.displayMode == 'showPanos' && viewer.images360.currentPano.pointcloud.hasDepthTex && !usePointcloud && !this.isMeasuring && viewport == viewer.mainViewport ){
-                let raycaster; 
+                
                 /* if(prop.point){
                     raycaster = new THREE.Raycaster() 
                     var dir = new THREE.Vector3().subVectors(prop.point, camera.position).normalize()
@@ -85523,7 +85523,14 @@ void main() {
             let intersectOnModel;
             
             if(Potree.settings.intersectOnObjs && !dontIntersect){
-                let intesects = this.getHoveredElements(viewer.objs.children, true);
+                if(prop.point){
+                    raycaster = new Raycaster(); 
+                    var dir = new Vector3().subVectors(prop.point, camera.position).normalize();
+                    raycaster.set(camera.position, dir); //var origin = new THREE.Vector3(pointer.x, pointer.y, -1).unproject(camera),
+                }  
+                
+                
+                let intesects = this.getHoveredElements(viewer.objs.children, true, raycaster);
                 
                 
                 if(intesects[0]){
@@ -85937,7 +85944,7 @@ void main() {
          
      
      
-    	getHoveredElements (interactables, dontCheckDis) {
+    	getHoveredElements (interactables, dontCheckDis, raycaster) {
              
             
     		let scenes = this.hoverViewport.interactiveScenes || this.interactiveScenes.concat(this.scene);
@@ -85945,7 +85952,9 @@ void main() {
     		let interactableListeners = ['mouseup', 'mousemove', 'mouseover', 'mouseleave', 'drag', 'drop', 'click', 'select', 'deselect'];
     		
             if(!interactables){
-                return [] /////暂时!!!!!!!!!!
+                if(Potree.settings.editType == 'merge'){
+                    return [] /////暂时!!!!!!!!!!因为卡顿
+                } 
                 interactables = [];
                 for (let scene of scenes) {
                     scene.traverseVisible(node => {//检测加了侦听的object
@@ -85960,24 +85969,23 @@ void main() {
                         }
                     });
                 }
-    		}
+    		}  
+    		 
     		let camera = this.hoverViewport.camera;
-            let ray = Utils.mouseToRay(this.pointer, camera  );
-    		
-    		let raycaster = new Raycaster();
-    		raycaster.ray.set(ray.origin, ray.direction);  
-            raycaster.camera = camera; //add
-            
-          
+            if(!raycaster){ 
+                let ray = Utils.mouseToRay(this.pointer, camera  );
+                
+                raycaster = new Raycaster();
+                raycaster.ray.set(ray.origin, ray.direction);  
+                raycaster.camera = camera; //add 
+            }
             if(camera.type == "OrthographicCamera"){//使无论多远,threshold区域都是一样宽的
                 raycaster.params.Line.threshold = 20/camera.zoom;  
             }else {
                 raycaster.params.Line.threshold = 0.2; 
-            }
+            } 
             raycaster.params.Line2 = {threshold :20 }; //拓宽的lineWidth
             
-            
-            
             //raycaster.layers.enableAll()//add
             viewer.setCameraLayers(raycaster,   //设置能识别到的layers(如空间模型里只有mapViewer能识别到marker)
                 ['sceneObjects','mapObjects','measure',  'transformationTool', 'model'],
@@ -90228,7 +90236,7 @@ void main() {
             var renderer = this.viewer.renderer,
                 o = renderer.getContext(),
                 a = renderer.state,
-                s = new Texture(null);
+                s = new Texture$1(null);
             s.flipY = !1,
                 i !== !0 && (i = !1),
                 s.generateMipmaps = i;
@@ -99065,7 +99073,7 @@ ENDSEC
     		uniforms: {
     			// time: { value: 1.0 },
     			// resolution: { value: new THREE.Vector2() }
-    			tColor: {value: new Texture() },
+    			tColor: {value: new Texture$1() },
     			uNear: {value: 0.0},
     			uOpacity: {value: 1.0},
     		},
@@ -103196,7 +103204,7 @@ ENDSEC
     			let resolvedRadius = this.scene.view.radius + this.radiusDelta;
                 if(resolvedRadius < 0.1 && e.delta>0)return; //防止缩放太小,导致很慢
     			this.radiusDelta += -e.delta * resolvedRadius * 0.1;
-
+                
     			this.stopTweens();
     		};
 
@@ -103438,14 +103446,22 @@ ENDSEC
 
     		{ // apply zoom
     			let progression = 1;//Math.min(1, this.fadeFactor * delta);
-
+                 
+                
+                
     			// let radius = view.radius + progression * this.radiusDelta * view.radius * 0.1;
     			let radius = view.radius + progression * this.radiusDelta;
-
+                          
     			let V = view.direction.multiplyScalar(-radius);
     			let position = new Vector3().addVectors(view.getPivot(), V);
-    			view.radius = radius;
-
+    			
+                if(this.constantlyForward) {
+                    if(radius < 2){  
+                        radius = 2;
+                    }
+                    
+                }
+                view.radius = radius;            
     			view.position.copy(position);
     		}
 
@@ -108308,24 +108324,46 @@ ENDSEC
 
     				if ( loader.isImageBitmapLoader === true ) {
 
-    					onLoad = function ( imageBitmap ) {
+    					/* onLoad = function ( imageBitmap ) {
                             //console.log('resolveURL onLoad',textureIndex )
     						resolve( new CanvasTexture( imageBitmap ) );
 
-    					};
+    					}; */
+                        onLoad = function ( imageBitmap ) {
+                            //console.log('resolveURL onLoad',textureIndex )
+    						resolve( new CanvasTexture( imageBitmap ) );
 
+    					};
     				}
 
-    				loader.load( resolveURL( sourceURI, options.path ), onLoad, undefined,/* ()=>{
-                        console.log('reject',textureIndex, arguments)
-                        reject.apply(this,arguments)
-                        
-                    }  */  reject  );
+    				loader.load( resolveURL( sourceURI, options.path ), onLoad, undefined,   (e,url)=>{
+                        console.log('reject',textureIndex, arguments);
+                        if ( loader.isImageBitmapLoader === true ) {
+                            let img = new Image;
+                            img.setAttribute('crossOrigin', 'Anonymous');
+                            img.src = url;
+                            resolve(new Texture(img));
+                            
+                            
+                            /* img.onload = ()=>{
+                                let canvas = document.createElement('canvas')
+                                let context = canvas.getContext('2d')
+                                context.canvas.width = img.width
+                                context.canvas.height = img.height
+                                context.drawImage(img, 0, 0, img.width, img.height)
+                                resolve( new CanvasTexture( canvas ) );   
+                                console.log('自己绘制 onload', textureIndex)
+                            } */
+                        }else {
+                            reject.apply(this,arguments);
+                        }
+                         
+                    }  /*  ,  reject  */  );
 
     			} );
 
     		} ).then( function ( texture ) {
-
+                
     			// Clean up resources and configure Texture.
                 //console.log('texture', textureIndex, texture.image)
     			if ( isObjectURL === true ) {
@@ -117002,7 +117040,7 @@ ENDSEC
         SplitScreen : new SplitScreen(),
         
         init(){
-            
+             
             {
                 let ground = this.ground = new InfiniteGridHelper(1, 10000, new Color('#fff'), 10000, 0.2, 0.3);
                 viewer.scene.scene.add(ground); 
@@ -117073,7 +117111,7 @@ ENDSEC
             
             viewer.ssaaRenderPass.enabled = false;
             viewer.outlinePass.enabled = true;
-            Potree.settings.intersectWhenHover = false;
+            //Potree.settings.intersectWhenHover = false
             //viewer.updateVisible(viewer.reticule, 'force', false)
         },
         
@@ -117128,7 +117166,7 @@ ENDSEC
                 MergeEditor.focusOn(model, 500, !!fitBound);     //通过在场景里点击模型的话,不focus
                  
                
-                viewer.outlinePass.selectedObjects = [model];
+                this.showModelOutline(model);
                 
                 if(model.isPointcloud){
                     viewer.outlinePass.edgeStrength = 4;
@@ -117138,7 +117176,8 @@ ENDSEC
                 //console.log('selectModel', model)
                 
             }else { 
-                viewer.outlinePass.selectedObjects = [];
+                this.showModelOutline(model, false);
+                 
                 this.selected = null;
                 this.transformControls.detach();        //viewer.transformObject(null);
                 //console.log('selectModel', null)
@@ -117153,6 +117192,23 @@ ENDSEC
         },
         
         
+        showModelOutline(model, state){
+            if(state === false){
+                viewer.outlinePass.selectedObjects = [];
+                clearTimeout(this.timer);
+                return
+            }
+            
+            viewer.outlinePass.selectedObjects = [model];
+            if(this.timer){
+                clearTimeout(this.timer);
+            }
+            
+            this.timer = setTimeout(()=>{
+                viewer.outlinePass.selectedObjects = [];
+            }, 1000);
+        },
+        
         /* focusOn(object, duration = 400){  
             let boundingBox = object.boundingBox.clone().applyMatrix4(object.matrixWorld)
             let center = boundingBox.getCenter(new THREE.Vector3)

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
public/lib/potree/potree.js.map


+ 41 - 16
src/sdk/cover/index.js

@@ -38,7 +38,9 @@ export const enter = (dom, isLocal) => {
     
     let sdk = {
         sceneBus,
-        getPositionByScreen(pos2d, mustModelId ){//通过屏幕坐标获取真实坐标 . mustModelId: 如果指定了模型,modelId必须为mustModelId才有效
+        getPositionByScreen(pos2d, hopeModelId ){//通过屏幕坐标获取真实坐标 . hopeModelId: 如果指定了模型,优先返回hopeModelId上的intersect
+            console.log('getPositionByScreen',hopeModelId)
+            hopeModelId = null
             let worldPos, localPos, modelId,  intersect
             let Handler = viewer.inputHandler
             
@@ -47,19 +49,22 @@ export const enter = (dom, isLocal) => {
                 pos2d.clientY = pos2d.y
                 pos2d.onlyGetIntersect = true
                 pos2d.whichPointcloud = true
-                if(mustModelId != void 0){//隐藏其他的模型
+                if(hopeModelId != void 0){//隐藏其他的模型
                     let models = MergeEditor.getAllObjects()
                     models.forEach(model=>{
-                        viewer.updateVisible(model, 'forPick', model.dataset_id == mustModelId)
+                        viewer.updateVisible(model, 'forPick', model.dataset_id == hopeModelId)
                     }) 
                 }
-                intersect = Handler.onMouseMove(pos2d)
-                if(mustModelId != void 0){//恢复
+                let intersect2 = Handler.onMouseMove(pos2d)
+                if(hopeModelId != void 0){//恢复
                     let models = MergeEditor.getAllObjects()
                     models.forEach(model=>{
                         viewer.updateVisible(model, 'forPick', true)
                     }) 
                 }
+                if(intersect2 && intersect2.location){
+                    intersect = intersect2
+                }
             }
             if (pos2d && pos2d.inDrag) {  
                 reGet() 
@@ -67,7 +72,7 @@ export const enter = (dom, isLocal) => {
                 intersect = Handler.intersect
                 if(intersect){
                     modelId = intersect.pointcloud ? intersect.pointcloud.dataset_id : intersect.object.dataset_id
-                    if(mustModelId != void 0 && modelId != mustModelId){
+                    if(hopeModelId != void 0 && modelId != hopeModelId){
                         reGet()
                     } 
                 }
@@ -75,9 +80,9 @@ export const enter = (dom, isLocal) => {
 
             if (intersect && intersect.location) {
                 modelId = intersect.pointcloud ? intersect.pointcloud.dataset_id : intersect.object.dataset_id
-                if(mustModelId != void 0 && modelId != mustModelId){
+                /* if(hopeModelId != void 0 && modelId != hopeModelId){
                     return null
-                } 
+                } */ 
                 worldPos = intersect.location.clone()
                 localPos = Potree.Utils.datasetPosTransform({ toDataset: true, datasetId:modelId, position:worldPos })
             } else return null
@@ -90,19 +95,30 @@ export const enter = (dom, isLocal) => {
          
         
         
-        getScreenByPosition(pos3d, modelId/* , disToCameraLimit */){//通过模型局部坐标获取屏幕坐标 
+        getScreenByPosition(pos3d, modelId, canShelter=true/* , disToCameraLimit */){//通过模型局部坐标获取屏幕坐标 
             
             
             let isLocal = modelId != void 0 
             pos3d = new THREE.Vector3().copy(pos3d)
             let worldPos = isLocal ? Potree.Utils.datasetPosTransform({ fromDataset: true, datasetId: modelId, position:pos3d}) : pos3d
-            if(!worldPos)return
+            if(!worldPos)return 
+            
+            
+            if(canShelter){ 
+                if(viewer.inputHandler.ifBlockedByIntersect(worldPos, 0.1, true)) return {trueSide:false}; 
+            }
+            
+            
             var viewport = viewer.mainViewport
             var camera = viewport.camera
             var dom = viewer.renderArea
-            if(tagLimitDis != void 0){
-                if(camera.position.distanceTo(worldPos) < tagLimitDis)return false
-            }
+            /* if(tagLimitDis != void 0){
+                if(camera.position.distanceTo(worldPos) > tagLimitDis)return false
+            } */
+            
+            
+            
+            
             //console.log('getScreenByPoint ' + pos3d.toArray())
             return Potree.Utils.getPos2d(worldPos, camera, dom, viewport)
         },
@@ -370,9 +386,12 @@ export const enter = (dom, isLocal) => {
             
             let startLoad = (prop)=>{
                 //if(autoLoads.filter(e=>e.loaded).length>1)return console.log('取消加载', prop), prop.onError()
+                
+                //return prop.onError()
+            
                 Potree.addModel(prop,  prop.done , prop.progressFun, prop.onError)
                 prop.loading = true
-                console.log('startLoad',getName(prop.url),  prop )
+                console.log('startLoad',getName(prop.url),  prop ) 
             }
             
             let spliceFromArr = (model,loaded)=>{
@@ -395,13 +414,19 @@ export const enter = (dom, isLocal) => {
                 }else if(autoLoads.filter(e=>!e.loadFinish).length == 0 && autoLoads.filter(e=>e.loaded).length>0 && !props.isFirstLoad){//设置相机位置:当自动开始加载第一个模型时(其余的也跟着自动加载),等这批加载完后;  
                     let autoLoadsDone = autoLoads.filter(e=>e.loaded).map(e=>e.model)
                     console.log('所有模型加载完毕')
+                    autoLoadsDone.forEach(e=>e.visible = true)
                     MergeEditor.focusOn(autoLoadsDone, 1000)
+                    
+                    
                 }  
             }
             
             let model
             let done = (model_)=>{
                 model = model_
+                if(!props.isFirstLoad){
+                    model.visible = false//先不显示,防止卡顿
+                }
                 props.opacity < 100 && result.changeOpacity(props.opacity) 
                 
                 model.addEventListener('changeSelect',(e)=>{
@@ -465,7 +490,7 @@ export const enter = (dom, isLocal) => {
                         if(state && viewer.inputHandler.selection[0]){
                             MergeEditor.transformControls.attach(model) //viewer.transformObject(model); //交换
                         }
-                        console.log(props.id, show)
+                        //console.log('changeSelect',  props.id, state)
                     }
                 },
                 changeScale(s){
@@ -536,7 +561,7 @@ export const enter = (dom, isLocal) => {
     }
      
     
-      
+    console.log('版本: 2022.8.20-0')
      
     return sdk 
 }