xzw 3 年之前
父节点
当前提交
51c2023d63
共有 3 个文件被更改,包括 30 次插入4 次删除
  1. 25 3
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 4 0
      src/sdk/cover/index.js

+ 25 - 3
public/lib/potree/potree.js

@@ -63832,7 +63832,7 @@ void main() {
                         }  
                         model.dispatchEvent('transformChanged'); 
                     });
-                    model.addEventListener("orientation_changed", maintainBtmZAndCenter );
+                    model.addEventListener("rotation_changed", maintainBtmZAndCenter );
                     model.addEventListener("scale_changed", maintainBtmZAndCenter );
                     
                 
@@ -115338,6 +115338,9 @@ ENDSEC
     			this.object.updateMatrixWorld();
     			this.object.parent.matrixWorld.decompose( parentPosition, parentQuaternion, parentScale );
     			this.object.matrixWorld.decompose( worldPosition, worldQuaternion, worldScale );
+                //add 使坐标轴在boundingBox中心
+                boundingBox && this.object.boundingBox.getCenter(worldPosition).applyMatrix4(this.object.matrixWorld);
+
 
     			parentQuaternionInv.copy( parentQuaternion ).invert();
     			worldQuaternionInv.copy( worldQuaternion ).invert();
@@ -115429,6 +115432,8 @@ ENDSEC
     				scaleStart.copy( this.object.scale );
 
     				this.object.matrixWorld.decompose( worldPositionStart, worldQuaternionStart, worldScaleStart );
+                    //add: 使坐标轴在boundingBox中心
+                    boundingBox && this.object.boundingBox.getCenter(worldPositionStart).applyMatrix4(this.object.matrixWorld);
 
     				pointStart.copy( planeIntersect.point ).sub( worldPositionStart );
     				
@@ -116835,7 +116840,7 @@ ENDSEC
 
     	this.updateMatrixWorld = function () {
 
-    		  var space = this.space;
+            var space = this.space;
 
     		this.position.copy( this.worldPosition );
 
@@ -116937,6 +116942,23 @@ ENDSEC
 
         } );
 
+     /*  
+        备注:
+        
+        
+        
+        //这里虽然 使坐标轴在boundingBox中心
+        boundingBox && this.object.boundingBox.getCenter(worldPosition).applyMatrix4(this.object.matrixWorld);
+
+        但是旋转中心并不是这个坐标轴显示的位置,需要再执行 MergeEditor.maintainBoundXY()才能维持在这个中心
+        
+        
+        
+        
+        
+        
+      */
+
     const texLoader$7 = new TextureLoader(); 
           texLoader$7.crossOrigin = "anonymous"; 
       
@@ -117011,7 +117033,7 @@ ENDSEC
             }
             
             viewer.setControls(viewer.orbitControls);
-            viewer.mainViewport.view.fixZWhenPan = true;
+            //viewer.mainViewport.view.fixZWhenPan = true
             
             
             

文件差异内容过多而无法显示
+ 1 - 1
public/lib/potree/potree.js.map


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

@@ -21,6 +21,10 @@ export const enter = (dom, isLocal) => {
             sceneBus.emit('cameraChange', { x: pos.x, y: pos.y, z: pos.z, rotate: camera.rotation })
         } 
     })
+    viewer.addEventListener('webglError', e => {
+        console.error('viewer webglError: ' + e)
+        sceneBus.emit('webglError', { msg: e.msg })
+    })
     
     window.THREE = THREE
     //isLocal = false