xzw 1 年之前
父节点
当前提交
514bbb1034

+ 1 - 1
src/custom/modules/panos/Images360.js

@@ -2673,7 +2673,7 @@ Images360.prototype.updateCube = (function(){//增加细分的版本,且垂直
         if(pano1){//过渡  
             let dontAddSides  
             let dis = pano0.position.distanceTo(pano1.position)
-             
+            if(dis == 0)return 
             let sinAlpha = Math.abs(pano0.position.z - pano1.position.z) / dis //俯仰角的sin,随角度增大而增大 0-1
             let score = (1+sinAlpha*20) * dis //score越大创建的mesh越不适合 
             let isNeighbour = this.isNeighbour(pano0, pano1)   

+ 9 - 9
src/custom/objects/TextSprite.js

@@ -6,10 +6,10 @@
 
 import * as THREE from "../../../libs/three.js/build/three.module.js";
 import Sprite from './Sprite.js' 
-
+import Common from '../utils/Common.js';
 
 //可能还是要用html写,因为要加按钮和图片
-
+ 
 export class TextSprite extends THREE.Object3D{ 
     //注:为了分两层控制scale,不直接extend Sprite
 	constructor( options={}){ 
@@ -33,10 +33,10 @@ export class TextSprite extends THREE.Object3D{
 		this.textBorderThick = options.textBorderThick || 0
 		this.fontface = 'Arial';
 		this.fontsize = options.fontsize ||  16; 
-        this.textBorderColor = options.textBorderColor || { r: 0, g: 0, b: 0, a: 0.0 };
-		this.backgroundColor = options.backgroundColor || { r: 255, g: 255, b: 255, a: 1.0 };
-		this.textColor = options.textColor || {r: 0, g: 0, b: 0, a: 1.0};
-        this.borderColor = options.borderColor || { r: 0, g: 0, b: 0, a: 0.0 };
+        this.textBorderColor = options.textBorderColor ? Common.CloneObject(options.textBorderColor):{ r: 0, g: 0, b: 0, a: 0.0 };
+		this.backgroundColor = options.backgroundColor ? Common.CloneObject(options.backgroundColor):{ r: 255, g: 255, b: 255, a: 1.0 };
+		this.textColor = options.textColor ? Common.CloneObject(options.textColor):{r: 0, g: 0, b: 0, a: 1.0};
+        this.borderColor = options.borderColor  ? Common.CloneObject(options.borderColor):{ r: 0, g: 0, b: 0, a: 0.0 };
 		this.borderRadius = options.borderRadius || 6;
         this.margin = options.margin
         if(options.text != void 0)this.setText(options.text)
@@ -57,19 +57,19 @@ export class TextSprite extends THREE.Object3D{
 	}
 
 	setTextColor(color){
-		this.textColor = color;
+		this.textColor = Common.CloneObject(color);
 
 		this.updateTexture();
 	}
 
 	setBorderColor(color){
-		this.borderColor = color;
+		this.borderColor =  Common.CloneObject(color);
 
 		this.updateTexture();
 	}
 
 	setBackgroundColor(color){
-		this.backgroundColor = color;
+		this.backgroundColor =  Common.CloneObject(color);
 
 		this.updateTexture();
 	}

+ 1 - 1
src/custom/objects/tool/Measure.js

@@ -40,7 +40,7 @@ const mainLabelProp = {
     useDepth : true ,
     renderOrder : 5, pickOrder:5, 
     
-    
+     
     clipDistance : 20,//消失距离
     occlusionDistance: 5,//变为backColor距离 
     maxOcclusionFactor:0.7,

+ 5 - 6
src/custom/objects/tool/ctrlPolygon.js

@@ -167,7 +167,9 @@ export class ctrlPolygon extends THREE.Object3D {
             })
             return
         }
-        
+        if(e.drag.pointerDelta.length() == 0){ //部分设备(华为matePad11)在touchstart后立即执行了touchmove,导致marker立即移动,需要屏蔽
+            return  
+        }
         viewer.dispatchEvent({
             type : "CursorChange", action : "remove",  name:"polygon_AtWrongPlace"
         })
@@ -422,11 +424,8 @@ export class ctrlPolygon extends THREE.Object3D {
         if(e.hoverViewport != e.drag.dragViewport){//copy from dragMarker, for sitemodel, only mapViewport can be dropped
             return this.continueDrag(null,e)    
         }
-        
-        
-        
-        
-        
+          
+ 
         if(e.isTouch){ 
             if(e.hoverViewport != viewer.mainViewport && this.unableDragAtMap){
                 viewer.dispatchEvent({type:'reticule_forbit', v:true})