Explorar o código

fix: label2改进。panoEditor 3d的translate轴全部显示

xzw %!s(int64=2) %!d(string=hai) anos
pai
achega
fa3ca9235f

+ 1 - 1
src/custom/modules/panoEdit/panoEditor.js

@@ -156,7 +156,7 @@ class PanoEditor extends THREE.EventDispatcher{
                 }); 
                 this.transformControls.setSize(1.5)
                 viewer.scene.scene.add(this.transformControls)
-                this.transformControls._gizmo.hideAxis = {translate:['x','y'], rotate:['x','y','e'] }
+                this.transformControls._gizmo.hideAxis = {/* translate:['x','y'], */ rotate:['x','y','e'] }
                 this.transformControls.setRotateMethod(2)
                 
                 this.fakeMarkerForTran = new THREE.Mesh(new THREE.BoxBufferGeometry(0.3,0.3,0.3) , new THREE.MeshBasicMaterial({

+ 11 - 9
src/custom/modules/panos/Panorama.js

@@ -81,7 +81,7 @@ class Panorama extends THREE.EventDispatcher{
             if(e.reason == 'screenshot' || e.visible){
                 this.label && (this.label.visible = e.visible)//截图时隐藏下
             }
-            this.label2 && Potree.Utils.updateVisible(this.label2, 'panoVisi', e.visible)
+            //this.label2 && Potree.Utils.updateVisible(this.label2, 'panoVisi', e.visible)
         })
         /*  
         漫游点可见性:旧
@@ -298,7 +298,7 @@ class Panorama extends THREE.EventDispatcher{
         })    
              
         this.marker = marker 
-        
+        marker.pano = this;
         this.images360.node.add(marker)
         Potree.settings.isTest && this.addLabel()
         //this.addLabel2() 
@@ -341,15 +341,15 @@ class Panorama extends THREE.EventDispatcher{
             this.label.update()
         }
         
-        if(this.label2){
+        /* if(this.label2){
             if(Potree.settings.editType == 'pano'){
                 this.label2.position.copy(this.position)
             }else{
                 this.label2.position.copy(this.floorPosition)
             }
-            this.label2.position.copy(this.marker.position)
+            this.label2.position.copy(this.marker.position) 
             this.label2.update()
-        }
+        } */
           
     }
     
@@ -553,12 +553,14 @@ class Panorama extends THREE.EventDispatcher{
         this.label2 = new TextSprite(Object.assign({},
            labelProp2, {text: /* this.originID  */   parseInt(this.id)+1   }) //{text: `id:${this.id}, dataset:${this.pointcloud.name}, 4dkkId:${this.originID}`}
         ); 
-        this.images360.node.add(this.label2);
-        this.floorPosition && this.label2.position.copy(this.floorPosition)
-        let s = 0.4
+        //this.images360.node.add(this.label2);
+        this.marker.add(this.label2)
+        
+        //this.floorPosition && this.label2.position.copy(this.floorPosition)
+        let s = 0.2
         this.label2.scale.set(s,s,s)
         Potree.Utils.updateVisible(this.label2, 'notDisplay', false)
-        Potree.Utils.updateVisible(this.label2, 'panoVisi', this.visible)
+        //Potree.Utils.updateVisible(this.label2, 'panoVisi', this.visible)
     }
     
     removeTextLabel(){

+ 9 - 2
src/navigation/InputHandlerNew.js

@@ -613,19 +613,26 @@ export class InputHandler extends THREE.EventDispatcher {
             
             if(pressDistance < Potree.config.clickMaxDragDis && pressTime<Potree.config.clickMaxPressTime && !e.unableClick){
                 let clickElement, consumed = false;
-                if(this.hoveredElements){
+                if(this.hoveredElements){ 
                     clickElement = this.hoveredElements.find(e=>e.object._listeners['click']) 
                     if(clickElement){
+                        let canceled 
+                        let cancel = () => { return canceled = true; };
                         //console.log('clickElement',clickElement)
                         if (this.logMessages) console.log(`${this.constructor.name}: click ${clickElement.name}`);
                         clickElement.object.dispatchEvent($.extend(  
                             this.getEventDesc(e,isTouch),
                             {
                                 type: 'click',
-                                pressDistance     
+                                pressDistance ,
+                                cancel                                
                             }
                         )); 
+                        if(canceled){//比如只需要右键的话,可以忽视左键的点击
+                            clickElement = null
+                        }
                     } 
+                    
                 }