xzw 3 年之前
父节点
当前提交
dbdf354164
共有 4 个文件被更改,包括 32 次插入18 次删除
  1. 8 5
      js/edit.js
  2. 8 3
      js/main_2020_edit.js
  3. 9 3
      js/main_2020_show.js
  4. 7 7
      js/manage.js

+ 8 - 5
js/edit.js

@@ -252,6 +252,7 @@ EditTools.prototype.initSaveAll = function() {
             var data =  { 
                 sceneCode: number,
                 hots: reData(that.hotpoint.getSavingInfo(), '{}'),
+                //tourAudio: reData(that.editGuide.tourAudio,'{}'),//for 旧版
                 name: number,
                 guides: reData(guides, '[]'),
                 info: info, 
@@ -3351,6 +3352,7 @@ EditGuide.prototype.createDom = function(data, data2) {
             Info.locations = Info.locations.filter(e=>e)
             Info.locations.forEach(function(info, index) {
                 if (info.thumbnail_signed_src) {
+                    info.thumbnail_signed_src = manage.dealURL(info.thumbnail_signed_src) //旧场景有的少了https://
                     var $li = $(that.getItemDom( info.name, info.thumbnail_signed_src));
                     $li[0].tourData = info 
                     $folder[0].tourItemDoms.push($li[0])
@@ -3359,6 +3361,7 @@ EditGuide.prototype.createDom = function(data, data2) {
             })
         }else{//是散落在外的item
             if (Info.thumbnail_signed_src) {
+                Info.thumbnail_signed_src = manage.dealURL(Info.thumbnail_signed_src)
                 var $li = $(that.getItemDom(Info.name, Info.thumbnail_signed_src));
                 $li[0].tourData = Info
                 // 音频链接
@@ -5182,9 +5185,9 @@ var VisiSet = {
     createPanoSingleLine: function(pano, type, id) {
         //pano是中心
         var panos = player.model.panos;
-        var p2 = panos.index[id].floorPosition.clone()
+        var p2 = panos.index[id].footIcon.position.clone()
         /* .sub(player.model.position) */
-        var line = LineDraw.createLine([pano.floorPosition.clone()/* .sub(this.position) */
+        var line = LineDraw.createLine([pano.footIcon.position.clone()/* .sub(this.position) */
         , p2], {
             color: this.colors.green
         });
@@ -5278,8 +5281,8 @@ var VisiSet = {
                     name: "footIcon"
                 })
                 var foot = new THREE.Mesh(geo,mat)
-                foot.position.copy(panos.index[r].floorPosition.clone()/* .sub(player.model.position) */
-                )
+                foot.position.copy( panos.index[r].position.clone().setY(player.model.center.y) )    /* panos.index[r].floorPosition.clone()  *///不用floorPosition是因为有出现和position的水平位置不一样的点,一般是偏移很远的不可见点,拍摄的bug
+                
                 foot.lookAt(foot.position.clone().add(new THREE.Vector3(0,1,0)));
                 foot.name = panos.index[r].id;
                 foot.visible = false;
@@ -5559,7 +5562,7 @@ var VisiSet = {
     },
     createTagSingleLine: function(pano, type, tag) {
         var panos = player.model.panos;
-        var line = LineDraw.createLine([pano.floorPosition.clone()/* .sub(this.position) */
+        var line = LineDraw.createLine([pano.footIcon.position.clone()/* .sub(this.position) */
         , tag.info.position.clone()], {
             color: this.colors.green
         });

+ 8 - 3
js/main_2020_edit.js

@@ -14638,6 +14638,8 @@ function o(a, s, l) {
                         }).fail(A.bind(this, e))
                     }()
                 }()
+            }).fail(e=>{
+                alert("缺少someData文件,请检查场景码是否正确。")
             })
         }
         ).call(this, "/js/main.js")
@@ -18375,9 +18377,12 @@ function o(a, s, l) {
             this.panos.push(e),
             this.add(e.skyboxMesh),
             e.marker && this.add(e.marker);
-            var t = new n.Vector3(1,1,1)
-              , i = (new n.Box3).setFromCenterAndSize(e.position, t);
-            this.boundingBox.union(i)
+            
+            if(e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
+                var t = new n.Vector3(1,1,1)
+                  , i = (new n.Box3).setFromCenterAndSize(e.position, t);
+                this.boundingBox.union(i)
+            }
         }
         ,
         u.prototype.build = function() {

+ 9 - 3
js/main_2020_show.js

@@ -14735,6 +14735,8 @@ window.Modernizr = function(n, e, t) {
                     })
                     
                 }
+            }).fail(e=>{
+                alert("缺少someData文件,请检查场景码是否正确。")
             })
 			
 			function StartLoad(){//当加载完data后
@@ -19277,9 +19279,13 @@ window.Modernizr = function(n, e, t) {
             this.panos.push(e),
             this.add(e.skyboxMesh),
             e.marker && this.add(e.marker);
-            var t = new r.Vector3(1,1,1)
-              , i = (new r.Box3).setFromCenterAndSize(e.position, t);
-            this.boundingBox.union(i)
+            
+            if(e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
+                var t = new r.Vector3(1,1,1)
+                  , i = (new r.Box3).setFromCenterAndSize(e.position, t);
+                this.boundingBox.union(i)
+            }
+            
         }
         ,
         n.prototype.build = function() {

+ 7 - 7
js/manage.js

@@ -325,14 +325,14 @@ Manage.prototype.dealURL = function(src, type){
     
    
     if(window.isLocal && settings.localPrefix!=void 0){//本地将线上的前缀替换
-        var oldPrefixs = ["https://super.4dage.com/", "http://super.4dage.com/", "///super.4dage.com/"]
-        for(let i=0;i<oldPrefixs.length;i++){
-            if(src.includes(oldPrefixs[i])){
-                return src.replace(oldPrefixs[i], settings.localPrefix)
-                break;
-            }
+        var oldPrefix = 'super.4dage.com/';  //最简单的地址写一个,如果有其他完全不一样的地址就用数组逐个判断
+        var index = src.indexOf(oldPrefix);
+        if(index>-1){
+            var wholeOldPrefix = src.slice(0, index+oldPrefix.length);
+            return src.replace(wholeOldPrefix, settings.localPrefix)
         }
-        console.error("没有找到合适的本地链接")
+        
+        console.error("没有找到合适的本地链接") 
         return src
     }else{
         //add https://