xzw 3 rokov pred
rodič
commit
5b853371d9

+ 295 - 199
public/lib/potree/potree.js

@@ -792,7 +792,7 @@
         intersectOnObjs:false,
         intersectWhenHover:true,
     };
-
+     
      
 
     //JSON.parse(localStorage.getItem('setting'))
@@ -57012,8 +57012,8 @@ void main() {
             this.borderColor = options.borderColor || { r: 0, g: 0, b: 0, a: 0.0 };
     		this.borderRadius = options.borderRadius || 6;
             if(options.text != void 0)this.setText(options.text);
-            this.name = options.name;
-            
+            this.name = options.name; 
+             
     		//this.setText(text);
             
             
@@ -63677,7 +63677,7 @@ void main() {
         viewer.setFOV(config$1.view.fov); 
         viewer.loadSettingsFromURL(); 
         { 
-            viewer.mainViewport.view.position.set(30,30,30);
+            viewer.mainViewport.view.position.set(30,30,30); 
             viewer.mainViewport.view.lookAt(0,0,0);
             
             viewer.updateModelBound();//init
@@ -81461,7 +81461,8 @@ void main() {
             viewer.setObjectLayers(this.axisArrow,  'bothMapAndScene' );
             
             
-            
+            this.tags = new Object3D;
+            this.scene.add(this.tags);
 
     	}
 
@@ -81821,14 +81822,14 @@ void main() {
              
             
             //add:------给空间模型的box 或其他obj------
-            /* let light2 = new THREE.AmbientLight( 16777215, 1 );
-            viewer.setObjectLayers(light2, 'bothMapAndScene')
-            this.scene.add(light2)
-            let light3 = new THREE.DirectionalLight( 16777215, 1);  
+            let light2 = new AmbientLight( 16777215, 1 );
+            viewer.setObjectLayers(light2, 'bothMapAndScene');
+            this.scene.add(light2);
+            let light3 = new DirectionalLight( 16777215, 1);  
             light3.position.set( 10, 10, 10 );
-    		light3.lookAt( new THREE.Vector3(0, 0, 0));
-            viewer.setObjectLayers(light3, 'bothMapAndScene')
-            this.scene.add(light3) */
+    		light3.lookAt( new Vector3(0, 0, 0));
+            viewer.setObjectLayers(light3, 'bothMapAndScene');
+            this.scene.add(light3);  
             //--------------------------------------------
 
     		{ // background
@@ -87198,6 +87199,11 @@ void main() {
             if(Potree.settings.editType == 'pano'){//漫游点拼合编辑
                 this.uuid = o.uuid;  //因为有多个数据集 所以会重复
                 this.index = o.index;  //下标, 用于visibles
+                this.pointcloud = viewer.scene.pointclouds.find(e=>e.panoUuid == o.uuid); 
+                this.pointcloud.panos.push(this);
+                this.sid = this.pointcloud.dataset_id + '|' + this.uuid;  //不会更改的标记  用于entity.panos里的标记
+                
+                
                 this.panosData = o;
                 
                 //数据中原本的位置朝向
@@ -87211,8 +87217,7 @@ void main() {
                 this.quaternion = new Quaternion();  //{w: 0, x: 0, y: 0, z: 1}
                 //this.quaternion4dkk = math.convertVisionQuaternion(this.quaternion)//4dkk内使用的quaternion 
                 this.visibles = o.visibles; 
-                this.pointcloud = viewer.scene.pointclouds.find(e=>e.panoUuid == o.uuid); 
-                this.pointcloud.panos.push(this);
+                
                 
                 const height = 1.4; //相机高度
                 this.originFloorPosition = this.originPosition.clone();
@@ -87241,8 +87246,8 @@ void main() {
                 this.pointcloud = viewer.scene.pointclouds.find(e=>e.dataset_id == o.dataset_id) || viewer.scene.pointclouds[0];
                 this.pointcloud.panos.push(this);
                 
-                this.sid = this.pointcloud.sceneCode + '|' + this.originID;  //不会更改的标记
-             
+                //this.sid = this.pointcloud.sceneCode + '|' + this.originID  //不会更改的标记
+                this.sid = this.pointcloud.dataset_id + '|' + this.originID;  //不会更改的标记
                 //全景图和Cube的水平采样起始坐标相差90度 
                 
 
@@ -101084,6 +101089,14 @@ ENDSEC
                 }
             
             });
+            
+            let addingTag = false;
+            pannel.find('li button[name="tag"]').on('click',(e)=>{
+                let $elem = $(e.target);
+                 
+                viewer.TagTool.startInsertion();
+            });
+            
         }
         
         
@@ -102952,6 +102965,129 @@ ENDSEC
     	}
     };
 
+    const renderOrders = {
+        line: 0 ,
+        spot: 1,
+    };
+
+    let texLoader$5 = new TextureLoader(); 
+
+    let lineMat = new LineBasicMaterial({
+        color: '#ffffff', 
+    });
+    let spotMat; 
+
+
+    class Tag extends Object3D{
+        constructor(){
+            
+            super();
+            
+            
+            
+            
+            this.build();
+            
+            
+            
+            
+            
+            
+            
+            
+        }
+        
+        
+        
+        
+        build(){
+            
+            if(!spotMat){
+                spotMat = new MeshBasicMaterial({
+                    map: texLoader$5.load(Potree.resourcePath+'/textures/icon-fire.png' ),  
+                });
+            }
+            
+            
+            this.spot = new Sprite$1({mat:spotMat});
+            this.titleLabel = new TextSprite({root: this.spot, text:'1'});
+            this.titleLabel.position.set(0,0,1);
+            this.add(this.spot);
+            this.add(this.line);
+            viewer.scene.tags.add(this);
+            
+            
+        }
+        
+    }
+
+    class TagTool extends EventDispatcher{
+    	constructor (viewer) {
+    		super();
+            
+            
+            
+            
+            this.viewer = viewer;
+            
+            
+            
+            this.viewer.addEventListener('start_inserting_tag', e => {
+    			this.viewer.dispatchEvent({
+    				type: 'cancel_insertions'
+    			});
+    		});
+        }
+        
+        
+        startInsertion (args = {}, callback, cancelFun) {
+            let tag = new Tag({title: '1', position:new Vector3}); 
+            tag.visible = false;
+            
+            
+            
+            
+            
+            
+            this.viewer.dispatchEvent({
+    			type: 'start_inserting_tag',
+    			tag
+    		});
+            
+            
+            let cancel = ()=>{
+                end();
+            };
+            let end = ()=>{
+                this.viewer.removeEventListener('global_click', click);
+            };
+            let click = (e)=>{
+                
+                
+                var I = e.intersect && (e.intersect.orthoIntersect || e.intersect.location);
+                if(!I){
+                    return  
+                }
+                
+                tag.position.copy(I);
+                
+                
+                
+                
+                tag.visible = true;
+                
+                
+                end();
+            };
+            this.viewer.addEventListener('global_click', click);
+        
+        }  
+        
+        
+        
+        
+    }
+
     class NavigationCube extends Object3D {
 
     	constructor(viewer){
@@ -103456,7 +103592,7 @@ ENDSEC
     			let V = view.direction.multiplyScalar(-radius);
     			let position = new Vector3().addVectors(view.getPivot(), V);
     			
-                if(this.constantlyForward) {
+                if(this.constantlyForward) {// 到达中心点后还能继续向前移动,也就是能推进中心点
                     if(radius < 2){  
                         radius = 2;
                     }
@@ -105978,21 +106114,25 @@ ENDSEC
 
     			loader.load( url, function ( data, total ) {// xzw add total 
                     console.log('数据加载成功', url.split('/').pop(), '  ,total: '+total);
-    				try {
+                    let f = ()=>{
+                        try {
 
-    					scope.parse( data, resourcePath, function ( gltf ) {
+                            scope.parse( data, resourcePath, function ( gltf ) {
 
-    						onLoad( gltf, total );
+                                onLoad( gltf, total );
 
-    						scope.manager.itemEnd( url );
+                                scope.manager.itemEnd( url );
 
-    					}, _onError );
+                            }, _onError );
 
-    				} catch ( e ) {
+                        } catch ( e ) {
 
-    					_onError( e );
+                            _onError( e );
 
-    				}
+                        }
+                    };
+                    f();
+                    //setTimeout(f,5000)/////////////////test
 
     			}, onProgress, _onError );
 
@@ -107718,15 +107858,16 @@ ENDSEC
 
     		// Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
     		// expensive work of uploading a texture to the GPU off the main thread.
-    		if ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) {
+    		/* if ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) {
 
     			this.textureLoader = new ImageBitmapLoader( this.options.manager );
 
-    		} else {
+    		} else { */
 
     			this.textureLoader = new TextureLoader( this.options.manager );
 
-    		}
+    		//}
+     
 
     		this.textureLoader.setCrossOrigin( this.options.crossOrigin );
 
@@ -108336,12 +108477,23 @@ ENDSEC
     					};
     				}
 
+
+                     
+                    parser.textureLoader.load(sourceURI, (tex)=>{
+                        tex.minFilter = THREE.LinearMipmapLinearFilter; //原本:NearestMipMapNearestFilter 闪烁
+                        //tex.needsUpdate
+                        resolve(tex); 
+                    });  
+                    
+
+                    return;
+
     				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;
+                            img.src = url; 
                             resolve(new THREE.Texture(img));
                             
                             
@@ -111389,7 +111541,7 @@ ENDSEC
          
     };
 
-    let texLoader$5 = new TextureLoader(); 
+    let texLoader$6 = new TextureLoader(); 
 
     let color$1 = new Color(config$1.clip.color);
 
@@ -111557,13 +111709,13 @@ ENDSEC
                         transparent: !0,
                         color: color$1,
                         opacity: 0.8,
-                        map: texLoader$5.load(Potree.resourcePath+'/textures/whiteCircle.png' ),  
+                        map: texLoader$6.load(Potree.resourcePath+'/textures/whiteCircle.png' ),  
                     }),
                     select:    new MeshBasicMaterial({   
                         transparent: !0,
                         color: color$1,
                         opacity: 1,
-                        map: texLoader$5.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
+                        map: texLoader$6.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
                          
                     }),   
                 };
@@ -111610,7 +111762,7 @@ ENDSEC
                     opacity: barOpacity,
                     transparent:true,
                     depthTest:false, 
-                    map: texLoader$5.load(Potree.resourcePath+'/textures/rotation_circle.png' ), 
+                    map: texLoader$6.load(Potree.resourcePath+'/textures/rotation_circle.png' ), 
                 }) ,
                 root:object,
                 sizeInfo: markerSizeInfo$1, 
@@ -112927,7 +113079,7 @@ ENDSEC
         
     };
 
-    let texLoader$6 = new TextureLoader(); 
+    let texLoader$7 = new TextureLoader(); 
 
      
     let markerMats$2;
@@ -112936,7 +113088,7 @@ ENDSEC
     let faceMats;
     let getFaceMat = (name)=>{
         if(!faceMats){ //navvis材质可以搜gridTexture
-            let gridTex = texLoader$6.load( Potree.resourcePath+'/textures/gridmap.png' ); 
+            let gridTex = texLoader$7.load( Potree.resourcePath+'/textures/gridmap.png' ); 
                 gridTex.wrapS = gridTex.wrapT = RepeatWrapping;   
                 //gridTex.repeat.set(0.5,0.5)//放大一些
             faceMats = { 
@@ -113601,7 +113753,7 @@ ENDSEC
                         transparent: !0,
                         color: color$2,
                         opacity: 0.8,
-                        map: texLoader$6.load(Potree.resourcePath+'/textures/whiteCircle.png' ),  
+                        map: texLoader$7.load(Potree.resourcePath+'/textures/whiteCircle.png' ),  
                         depthTest:false,
                         
                     }),
@@ -113609,14 +113761,14 @@ ENDSEC
                         transparent: !0,
                         color: color$2,
                         opacity: 0.4,
-                        map: texLoader$6.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
+                        map: texLoader$7.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
                         depthTest:false,
                     }),  
                     hover:    new MeshBasicMaterial({   
                         transparent: !0,
                         color: color$2,
                         opacity: 1,
-                        map: texLoader$6.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
+                        map: texLoader$7.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
                         depthTest:false,
                          
                     }),
@@ -113624,7 +113776,7 @@ ENDSEC
                         transparent: !0,
                         color:new Color('#00C8AF'),
                         opacity: 1,
-                        map: texLoader$6.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
+                        map: texLoader$7.load(Potree.resourcePath+'/textures/whiteCircle.png' ), 
                         depthTest:false,
                          
                     }),   
@@ -114308,22 +114460,25 @@ ENDSEC
        
         ,
        
-        createFromData:function( buildType, parent ,sid, name, points=[], holes=[], zMin, zMax, initial,panos,flagPano){ 
+        createFromData:function( buildType, parent ,sid, name, points=[], holes=[], zMin, zMax, initial,panos_,flagPano){ 
             if(buildType != 'building' && buildType != 'floor' && buildType != 'room' ) return
               
             
             var {points, zMax, zMin} = this.getPreDealData(points,  zMin, zMax , initial, buildType, parent );
             
             
-            
+            let panos = [];
             {
                 
-                let getPano = (id)=>{
-                    return viewer.images360.panos.find(pano=>pano.id == id)
-                };
-                
-                panos = panos ? panos.map(e=>getPano(e)) : [];
-                flagPano = flagPano != void 0 ? getPano(flagPano) : null ; //最中心的pano 或者 最靠近该实体的pano(当panos为空时)
+                 
+                if(panos_){
+                    panos_.forEach(sid=>{
+                        let pano = viewer.images360.getPano(sid,'sid');
+                        if(pano)panos.push(pano);
+                    });
+                } 
+                 
+                flagPano = flagPano != void 0 ? viewer.images360.getPano(flagPano,'sid') : null ; //最中心的pano 或者 最靠近该实体的pano(当panos为空时)
                     
                 if(!this.editing && buildType == 'floor' && !flagPano){//没有的话可能是自动添加的floor,直接用parent的吧
                     panos = parent.panos;
@@ -114889,6 +115044,10 @@ ENDSEC
                 while(1){
                     let scores = getScores(pointcloud, entities, cloudVolume);
                     if(scores.length == 0 || scores[0].volume/cloudVolume < 0.0001 && scores[0].volume < 3 ){//如果约等于0 
+                        if(scores[0] && scores[0].entity.buildType == 'room'){ 
+                            pointcloud.belongToEntity = scores[0].entity; //当该数据集在楼层中,但不在楼层中的任意一个房间时,任意挂载在其中一个房间上。
+                            break
+                        } 
                         pointcloud.belongToEntity = null;
                         break;
                     }else {
@@ -117004,8 +117163,8 @@ ENDSEC
         
       */
 
-    const texLoader$7 = new TextureLoader(); 
-          texLoader$7.crossOrigin = "anonymous"; 
+    const texLoader$8 = new TextureLoader(); 
+          texLoader$8.crossOrigin = "anonymous"; 
       
 
     const viewportProps$1 = [{
@@ -117030,12 +117189,12 @@ ENDSEC
         //相机位置在x轴负向  右下角屏
         viewContainsPoints:[new Vector3(0,0,0)]
     } ];
-
-
+     
+     
      
     let MergeEditor = {
         bus:new EventDispatcher(), 
-        
+         
         
         SplitScreen : new SplitScreen(),
         
@@ -117050,7 +117209,7 @@ ENDSEC
                 ground.renderOrder = line1.renderOrder + 1;  //要比模型低,否则模型透明时效果不对
                 ground.add(line1);
                 ground.add(line2);
-                
+                 
                 ground.material.polygonOffset = true; //多边形偏移(视觉上没有移动模型位置),防止闪烁
                 ground.material.polygonOffsetFactor = 10; //多边形偏移因子
     			ground.material.polygonOffsetUnits = 10; //多边形偏移单位   
@@ -117243,7 +117402,7 @@ ENDSEC
             })  //setView can cancel bump
              
         }, */
-        focusOn(objects, duration = 400, fitBound=true){  
+        focusOn(objects, duration = 400, fitBound=true, dontLookUp){  
             if(!(objects instanceof Array)){
                 objects = [objects];
             }
@@ -117253,7 +117412,7 @@ ENDSEC
             });
              
             if(fitBound){
-                viewer.focusOnObject({boundingBox}, 'boundingBox', duration); 
+                viewer.focusOnObject({boundingBox}, 'boundingBox', duration, {dontLookUp}); 
             }else {
                 let position = viewer.inputHandler.intersect ? viewer.inputHandler.intersect.location : boundingBox.getCenter(new Vector3);
                 viewer.focusOnObject({position},  'point', duration, {dontChangePos: true});
@@ -117310,7 +117469,7 @@ ENDSEC
         
     };
 
-    const texLoader$8 = new TextureLoader(); 
+    const texLoader$9 = new TextureLoader(); 
     const circleGeo = new CircleGeometry(1.45,100);
     const sphereGeo = new SphereBufferGeometry(0.018,10,10);
      
@@ -117410,7 +117569,7 @@ ENDSEC
             }));
             this.overlayMesh = new Mesh(circleGeo, new MeshBasicMaterial({
                 side: DoubleSide , 
-                map:texLoader$8.load(Potree.resourcePath+'/textures/crosshair.png') ,
+                map:texLoader$9.load(Potree.resourcePath+'/textures/crosshair.png') ,
                 transparent:true,
                 depthTest: !1,
                 //depthWrite: !1,
@@ -117655,7 +117814,7 @@ ENDSEC
        
     }
 
-    let texLoader$9 = new TextureLoader();
+    let texLoader$a = new TextureLoader();
     let defaultOpacity =  0.7;
      
 
@@ -117663,7 +117822,7 @@ ENDSEC
     //鼠标指示小圆片 
     class Reticule extends Mesh{
         constructor(viewer){
-            var defaultTex = texLoader$9.load(Potree.resourcePath+'/textures/whiteCircle.png'/* reticule-256x256.png'  */);  
+            var defaultTex = texLoader$a.load(Potree.resourcePath+'/textures/whiteCircle.png'/* reticule-256x256.png'  */);  
             super(new PlaneBufferGeometry(0.11,0.11,1,1),new MeshBasicMaterial({
                 side: DoubleSide , 
                 map: defaultTex,
@@ -117674,8 +117833,8 @@ ENDSEC
             })); 
             this.name = 'reticule';
             this.defaultTex = defaultTex;
-            this.crosshairTex = texLoader$9.load(Potree.resourcePath+'/textures/reticule_cross_hair.png'); 
-            this.forbitTex = texLoader$9.load(Potree.resourcePath+'/textures/pic-forbid.png'); 
+            this.crosshairTex = texLoader$a.load(Potree.resourcePath+'/textures/reticule_cross_hair.png'); 
+            this.forbitTex = texLoader$a.load(Potree.resourcePath+'/textures/pic-forbid.png'); 
             
             //this.layers.set(0/* RenderLayers.RETICULE */);
             this.renderOrder = 100;
@@ -118284,7 +118443,7 @@ ENDSEC
        
     }
 
-    const texLoader$a = new TextureLoader();
+    const texLoader$b = new TextureLoader();
     const arrowSpacing = 1; //间隔
     const arrowSize = arrowSpacing * 0.5;
     const planeGeo$3 = new PlaneBufferGeometry(1,1);
@@ -118353,20 +118512,20 @@ ENDSEC
             var polesMats = {
                 shadowMat: new MeshBasicMaterial({ 
                     transparent:true, depthTest:false,
-                    map: texLoader$a.load(Potree.resourcePath+'/textures/pano_instruction_bottomMarker.png' )  
+                    map: texLoader$b.load(Potree.resourcePath+'/textures/pano_instruction_bottomMarker.png' )  
                 }),
                 sphereMat : new MeshBasicMaterial({
                     transparent:true, depthTest:false,
-                    map: texLoader$a.load(Potree.resourcePath+'/textures/whiteCircle.png' )  
+                    map: texLoader$b.load(Potree.resourcePath+'/textures/whiteCircle.png' )  
                 }), 
                 hatMats:{
                     start:  new MeshBasicMaterial({
                         transparent:true, depthTest:false,
-                        map: texLoader$a.load(Potree.resourcePath+'/textures/pano_instruction_start_route.png' )  
+                        map: texLoader$b.load(Potree.resourcePath+'/textures/pano_instruction_start_route.png' )  
                     }),
                     end:  new MeshBasicMaterial({
                         transparent:true, depthTest:false,
-                        map: texLoader$a.load(Potree.resourcePath+'/textures/pano_instruction_target_reached.png' )  
+                        map: texLoader$b.load(Potree.resourcePath+'/textures/pano_instruction_target_reached.png' )  
                     }) 
                 }
             };
@@ -118379,7 +118538,7 @@ ENDSEC
             this.sceneMeshGroup.add(this.poleEnd);
             
             
-            let map = texLoader$a.load(Potree.resourcePath+'/textures/routePoint_panorama.png' );  
+            let map = texLoader$b.load(Potree.resourcePath+'/textures/routePoint_panorama.png' );  
             map.anisotropy = 4; // 各向异性过滤 .防止倾斜模糊 
             this.arrow = new Mesh(planeGeo$3, new MeshBasicMaterial({
                 transparent:true,
@@ -118416,7 +118575,7 @@ ENDSEC
             }))
             this.mapMarkStart.renderOrder = this.mapMarkEnd.renderOrder = 2//在箭头之上 */
              
-            let map2 = texLoader$a.load(Potree.resourcePath+'/textures/routePoint_map_fsna.png' ); 
+            let map2 = texLoader$b.load(Potree.resourcePath+'/textures/routePoint_map_fsna.png' ); 
             this.mapArrowMats = {
                 default: new MeshBasicMaterial({
                     transparent:true, depthTest:false,
@@ -120865,13 +121024,13 @@ ENDSEC
 
     let images360, Alignment$1,  SiteModel$1; 
 
-    const texLoader$b = new TextureLoader(); 
-        texLoader$b.crossOrigin = "anonymous"; 
+    const texLoader$c = new TextureLoader(); 
+        texLoader$c.crossOrigin = "anonymous"; 
         
     const lineMats$3 = {};
     const circleMats = {};
 
-    const renderOrders = {
+    const renderOrders$1 = {
         circleSelected:3,
         circle:2,
         line:1,
@@ -120977,7 +121136,12 @@ ENDSEC
                 this.switchView('top');
                 
                 SiteModel$1.bus.addEventListener('initDataDone',()=>{ 
-                    this.gotoFloor(SiteModel$1.entities.find(e=>e.buildType == 'floor'));  //任意一层
+                    let floor = SiteModel$1.entities.find(e=>e.buildType == 'floor' && e.panos.length); //选择有漫游点的一层
+                    if(!floor){
+                        floor = 'all';  //SiteModel.entities.find(e=>e.buildType == 'floor')
+                        console.log('没有一层有漫游点?!');
+                    }
+                    this.gotoFloor(floor);  
                 });
                  
                 
@@ -121003,7 +121167,7 @@ ENDSEC
                     this.rotGuideLine = LineDraw.createLine([], {color:'#aaffee'});
                     this.rotGuideLine.visible = false;
                     this.rotGuideLine.name = 'rotGuideLine';
-                    this.rotGuideLine.renderOrder = renderOrders.line;
+                    this.rotGuideLine.renderOrder = renderOrders$1.line;
                     viewer.scene.scene.add(this.rotGuideLine);
 
                     let startPoint;
@@ -121025,7 +121189,7 @@ ENDSEC
                     this.linkGuideLine.visible = false;
                     this.linkGuideLine.name = 'linkGuideLine';
                     viewer.scene.scene.add(this.linkGuideLine);
-                    this.linkGuideLine.renderOrder = renderOrders.line;
+                    this.linkGuideLine.renderOrder = renderOrders$1.line;
                     let update = (e)=>{
                         if(this.operation != 'addLink' || this.activeViewName != 'top' || !this.selectedPano){
                             return this.linkGuideLine.visible = false
@@ -121583,7 +121747,7 @@ ENDSEC
                 if(this.panoLink[pano0.id][pano1.id].line) return 
                 let line = LineDraw.createFatLine([pano0.position, pano1.position], {material:lineMats$3.default});
                 line.name = `${pano0.id}-${pano1.id}`;
-                line.renderOrder = line.pickOrder = renderOrders.line;
+                line.renderOrder = line.pickOrder = renderOrders$1.line;
                 this.lineMeshes.add(line); 
                 this.panoLink[pano0.id][pano1.id].line = this.panoLink[pano1.id][pano0.id].line = line;
                 
@@ -121641,7 +121805,7 @@ ENDSEC
         
         
         addPanoMesh(){ 
-            let map = texLoader$b.load(Potree.resourcePath+'/textures/correct_n.png' );  
+            let map = texLoader$c.load(Potree.resourcePath+'/textures/correct_n.png' );  
             circleMats.default = new MeshBasicMaterial({
                 map,
                 color: 0xffffff,
@@ -121657,7 +121821,7 @@ ENDSEC
                 depthWrite: false,  
             });
             circleMats.selected = new MeshBasicMaterial({
-                map: texLoader$b.load(Potree.resourcePath+'/textures/correct_s.png' ) ,  
+                map: texLoader$c.load(Potree.resourcePath+'/textures/correct_s.png' ) ,  
                 color: 0xffffff,
                 transparent: true,
                 depthTest: false,
@@ -121684,8 +121848,8 @@ ENDSEC
                 var circle = new Sprite$1({mat: circleMats.default, sizeInfo:{
                         minSize : 50 ,  maxSize : 120,   nearBound : 2, farBound : 10, 
                     },
-                    renderOrder : renderOrders.circle,
-                    pickOrder: renderOrders.circle
+                    renderOrder : renderOrders$1.circle,
+                    pickOrder: renderOrders$1.circle
                 });   //new THREE.Sprite(circleMats.default) 
                 
                 circle.name = 'panoCircle';
@@ -121790,7 +121954,7 @@ ENDSEC
             if(this.selectedPano){ 
                 
                 this.selectedPano.circle.material = circleMats.default; 
-                this.selectedPano.circle.renderOrder = renderOrders.circle; 
+                this.selectedPano.circle.renderOrder = renderOrders$1.circle; 
 
                 if(this.activeViewName != 'mainView'){
                     this.selectedClouds.forEach(e=>{
@@ -121810,7 +121974,7 @@ ENDSEC
             
             if(pano){
                 this.selectedPano.circle.material = circleMats.selected;  
-                this.selectedPano.circle.renderOrder = this.selectedPano.circle.pickOrder = renderOrders.circleSelected; //侧视图能显示在最前
+                this.selectedPano.circle.renderOrder = this.selectedPano.circle.pickOrder = renderOrders$1.circleSelected; //侧视图能显示在最前
                 //this.selectedPano.pointcloud.material.color = '#ff0000'
                 //this.selectedPano.pointcloud.changePointOpacity(opacitys.selected,true) 
                 if(this.activeViewName != 'mainView'){
@@ -125193,114 +125357,39 @@ ENDSEC
     OutlinePass.BlurDirectionX = new Vector2$1( 1.0, 0.0 );
     OutlinePass.BlurDirectionY = new Vector2$1( 0.0, 1.0 );
 
-    /**
-     * https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts
-     */
-
-    class RoomEnvironment extends  Scene {
-
-    	constructor() {
-
-    		super();
-
-    		const geometry = new BoxGeometry();
-    		//geometry.deleteAttribute( 'uv' );//????????????
-
-    		const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
-    		const boxMaterial = new MeshStandardMaterial();
-
-    		const mainLight = new PointLight( 0xffffff, 5.0, 28, 2 );
-    		mainLight.position.set( 0.418, 16.199, 0.300 );
-    		this.add( mainLight );
-
-    		const room = new Mesh( geometry, roomMaterial );
-    		room.position.set( - 0.757, 13.219, 0.717 );
-    		room.scale.set( 31.713, 28.305, 28.591 );
-    		this.add( room );
-
-    		const box1 = new Mesh( geometry, boxMaterial );
-    		box1.position.set( - 10.906, 2.009, 1.846 );
-    		box1.rotation.set( 0, - 0.195, 0 );
-    		box1.scale.set( 2.328, 7.905, 4.651 );
-    		this.add( box1 );
-
-    		const box2 = new Mesh( geometry, boxMaterial );
-    		box2.position.set( - 5.607, - 0.754, - 0.758 );
-    		box2.rotation.set( 0, 0.994, 0 );
-    		box2.scale.set( 1.970, 1.534, 3.955 );
-    		this.add( box2 );
-
-    		const box3 = new Mesh( geometry, boxMaterial );
-    		box3.position.set( 6.167, 0.857, 7.803 );
-    		box3.rotation.set( 0, 0.561, 0 );
-    		box3.scale.set( 3.927, 6.285, 3.687 );
-    		this.add( box3 );
-
-    		const box4 = new Mesh( geometry, boxMaterial );
-    		box4.position.set( - 2.017, 0.018, 6.124 );
-    		box4.rotation.set( 0, 0.333, 0 );
-    		box4.scale.set( 2.002, 4.566, 2.064 );
-    		this.add( box4 );
-
-    		const box5 = new Mesh( geometry, boxMaterial );
-    		box5.position.set( 2.291, - 0.756, - 2.621 );
-    		box5.rotation.set( 0, - 0.286, 0 );
-    		box5.scale.set( 1.546, 1.552, 1.496 );
-    		this.add( box5 );
-
-    		const box6 = new Mesh( geometry, boxMaterial );
-    		box6.position.set( - 2.193, - 0.369, - 5.547 );
-    		box6.rotation.set( 0, 0.516, 0 );
-    		box6.scale.set( 3.875, 3.487, 2.986 );
-    		this.add( box6 );
-
-
-    		// -x right
-    		const light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
-    		light1.position.set( - 16.116, 14.37, 8.208 );
-    		light1.scale.set( 0.1, 2.428, 2.739 );
-    		this.add( light1 );
-
-    		// -x left
-    		const light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
-    		light2.position.set( - 16.109, 18.021, - 8.207 );
-    		light2.scale.set( 0.1, 2.425, 2.751 );
-    		this.add( light2 );
-
-    		// +x
-    		const light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );
-    		light3.position.set( 14.904, 12.198, - 1.832 );
-    		light3.scale.set( 0.15, 4.265, 6.331 );
-    		this.add( light3 );
-
-    		// +z
-    		const light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );
-    		light4.position.set( - 0.462, 8.89, 14.520 );
-    		light4.scale.set( 4.38, 5.441, 0.088 );
-    		this.add( light4 );
-
-    		// -z
-    		const light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );
-    		light5.position.set( 3.235, 11.486, - 12.541 );
-    		light5.scale.set( 2.5, 2.0, 0.1 );
-    		this.add( light5 );
-
-    		// +y
-    		const light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );
-    		light6.position.set( 0.0, 20.0, 0.0 );
-    		light6.scale.set( 1.0, 0.1, 1.0 );
-    		this.add( light6 );
-
-    	}
-
-    }
-
-    function createAreaLightMaterial( intensity ) {
-
-    	const material = new MeshBasicMaterial();
-    	material.color.setScalar( intensity );
-    	return material;
-
+    class BasicMaterial  extends ShaderMaterial{ 
+        constructor(o={}){
+            
+           super( Object.assign({},{ 
+                uniforms:{
+                    tDiffuse:    { type: 't',  value: o.map },
+                    alpha : {type:'f', value : 1 }
+                },
+                vertexShader: Shaders['basicTextured.vs'],   
+                fragmentShader: Shaders['basicTextured.fs']  
+            },o));
+            
+            
+             
+        }
+        set opacity(o){
+            this.uniforms && (this.uniforms.alpha.value = o);
+             
+        }
+        get opacity(){
+            return this.uniforms.alpha.value  
+        }
+        
+        set map(o){
+            this.uniforms.tDiffuse.value = o;
+             
+        }
+        get map(){
+            return this.uniforms.tDiffuse.value  
+        }
+        
+      
+        
     }
 
     const manager = new LoadingManager(); 
@@ -125756,7 +125845,7 @@ ENDSEC
                 this.measuringTool = new MeasuringTool(this);
                 this.profileTool = new ProfileTool(this);
                 this.volumeTool = new VolumeTool(this);
-                
+                this.tagTool = new TagTool(this);
                 
                 
                 
@@ -125786,10 +125875,10 @@ ENDSEC
                  
                 };
                 //add test
-                const environment = new RoomEnvironment();
-                const pmremGenerator = new PMREMGenerator( this.renderer ); 
+                /* const environment = new RoomEnvironment();
+                const pmremGenerator = new THREE.PMREMGenerator( this.renderer ); 
                 this.scene.scene.environment = pmremGenerator.fromScene( environment ).texture;
-
+                */
                 
                 //-----------
                 
@@ -128711,6 +128800,9 @@ ENDSEC
                  
                 //获得相机最佳位置
                 let dir = new Vector3().subVectors(cameraPos, target).normalize();
+                if(o.dontLookUp && dir.z < 0){
+                     dir.negate();
+                }
                 position.copy(target).add(dir.multiplyScalar(dis)); 
                 return position
             }; 
@@ -129460,6 +129552,8 @@ ENDSEC
          */
 
         loadModel(fileInfo, done, onProgress_, onError){ 
+           
+        
             let boundingBox = new Box3();
             if(!Potree.settings.boundAddObjs){
                boundingBox.min.set(-0.5,-0.5,-0.5); boundingBox.max.set(0.5,0.5,0.5); 
@@ -129483,7 +129577,7 @@ ENDSEC
                             //console.log(child.matrixWorld.clone())
                             boundingBox.union(child.geometry.boundingBox.clone().applyMatrix4(child.matrixWorld)); //但感觉如果最外层object大小不为1,要还原下scale再乘
                         }//获取在scale为1时,表现出的大小
-                        Common.makeTexDontResize(child.material.map);
+                        Common.makeTexDontResize(child.material.map); 
                         //console.log(child.name, 'roughness',child.material.roughness,'metalness',child.material.metalness)
                         child.material.roughness = 0.6; 
                         child.material.metalness = 0.3; 
@@ -129503,12 +129597,14 @@ ENDSEC
                         }; */
                         
                         //暂时用这种材质:
-                        if(fileInfo.unlit && !(child.material instanceof MeshBasicMaterial)){
-                            let material = new MeshBasicMaterial({map:child.material.map});
-                            child.material.dispose();
+                        //if(fileInfo.unlit && (!(child.material instanceof THREE.MeshBasicMaterial) || fileType == 'glb')){
+                            //let material = new THREE.MeshBasicMaterial({map:child.material.map})
+                            let material = new BasicMaterial({map : child.material.map});  //很奇怪glb的图会使原本的MeshBasicMaterial 会偏暗,所以自己重新写
+                            
+                            //child.material.dispose()
                             child.material = material;
                            
-                        }
+                        //}
                         
                     }
                 } );
@@ -129572,7 +129668,7 @@ ENDSEC
                 } , onProgress,  onError  );  
                 
             }else if(fileType == 'glb'){
-                loaders.glbLoader.unlitMat = !!fileInfo.unlit;
+                loaders.glbLoader.unlitMat = true;//!!fileInfo.unlit
                 loaders.glbLoader.load(fileInfo.glburl,  ( gltf, total )=>{     //.setPath( Potree.resourcePath + '/models/glb/'  );
                     //console.log('loadGLTF', gltf)
                     loadDone(gltf.scene, total, fileInfo.glburl); 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
public/lib/potree/potree.js.map


+ 1 - 1
src/sdk/cover/index.js

@@ -416,7 +416,7 @@ export const enter = (dom, isLocal) => {
                     console.log('所有模型加载完毕')
                     autoLoads.filter(e=>e.loaded && e.show).forEach(e=>e.visible = true)
                     
-                    MergeEditor.focusOn(autoLoadsDone, 1000)
+                    MergeEditor.focusOn(autoLoadsDone, 1000, true, true)
                     
                     
                 }