xzw 4 лет назад
Родитель
Сommit
070bebb71a
5 измененных файлов с 212 добавлено и 14 удалено
  1. 1 1
      edit.html
  2. 11 2
      eforclient.html
  3. 4 0
      index.html
  4. 8 0
      js/SpecialScene.js
  5. 188 11
      js/main_2020_show.js

+ 1 - 1
edit.html

@@ -123,7 +123,7 @@
                                 </div>
                                 <div id="gui-loading" class="message-outer darkGlass" style="display: none;">
                                     <h2 class="model-title"></h2>
-                                    <div class="message-inner">
+                                    <div class="message-inner"> 
                                         <div class="progressbar" data-perc="100">
                                             <div class="label">
                                                 <div class="perc">0%</div>

+ 11 - 2
eforclient.html

@@ -100,6 +100,8 @@
                     <!-- 画布区域 -->
                     <div class="webgl-inside">
                         <div class="content">
+                            <div id="hot"> 
+                            </div>
                             <div id="popup">
                                 <div class="popup-content">
 
@@ -899,9 +901,9 @@
                                 <button class="innerBtn" id="addHotSpots">添加热点</button>
                             </div>
                         </li>
-                        <li class="describ noBorderbott">
+                        <!-- <li class="describ noBorderbott">
                             <label class="remark">通过添加热点,您可以进一步装饰您的场景;例如:说明文字、图片、音频、视频等。</label>
-                        </li>
+                        </li> -->
                         <li data-name="MouseMarkerColor" class="tourSelectWarp hotListSwitch">
                             <div class="itemTitle hotListSwitchTitle">
                                 <span>热点列表</span>
@@ -956,6 +958,13 @@
                                     <div class="itemTitle">
                                         <span>位置</span>
                                     </div>
+                                    <ul>
+                                        <li>
+                                            <input name="isSprite" class="editCheckbox" type="checkbox" value="isSprite" id="isSprite">
+                                            <label for="isSprite"></label>
+                                            <label for="isSprite">恒朝向相机 </label>
+                                        </li>
+                                    </ul>
                                     <ul class="MenuOptions innerBtn" name="transform">
                                         <li class="halfCell chosen" index="translate" data-lang="">位移</li>
                                         <!-- <li class="halfCell" index="scale" data-lang="">缩放</li> -->

+ 4 - 0
index.html

@@ -72,6 +72,10 @@
         <div id="gui-loading" class="message-outer darkGlass" style="display: none;">
             <h2 class="model-title"></h2>
             <div class="message-inner">
+                <div class="loadingLogo"> 
+                    <div class="img"> 
+                    </div> 
+                </div> 
                 <div class="progressbar" data-perc="100">
                     <div class="label">
                         <div class="perc">0%</div>

+ 8 - 0
js/SpecialScene.js

@@ -61,3 +61,11 @@ SpecialScene.prototype.data391 = function(){
 var specialScene = new SpecialScene()
 
 
+
+if(window.number == "YHVR"){
+    settings.floorlogoURL = "images/floorlogo.png"
+    $("#gui-loading .loadingLogo .img").append($("<img src = 'images/loadingLogo.png'></img>"))
+}
+
+
+

+ 188 - 11
js/main_2020_show.js

@@ -17329,11 +17329,11 @@ window.Modernizr = function(n, e, t) {
               , C = e("../loaders/ModelTextureLoader")
               , I = e("../loaders/SweepDataLoader")
               , E = e("../util/transitions")
-              , b = (e("../util/easing"),
-            e("../util/lerp"),
-            e("../util/common"))
-              , w = (e("../util/texture"),
-            e("./../util/browser"))
+              , b =   e("../util/common") 
+             , es = e("../util/easing") 
+            ,lerp = e("../util/lerp") 
+            ,tex = e("../util/texture")
+              , w =   e("./../util/browser") 
               , _ = e("./ImageCollection")
               , T = e("./RoomCollection")
               , x = e("./LabelCollection")
@@ -17794,6 +17794,135 @@ window.Modernizr = function(n, e, t) {
                 $.when(this)
             }
             ,
+            
+            n.prototype.createFloorLogo = function(){
+                console.log('createFloorLogo')
+                if(this.floorLogos || !settings.floorlogoURL)return;
+                
+                var url = settings.floorlogoURL
+                var map = tex.load(url);//可以追加done
+                 
+                this.floorLogos = [];
+                for(var i=0; i<2; i++){ //不可共用uniforms等  [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
+                    
+                    var material = new o.MeshBasicMaterial({
+                        opacity:0,
+                        map:map,
+                        side: o.DoubleSide, 
+                        transparent: !0, 
+                        depthWrite: !1,
+                        depthTest:false//改 在chunk\skybox外也可看到
+                    });
+                    
+                    var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material); 
+
+                    //var s = (Store.metadata.floorLogoSize || 100)/100;
+                    //logo.scale.set(s,s,s);
+                    logo.position.set(0,-1.5,0);
+                    logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0))); 
+                    logo.renderOrder = 100;//cover the videoSkybox
+                    //logo.layers.set(0)
+                    this.add(logo); 
+                    this.floorLogos.push(logo);		
+                } 
+                this.floorLogos[1].visible = false; 
+            }
+            n.prototype.adjustfloorLogoHeight = function(o){  
+                var h = player.currentPano.floorPosition.y + 0.01;
+                this.floorLogos[1].position.setY(h);
+                this.floorLogos[0].position.setY(h);
+                //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
+                  
+            },
+
+            n.prototype.changefloorLogoOpa = function(o){//改  i, opacity,  time, delay 
+                if(!this.floorLogos) return; 
+                E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
+                if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
+                if(!o.dur){//立刻
+                    //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
+                    this.floorLogos[o.index].material.opacity = o.opa;
+                }else{
+                    //E.start(lerp.uniform(this.floorLogos[o.index], "opacity",  o.opa), o.dur || 0, null, 
+                    E.start(lerp.property(this.floorLogos[o.index].material, "opacity",  o.opa), o.dur || 0, null, 
+                        o.delay||0,  es["easeInQuad"],  "changefloorLogoOpa",  "flOpa_"+o.index)
+                }
+                
+            },
+            n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
+                var lastQ, lastP; 
+                
+                var equals = function(v1, v2, min){
+                    return Math.abs(v1-v2) < min
+                }
+                var isSame = function(now, last, k){//如果和上次相同就不改变
+                    if(!last)return false; 
+                    var R = k.sceneRenderer;
+                    //var min = R.AFPS < 38 ? 0.005 :  R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
+                    //暂时:
+                    
+                    var min = 0.0008 
+                    var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min) 
+                                && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
+                     
+                    return same;
+                }
+                 
+                return function(Q, k){ 
+                    if(!Q)return; 
+                    /* if(Config.ifFish && window.lowFPS){ 
+                        this.fLCompute++;
+                        
+                        if(R.AFPS < 38){
+                            if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return;  //点击tag过渡 
+                            else  if(k.flying && k.fLCompute%2 !=1) return;
+                            k.fLCompute %= 4;
+                        }else if(R.AFPS < 45){
+                            if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return;  //点击tag过渡 
+                            else  if(k.flying && k.fLCompute%2 !=1) return;
+                            k.fLCompute %= 6;
+                        }else{
+                            if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;   
+                            //else  if(k.flying && k.fLCompute%2 !=1) return;
+                            k.fLCompute %= 2;
+                        }
+                    }  */ 
+                    var sameQ, sameP, quaternion, visible; 
+                     
+                    for(var i=0;i<2;i++){
+                        var logo = this.floorLogos[i]; 
+                        if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
+                        visible = true;
+                    }
+                    if(!visible)return;	//如果两个都不可见,就不更改,如果有一个可见,就都改
+                    
+                    
+                    var c = k.cameraControls.activeControl; 
+                    var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1)  ): false;
+                    sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
+                    
+                     
+                    for(var i=0;i<2;i++){
+                        var logo = this.floorLogos[i];
+                        
+                        if(!sameQ){
+                            if(!quaternion){
+                                var a = new THREE.Vector3(0,0,-1);
+                                a.applyQuaternion(Q);
+                                a.setY(0);
+                                var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0)); 
+                                quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
+                                var a  = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得	
+                                quaternion.multiply(a);
+                            }
+                            logo.quaternion.copy(quaternion); 
+                        }  
+                          
+                    }
+                    
+                }
+            }()
+
             n.prototype.loadLabels = function() {//xzw
                 this.labels = new x(this);
                 var e = $.Deferred();
@@ -22343,8 +22472,20 @@ window.Modernizr = function(n, e, t) {
                     this.emit(w.PanoChosen, this.currentPano, i),
                     this.emit(w.FlyingStarted, i.position, L, i, D)
                     
-                    this.updateHotVisible(i); //更新热点显示
                     
+                     //---------before fly--------------- add
+                    this.updateHotVisible(i); //更新热点显示
+                    //地标变化
+                    if(this.model.floorLogos){
+                        this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);  
+                        this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
+                        //this.model.adjustfloorLogoHeight();
+                        this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0; 
+                        this.model.floorLogos[1].visible = true;
+                        this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
+                    }
+                    //=======================================
+
                     
                     n && y.start(function(e) {
                         S.copy(b),
@@ -22369,6 +22510,14 @@ window.Modernizr = function(n, e, t) {
                         this.emit(w.FlyingEnded, i.position, L, i, D),
                         this.updateMarkerVisi(),//add
                         C(e)
+                        
+                         //add:
+                        if(this.mode == "panorama" && this.model.floorLogos){
+                            this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
+                            //this.model.adjustfloorLogoHeight()
+                            this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
+                            this.model.floorLogos[1].visible = false;
+                        }
                     }
                     .bind(this), 0, B, "camFly", V.FlyToPano)
                 }
@@ -22672,15 +22821,38 @@ window.Modernizr = function(n, e, t) {
                 n && (this.currentPano = n),
                 this.switchCameraMode(i, c),
                 y.cancelById(V.LookTransition);
-                var _ = (new r.Vector3).copy(this.position);
-                if (i === u.PANORAMA)
+                
+                
+                
+                 //before fly---------------------
+                if(this.mode == "panorama"){ 
+                    if(this.model.floorLogos){
+                        this.model.floorLogos[0].visible = false;
+                        this.model.floorLogos[1].visible = false;
+                    }
+                }
+                
+                //------------------------------------
+                
+                
+                
+                
+                
+                var _ = (new r.Vector3).copy(this.position); 
+                if (i === u.PANORAMA){
                     this.emit(w.PanoChosen, n, n),
                     setTimeout(function() {
                         n.floor.enter(i)
                     }
                     .bind(this), I / 2),
                     this.path.fadeOutCpm(f.path.fadeOutTime);
-                else if (i === u.DOLLHOUSE) {
+                    
+                    if(this.model.floorLogos){
+                        this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
+                        this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
+                    }
+                    
+                }else if (i === u.DOLLHOUSE) {
                     if (h && (this.model.stayPut = !0),
                     a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
                     this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
@@ -22754,8 +22926,13 @@ window.Modernizr = function(n, e, t) {
                     this.mode = i,
                     this.emit(w.FlyingEnded, _, G, this.currentPano, H) 
                     
-                    this.updateMarkerVisi(),//add
-                    (p === u.PANORAMA || i == u.PANORAMA) && this.updateHotVisible(),//add
+                    //add:
+                    this.updateMarkerVisi(),
+                    (p === u.PANORAMA || i == u.PANORAMA) && this.updateHotVisible(), 
+                    this.mode == u.PANORAMA&&this.model.floorLogos&&( 
+                        this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
+                        this.model.floorLogos[0].visible = true
+                    )
                     
                     
                     h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),