xzw 1 سال پیش
والد
کامیت
6da90295ec
3فایلهای تغییر یافته به همراه936 افزوده شده و 873 حذف شده
  1. 905 840
      service/PanoBoxFrame.js
  2. 2 2
      service/planeCoverService.js
  3. 29 31
      service/util/common.js

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 905 - 840
service/PanoBoxFrame.js


+ 2 - 2
service/planeCoverService.js

@@ -72,7 +72,7 @@ function addToModel(chunks, player) {
 function outputJson(boxCenvert, sceneNum, player){
   let json = {
     sceneNum, 
-    boxes:boxCenvert.boxes.map(e=> e.toJson()),
+    boxes:boxCenvert.boxesSolid.map(e=> e.toJson()),
     boundingBox: {min:boxCenvert.safeBound.min.toArray(),max:boxCenvert.safeBound.max.toArray()}
   }
   
@@ -103,7 +103,7 @@ export const planeCover = async ({sceneNum, imgBoxsList}) => {
 
 
   let boxCenvert = new PanoBoxFrame(player, true, imgBoxsList) 
-  console.log(boxCenvert.boxes)
+  console.log(boxCenvert.boxesSolid)
 
   
 

+ 29 - 31
service/util/common.js

@@ -332,38 +332,36 @@ common.getTime = function (second) {
     var str = JSON.stringify(data)
     return JSON.parse(str)
 }),
-    (common.CloneObject = function (copyObj, isSimpleCopy, simpleCopyList = []) {
-        //isSimpleCopy 只复制最外层
-        //复制json		result的可能:普通数字或字符串、普通数组、复杂对象
-
-        //isSimpleCopy 只复制最外层
-        //复制json		result的可能:普通数字或字符串、普通数组、复杂对象
-
-        simpleCopyList.includes(THREE.Object3D) || simpleCopyList.push(THREE.Object3D) //遇到simpleCopyList中的类直接使用不拷贝
-
-        if (!copyObj || typeof copyObj == 'number' || typeof copyObj == 'string' || copyObj instanceof Function || simpleCopyList.some(className => copyObj instanceof className)) {
-            return copyObj
-        } 
-        
-        if (copyObj instanceof Array) {
-            return copyObj.map(e => {
-                return this.CloneObject(e,  isSimpleCopy, simpleCopyList)
-            })
-        } else {
-            if (copyObj.clone instanceof Function) {
-                //解决一部分
-                return copyObj.clone()
-            }
-        }
-        
-        let result = {}
-        for (var key in copyObj) {
-            if (copyObj[key] instanceof Object && !isSimpleCopy) result[key] = this.CloneObject(copyObj[key], isSimpleCopy, simpleCopyList  )
-            else result[key] = copyObj[key]
-            //如果是函数类同基本数据,即复制引用
+(common.CloneObject = function (copyObj, isSimpleCopy, simpleCopyList = [], judgeSimpleCopyFun) {
+    //isSimpleCopy 只复制最外层
+    //复制json		result的可能:普通数字或字符串、普通数组、复杂对象
+
+    simpleCopyList.includes(THREE.Object3D) || simpleCopyList.push(THREE.Object3D) //遇到simpleCopyList中的类直接使用不拷贝
+    judgeSimpleCopyFun || (judgeSimpleCopyFun=()=>{})
+    
+    if (!copyObj || typeof copyObj == 'number' || typeof copyObj == 'string' || copyObj instanceof Function || simpleCopyList.some(className => copyObj instanceof className) || judgeSimpleCopyFun(copyObj)) {
+        return copyObj
+    }
+
+    if (copyObj instanceof Array) {
+        return copyObj.map(e => {
+            return this.CloneObject(e, isSimpleCopy, simpleCopyList, judgeSimpleCopyFun)
+        })
+    } else {
+        if (copyObj.clone instanceof Function) {
+            //解决一部分
+            return copyObj.clone()
         }
-        return result
-    }),
+    }
+
+    let result = {}
+    for (var key in copyObj) {
+        if (copyObj[key] instanceof Object && !isSimpleCopy ) result[key] = this.CloneObject(copyObj[key], isSimpleCopy, simpleCopyList, judgeSimpleCopyFun)
+        else result[key] = copyObj[key]
+        //如果是函数类同基本数据,即复制引用
+    }
+    return result
+}),
     (common.CloneClassObject = function (copyObj) {
         //复杂类对象
         var newobj = new copyObj.constructor()