xzw 3 éve
szülő
commit
23a6f2f5a5
3 módosított fájl, 29 hozzáadás és 9 törlés
  1. 24 8
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 4 0
      src/sdk/cover/index.js

+ 24 - 8
public/lib/potree/potree.js

@@ -103063,7 +103063,7 @@ ENDSEC
     		let scroll = (e) => {
                 if(!this.enabled)return
     			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();
@@ -103180,7 +103180,7 @@ ENDSEC
     		this.panDelta.set(0, 0);
     	}
     	
-    	zoomToLocation(mouse){
+    	/* zoomToLocation(mouse){
             if(!this.enabled)return
     		let camera = this.scene.getActiveCamera();
     		
@@ -103190,27 +103190,27 @@ ENDSEC
     			this.viewer,
     			this.scene.pointclouds,
     			{pickClipped: true});
-
+             
     		if (I === null) {
     			return;
-    		}
+    		} 
 
     		let targetRadius = 0;
     		{
     			let minimumJumpDistance = 0.2;
 
     			let domElement = this.renderer.domElement;
-    			let ray = Utils.mouseToRay(this.viewer.inputHandler.pointer/* mouse */, camera, domElement.clientWidth, domElement.clientHeight);
+    			let ray = Utils.mouseToRay(this.viewer.inputHandler.pointer , camera, domElement.clientWidth, domElement.clientHeight);
 
     			let nodes = I.pointcloud.nodesOnRay(I.pointcloud.visibleNodes, ray);
     			let lastNode = nodes[nodes.length - 1];
-    			let radius = lastNode.getBoundingSphere(new Sphere()).radius;
+    			let radius = lastNode.getBoundingSphere(new THREE.Sphere()).radius;
     			targetRadius = Math.min(this.scene.view.radius, radius);
     			targetRadius = Math.max(minimumJumpDistance, targetRadius);
     		}
 
     		let d = this.scene.view.direction.multiplyScalar(-1);
-    		let cameraTargetPosition = new Vector3().addVectors(I.location, d.multiplyScalar(targetRadius));
+    		let cameraTargetPosition = new THREE.Vector3().addVectors(I.location, d.multiplyScalar(targetRadius));
     		// TODO Unused: let controlsTargetPosition = I.location;
 
     		let animationDuration = 600;
@@ -103243,7 +103243,23 @@ ENDSEC
 
     			tween.start();
     		}
-    	}
+    	} */
+
+
+
+
+        
+        zoomToLocation(mouse){
+            let I = viewer.inputHandler.intersect;
+            if(I){
+                I = I.location;
+            } 
+            if(!I)return;
+            
+            viewer.setView({position:I, duration:1000});
+            
+        }
+
 
     	stopTweens () {
     		this.tweens.forEach(e => e.stop());

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
public/lib/potree/potree.js.map


+ 4 - 0
src/sdk/cover/index.js

@@ -107,6 +107,10 @@ export const enter = (dom) => {
         },
         comeTo(o = {}) {
             //飞到某个点   
+            if(o.distance){
+                let position = o.target || o.position
+                return viewer.focusOnObject({ position, distance:o.distance }, 'tag').promise
+            }
             let deferred = $.Deferred()
             if(o.modelId){
                 o.position = Potree.Utils.datasetPosTransform({ fromDataset: true, datasetId: o.modelId, position:o.position})