test pc 3 years ago
parent
commit
9ef97c1007
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/move/move.service.ts

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

@@ -27,6 +27,8 @@ const seqExeAsyncFn = (asyncFn) => {
   };
   };
 };
 };
 
 
+const moveInterval = 3;
+
 @Injectable()
 @Injectable()
 export class MoveService implements OnModuleInit {
 export class MoveService implements OnModuleInit {
   constructor(
   constructor(
@@ -361,7 +363,7 @@ export class MoveService implements OnModuleInit {
     );
     );
     const user = this.users[userId];
     const user = this.users[userId];
     let i;
     let i;
-    for (i = 1; i < moveFrames.length; i += 3) {
+    for (i = 1; i < moveFrames.length; i += moveInterval) {
       const moveFrame = moveFrames[i];
       const moveFrame = moveFrames[i];
       const reply = JSON.parse(JSON.stringify(this.reply));
       const reply = JSON.parse(JSON.stringify(this.reply));
       if (reply.traceIds.indexOf(traceId) == -1) {
       if (reply.traceIds.indexOf(traceId) == -1) {
@@ -880,8 +882,9 @@ export class MoveService implements OnModuleInit {
     const user = this.users[userId];
     const user = this.users[userId];
     const breakPointId = user.breakPointId;
     const breakPointId = user.breakPointId;
     const appId = user.appId;
     const appId = user.appId;
-    const step = 0.3;
-    const closestDis = 85; //小于这个距离就跳到邻居呼吸点
+    //const step = 0.3;
+    const step = 0.8;
+    const closestDis = 80; //小于这个距离就跳到邻居呼吸点
     const distance = step * dir_action.speed_level;
     const distance = step * dir_action.speed_level;
     let angle = null;
     let angle = null;
     let move_angle = dir_action.move_angle + user.camera.angle.yaw;
     let move_angle = dir_action.move_angle + user.camera.angle.yaw;
@@ -1287,7 +1290,7 @@ export class MoveService implements OnModuleInit {
   }
   }
 
 
   setCameraInfo(appId, moveFrames, startBreakPointId, endBreakPointId) {
   setCameraInfo(appId, moveFrames, startBreakPointId, endBreakPointId) {
-    for (let i = 0; i < moveFrames.length; i += 5) {
+    for (let i = 0; i < moveFrames.length; i += moveInterval) {
       moveFrames[i].endBreakPointId = endBreakPointId;
       moveFrames[i].endBreakPointId = endBreakPointId;
       moveFrames[i].mediaSrc =
       moveFrames[i].mediaSrc =
         '/' +
         '/' +