Browse Source

Merge branch 'master' of http://face3d.4dage.com:7005/chenzhiguang/nj_museum

tremble 2 năm trước cách đây
mục cha
commit
bf683eb9c1
2 tập tin đã thay đổi với 9 bổ sung11 xóa
  1. 2 5
      public/package/js/label.js
  2. 7 6
      public/package/js/objViewer.js

+ 2 - 5
public/package/js/label.js

@@ -62,7 +62,7 @@ class Label2D extends THREE.EventDispatcher {
         this.update()
     }
 
-
+ 
     update(e={}) {
         if (!this.position || !this.visible || this.sheltered) return
  
@@ -83,10 +83,7 @@ class Label2D extends THREE.EventDispatcher {
 
         //判断label是否被模型遮挡,遮挡则消失(如果是漫游模式最好提前计算visiblePanos)
     
-    
-    
-            
-    
+     
        /*  if (e.changeSlightly) {//防卡: 画面要停止转动时才执行
             if (this.shelterByModel && convertTool.ifShelter(this.position, p.vector, viewer.camera, viewer.model.children, 0.05)) {
                 this.sheltered = true

+ 7 - 6
public/package/js/objViewer.js

@@ -80,8 +80,9 @@ Viewer.prototype.setRenderer = function () {
 Viewer.prototype.update = function (deltaTime) {//绘制的时候同时更新 
     //if(!this.active)return;
     this.setSize()
-    this.control.update(deltaTime)
     transitions.update(deltaTime)
+    this.control.update(deltaTime)//写在transitions后面否则镜头抖动
+    
     var needsUpdate = 1;
 
     if (needsUpdate) {
@@ -107,7 +108,7 @@ Viewer.prototype.hasChanged = function () {//判断画面是否改变了,改
 
     if (!this.previousState) {
         copy()
-        return { cameraChanged: !0, changeSlightly: !1 };
+        return { cameraChanged: !0/* , changeSlightly: !1 */ };
     }
     var cameraChanged =
         !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) ||
@@ -116,14 +117,14 @@ Viewer.prototype.hasChanged = function () {//判断画面是否改变了,改
 
 
     //var changed = cameraChanged //|| !this.mouse.equals(this.previousState.mouse)  
-    let changeSlightly
+    /* let changeSlightly
     if (cameraChanged) {
         changeSlightly = math.closeTo(this.camera.position, this.previousState.position, 1e-2) &&
             math.closeTo(this.camera.quaternion, this.previousState.quaternion, 1e-3)
-    }
+    } */
     copy()
 
-    return { cameraChanged, changeSlightly };
+    return { cameraChanged/* , changeSlightly  */};
 }
 
 Viewer.prototype.setSize = function () {
@@ -168,7 +169,7 @@ Viewer.prototype.animate = function () {
 
     let changed = this.hasChanged()
     if (changed.cameraChanged) {
-        this.dispatchEvent({ type: 'view.changed', changeSlightly: changed.changeSlightly })
+        this.dispatchEvent({ type: 'view.changed'/* , changeSlightly: changed.changeSlightly */ })
         delayNeedUpdated = true
 
         if (!transitions.funcs.some(function (e) { return e.name === 'cameraFly' })) {