xzw 3 vuotta sitten
vanhempi
commit
7a0c794849
2 muutettua tiedostoa jossa 31 lisäystä ja 8 poistoa
  1. 11 1
      public/static/js/main_2020_show.js
  2. 20 7
      public/static/js/manage.js

+ 11 - 1
public/static/js/main_2020_show.js

@@ -20234,6 +20234,7 @@ window.Modernizr = function (n, e, t) {
                 t.opacity.value = 0,
                 t.color.value.set(o.reticuleColor),
                 t.showMouseMarker = !window.DATA.hideMouseMarker;
+                
             r.Mesh.call(this, new r.PlaneBufferGeometry(.4, .4, 1, 1), new r.RawShaderMaterial({
                 side: r.DoubleSide,
                 depthWrite: !1,
@@ -20516,6 +20517,11 @@ window.Modernizr = function (n, e, t) {
                 n.prototype.createCpm = function (e) {
                     if (!this.currentPanoMarker) {
                         var t = this.makeWaypointObj(w.pathEnd, "Current");
+                        
+                        let scale = 4000/(window.innerWidth + window.innerHeight )*window.devicePixelRatio   //防止移动端看起来过小
+                        console.error('scalescalescalescalescale!!!!!!!!!!!!!!!!!!!!!',scale)
+                        t.scale.set(scale,scale,scale) 
+                        
                         t.material.uniforms.opacity.value = 0,
                             this.currentPanoMarker = {
                                 mesh: t,
@@ -21031,9 +21037,12 @@ window.Modernizr = function (n, e, t) {
                 }
                 ,
                 n.prototype.makeEndMarker = function (e) {
-                    var t = this.makeWaypointObj(w.pathEnd, "End")
+                    var t = this.makeWaypointObj(w.pathEnd, "End") 
                         , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
                         , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
+                    
+                    
+                    
                     return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
                         t.position.copy(e),
                         t
@@ -23772,6 +23781,7 @@ window.Modernizr = function (n, e, t) {
                     this.flying = false
                     this.nextPano = null
                     this.updateMarkerVisi();//add
+                    o.callback && o.callback()
                 })
 
             }

+ 20 - 7
public/static/js/manage.js

@@ -266,13 +266,14 @@ var convertTool = {
     };
   },
 
-  ifShelter: function(pos3d, floorIndex) {
+  ifShelter: function( pos3d, pos2d, floorIndex, camera) {
     //检测某点在视线中是否被mesh遮挡
-    var ori = player.position;
-    var dir = pos3d
-      .clone()
-      .sub(ori)
-      .normalize();
+    //if (!pos2d) pos2d = this.getPos2d(pos3d, player)
+    camera = camera || player.camera
+    var ori = new THREE.Vector3(pos2d.x, pos2d.y, -1).unproject(camera) //找到视线原点 //var ori = player.position;
+    var dir = pos3d.clone().sub(ori).normalize()
+     
+     
     var ray = new THREE.Raycaster(ori, dir); //由外向里 因为模型从内侧是可见的所以从外侧
 
     /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
@@ -1352,16 +1353,28 @@ function initByTHREE(THREE) {
           return;
         }
 
-        if (this.shelterByModel && convertTool.ifShelter(this.position, this.floorIndex)) {
+        if (this.shelterByModel && convertTool.ifShelter(this.position, p.vector,   this.floorIndex)) {
           this.elem.css("display", "none");
           return;
         }
       }
+      
+      
+      let s = 1
+      if(player.mode == 'floorplan'){
+          s = THREE.Math.clamp(0.12/player.cameraControls.activeControl.camera.right * window.innerWidth / window.devicePixelRatio, 0.1, 1)
+           
+      } 
+
+
 
       this.elem.css({
         left: p.pos.x + "px",
         top: p.pos.y + "px",
+        transform: 'scale('+s+')',
       });
+      
+      
 
       /* if(settings.vrEnabled){
                 this.elem.css({transform:'rotate('+window.screenFaceOrient+'deg)'})