test pc 3 年之前
父节点
当前提交
ec120b58c2
共有 2 个文件被更改,包括 7 次插入6 次删除
  1. 4 2
      src/move/move.service.ts
  2. 3 4
      src/scene/scene.service.ts

+ 4 - 2
src/move/move.service.ts

@@ -934,8 +934,10 @@ export class MoveService implements OnModuleInit {
         neighPoints.push(neighPoint);
         ++count;
       } else if (Math.abs(angle - move_angle) == 0) {
-        count = 2
-        //console.log('handlejoysticktesttest:刚好45°的倍数')
+        neighPoint.angle = angle;
+        neighPoints.push(neighPoint);
+        ++count;
+        console.log('handlejoysticktesttest:45°的倍数')
         //debugger;
         break;
 

+ 3 - 4
src/scene/scene.service.ts

@@ -617,14 +617,13 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
             DIR: setDIR,
           };
 
-          if (this.isJoystickHasStream) {
-            await this.sleep(10);
-          }
-
           const hasPush = await this.streamService.pushFrameToSteam(streamData);
           if (hasPush.done) {
             this.isJoystickHasStream = true;
             console.log('joystick-hasPush', hasPush);
+            if (this.isJoystickHasStream) {
+              await this.sleep(30);
+            }
             this.moveService.sendingFrameForJoystick = false;
             const data = joystickRes as StreamReplyType;
             console.log('handlejoystick-moveOver:' + data.moveOver);