Przeglądaj źródła

fix: 天空盒比较大的时候加载完再切换为天空盒

xzw 1 rok temu
rodzic
commit
f104390728

+ 15 - 7
public/lib/potree/potree.js

@@ -73865,7 +73865,7 @@ void main()
 
 
 
-	Utils.loadSkybox = function(path, oldSky ) {
+	Utils.loadSkybox = function(path, oldSky, callback ) {
 	    let  camera, scene, parent , cameraOrtho;
 	    if(!oldSky){
 	        parent = new Object3D("skybox_root");
@@ -73918,7 +73918,8 @@ void main()
 	        texture.flipY = false; 
 	        texture.magFilter = LinearFilter;
 	        texture.minFilter = LinearFilter;
-	        scene.children[0].material.uniforms.tDiffuse.value = texture;  
+	        scene.children[0].material.uniforms.tDiffuse.value = texture; 
+	        callback && callback();
 	        viewer.dispatchEvent('content_changed');
 	    },null,(e)=>{//error
 	        console.error('loadSkybox失败',path); 
@@ -77702,7 +77703,10 @@ void main()
 	    pickFrontPointRatio:config$1.pickFrontPointRatio, //默认pick点云时选中靠近镜头的点的偏向
 	    dragPolyBeyondPoint: browser.urlHasValue('dragPolyBeyondPoint'),  //ctrlPolygon是否可以拖拽到没点云的地方
 	    panoZoomByPointer: false,//全景图是否定点缩放
-	    areaAtNotPlane: false
+	    areaAtNotPlane: false,
+	    
+	    
+	    fastTran: isTest
 	};
 
 
@@ -87361,6 +87365,9 @@ void main()
 	            this.dispatchEvent({type:'flyToPano', toPano});
 	            
 	             
+	             
+	            Potree.settings.fastTran && viewer.scene.view.position.copy(endPosition);
+	             
 	            viewer.scene.view.setView({position:endPosition, target, quaternion:toPano.quaternion , duration:toPano.duration,  
 	                onUpdate:(progress_, delta)=>{
 	                    
@@ -160686,10 +160693,11 @@ ENDSEC
 
 			if(bg === "skybox"){
 	            if(!src)src = Potree.resourcePath+'/textures/skybox/xingkong.jpg';
-				this.skybox = Utils.loadSkybox(src, this.skybox);
-			} 
-
-			this.background = bg;
+				this.skybox = Utils.loadSkybox(src, this.skybox, ()=>{
+	                this.background = bg;
+	            });
+			}else {  this.background = bg;
+	        }
 	        this.backgroundOpacity = 1;//add
 			this.dispatchEvent({'type': 'background_changed', 'viewer': this});
 		}

Plik diff jest za duży
+ 1 - 1
public/lib/potree/potree.js.map


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

@@ -399,7 +399,7 @@ export const enter = (dom, mapDom, isLocal, lonlat) => {
          
  
         setBackdrop(sky, type, {scale,rotate}){//天空盒背景
-            //console.log('天空盒背景',  sky,type)
+            console.log('天空盒背景',  sky,type)
             
             let setGroundAndText = (color)=>{
                 MergeEditor.secondCompass.dom.find(".dirText").css({'color':color})