zhouenguang 3 years ago
parent
commit
87d4ab1544
3 changed files with 11 additions and 14 deletions
  1. 2 2
      src/ActionsHandler.js
  2. 9 11
      src/RotationEvent.js
  3. 0 1
      src/XMaterialComponent.js

+ 2 - 2
src/ActionsHandler.js

@@ -400,9 +400,9 @@ export default class ActionsHandler {
         }
         }
         
         
         // 起始帧不需要传入
         // 起始帧不需要传入
-        if(efns>sfns) sfns = (sfns + 1) % 60
+        if(efns>sfns) sfns = (sfns + 1 + 60) % 60
         if(efns<sfns) sfns = (sfns - 1 + 60) % 60
         if(efns<sfns) sfns = (sfns - 1 + 60) % 60
-        efns = sfns
+        efns = (efns + 60) % 60
         // console.error(sfns, efns)
         // console.error(sfns, efns)
 
 
         window.camera_endRotation = endRotation
         window.camera_endRotation = endRotation

+ 9 - 11
src/RotationEvent.js

@@ -63,17 +63,15 @@ export default class RotationEvent {
 
 
                 // window.rotating = true
                 // window.rotating = true
 
 
-                // setTimeout(() => {
-                    // 开始旋转
-                    this._room.actionsHandler.rotate({
-                        type: 'rotate',
-                        angle: Math.PI/30 * Math.sign(angle)    // 目前固定1次mousemove只转1帧
-                    });
-
-                    // 重置累计
-                    this.offset = 0
-                //     this.rotating = false
-                // }, 1000/32 * Math.abs(angle/(Math.PI/30)))
+                // 开始旋转
+                this._room.actionsHandler.rotate({
+                    type: 'rotate',
+                    angle: Math.PI/30 * Math.sign(angle)    // 目前固定1次mousemove只转1帧
+                });
+
+                // 重置累计
+                this.offset = 0
+                // this.rotating = false
             }
             }
 
 
             this.touchStartX = pageX;
             this.touchStartX = pageX;

+ 0 - 1
src/XMaterialComponent.js

@@ -274,7 +274,6 @@ export default class XMaterialComponent {
     //xst
     //xst
     receveFrames(data){
     receveFrames(data){
         // console.error("decodeData")
         // console.error("decodeData")
-        // if(window.star_angle != 0)
         window.room.doRotate(window.star_angle)
         window.room.doRotate(window.star_angle)
 
 
         const { width, height, data: buffer } = data;
         const { width, height, data: buffer } = data;