xzw hai 1 ano
pai
achega
5669c8b73b
Modificáronse 2 ficheiros con 28 adicións e 17 borrados
  1. 16 11
      public/test-case/model-list-demo.json
  2. 12 6
      src/sdk/cover/index.js

+ 16 - 11
public/test-case/model-list-demo.json

@@ -7,22 +7,22 @@
             "fusionNumId": 803,
             "fusionId": 238,
             "modelId": 873,
-            "hide": 0,
+            "hide": 0, 
             "transform": {
                 "scale": [
-                    100.0,
-                    100.0,
-                    100.0
+                    100, 
+                    100, 
+                    100
                 ],
                 "position": {
-                    "x": -13.88127,
-                    "y": 1.18391,
-                    "z": 0.0
+                    "x": 103.43001014349527,  
+                    "y":-103.77109873965905, 
+                    "z": 18.132000368
                 },
                 "rotation": {
                     "x": 0.0,
                     "y": 0.0,
-                    "z": 0.0
+                    "z": 3.1280225340268974
                 }
             },
             "opacity": 100.0,
@@ -58,6 +58,7 @@
                 "isLaser": null,
                 "phone": null,
                 "bind": true,
+                "visible": 1,  
                 "location": null
             }
         },
@@ -66,7 +67,7 @@
             "fusionNumId": 782,
             "fusionId": 231,
             "modelId": 834,
-            "hide": 0,
+            "hide": 0, 
             "transform": {
                 "scale": [
                     100,
@@ -92,6 +93,7 @@
                 "modelTitle": "people",
                 "modelDateType": "obj",
                 "modelSize": "81.05MB",
+                "showInPano": true,
                 "type": 3,
                 "modelObjUrl": null,
                 "modelGlbUrl": "[\"https://4dkk.4dage.com/fusion/prod/model/glb/868/man001.glb\"]",
@@ -117,6 +119,7 @@
                 "isLaser": null,
                 "phone": null,
                 "bind": true,
+                "visible": 1,
                 "location": null
             }
         },
@@ -125,7 +128,7 @@
             "fusionNumId": 778,
             "fusionId": 231,
             "modelId": 811,
-            "hide": 0,
+            "hide": 0, 
             "transform": {
                 "scale": [
                     100.0,
@@ -176,6 +179,7 @@
                 "isLaser": false,
                 "phone": null,
                 "bind": true,
+                "visible": 1,
                 "location": null
             }
         },
@@ -184,7 +188,7 @@
             "fusionNumId": 775,
             "fusionId": 231,
             "modelId": 808,
-            "hide": 0,
+            "hide": 0, 
             "transform": {
                 "scale": [
                     100.0,
@@ -235,6 +239,7 @@
                 "isLaser": null,
                 "phone": null,
                 "bind": true,
+                "visible": 1,
                 "location": null
             }
         }

+ 12 - 6
src/sdk/cover/index.js

@@ -662,10 +662,17 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes }) => {
 
             let startLoad = (prop) => {
                 //if(autoLoads.filter(e=>e.loaded).length>1)return console.log('取消加载', prop), prop.onError()
+/* if(props.raw.visible === 0){//用于临时隐藏
+    setTimeout(()=>{
+        spliceFromArr(model, false)
+        bus.emit('loadError' )
+    },1)
+    
+    return
+}   */            
                 Potree.Log(`--开始加载--`, { font: { color: '#f68' } });
-                console.log('id:', prop.id, ', title:', prop.title, ', filename:', Potree.Common.getNameFromURL(prop.url), ', modelType:', prop.modelType, prop)
-
-
+                console.log('id:', prop.id, ', title:', prop.title, ', filename:', Potree.Common.getNameFromURL(prop.url), ', type:', prop.type, prop)
+ 
                 prop.unlit = props.renderType != 'normal'
                 prop.maximumScreenSpaceError = 60
                 Potree.addModel(prop, prop.done, prop.progressFun, prop.onError)
@@ -715,7 +722,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes }) => {
                 if (!props.isFirstLoad) {
                     model.visible = false//先不显示,防止卡顿
                 }
-
+                model.showInPano = props.raw.showInPano
                 props.opacity < 100 && result.changeOpacity(props.opacity)
 
                 model.addEventListener('changeSelect', (e) => {
@@ -775,7 +782,6 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes }) => {
                 spliceFromArr(model, false)
             }
 
-
             try {
                 props.url = JSON.parse(props.url) //去掉 '\'
             } catch (e) { }
@@ -812,7 +818,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes }) => {
                         Potree.Utils.updateVisible(MergeEditor.boxHelper, 'showPanos', false)
 
                         let changeVisi = (object) => {
-                            Potree.Utils.updateVisible(object, 'showPanos', object == model && Potree.settings.modelSkybox)
+                            Potree.Utils.updateVisible(object, 'showPanos', object == model && Potree.settings.modelSkybox || object.showInPano)
                         }