test pc il y a 3 ans
Parent
commit
eb48f1bfb7
1 fichiers modifiés avec 26 ajouts et 0 suppressions
  1. 26 0
      src/move/move.service.ts

+ 26 - 0
src/move/move.service.ts

@@ -1339,6 +1339,32 @@ export class MoveService implements OnModuleInit {
     }
   }
 
+  stopJoystick(userId){
+    this.reply.traceIds = [];
+    const user = this.users[userId];
+    this.reply['newUserStates'][0].userId = userId;
+    this.reply['actionResponses'][0].traceId = null;
+    this.reply['newUserStates'][0].playerState.player.angle.yaw = user.player.angle.yaw;
+
+    this.reply['newUserStates'][0].playerState.player.position = JSON.parse(
+      JSON.stringify(user.player.position),
+    );
+    this.reply['newUserStates'][0].playerState.camera.angle = JSON.parse(
+      JSON.stringify(user.camera.angle),
+    );
+    this.reply['newUserStates'][0].playerState.camera.position = JSON.parse(
+      JSON.stringify(user.camera.position),
+    );
+
+    this.reply['newUserStates'][0].playerState.cameraCenter = JSON.parse(
+      JSON.stringify(user.player.position),
+    );
+    this.reply['newUserStates'][0].renderInfo.isMoving = 0;
+    this.reply['actionResponses'][0].traceId = null;
+    this.reply.mediaSrc = null;
+    return this.reply;
+  }
+
   async modeifyCameraAngle(angle, userId, traceId, actionType) {
     const checkReplys = [];
     if (angle > 22) {