test pc 3 anni fa
parent
commit
1571616a2a
1 ha cambiato i file con 11 aggiunte e 1 eliminazioni
  1. 11 1
      src/move/move.service.ts

+ 11 - 1
src/move/move.service.ts

@@ -1335,12 +1335,13 @@ export class MoveService implements OnModuleInit {
   }
 
   complementFrame(userId) {
-    console.log('handlejoysticktesttest:complementFrame:'+this.cameraInfos.length);
     if (this.cameraInfos == null) {
+      console.log('handlejoysticktesttest:complementFrame-1 结束'+new Date().getTime())
       this.cameraInfos = [];
       return null;
     }
     else if (this.cameraInfos.length > 0) {
+      console.log('handlejoysticktesttest:complementFrame-2 继续'+new Date().getTime())
       const user = this.users[userId];
       const cameraInfo = this.cameraInfos.shift();
       this.reply.traceIds = [];
@@ -1367,10 +1368,19 @@ export class MoveService implements OnModuleInit {
         this.reply.mediaSrc = cameraInfo.mediaSrc;
       }
 
+      user.camera.position = JSON.parse(
+        JSON.stringify(cameraInfo.camera_position),
+      );
+      
+      user.camera.angle = JSON.parse(
+        JSON.stringify(cameraInfo.camera_angle),
+      );
+
       this.sendingFrameForJoystick = true;
       return this.reply;
     } 
     else if (this.cameraInfos.length == 0){
+      console.log('handlejoysticktesttest:complementFrame-3 停止'+new Date().getTime())
       this.cameraInfos = null;
       return this.stopJoystick(userId)
     }