|
@@ -361,9 +361,7 @@ export class MoveService implements OnModuleInit {
|
|
|
moveFrame.file_name +
|
|
|
'?m=' +
|
|
|
new Date().getTime();
|
|
|
- if (moveFrame.file_name == '6_7_0.0031.h264') {
|
|
|
- debugger;
|
|
|
- }
|
|
|
+
|
|
|
reply.startBreakPointId = startBreakPointId;
|
|
|
reply.endBreakPointId = endBreakPointId;
|
|
|
replys.push(reply);
|
|
@@ -860,9 +858,6 @@ export class MoveService implements OnModuleInit {
|
|
|
{ x: breakPoint.position.x + 1, y: breakPoint.position.y },
|
|
|
playerPosition,
|
|
|
);
|
|
|
- if (_angle < 0) {
|
|
|
- _angle += 360;
|
|
|
- }
|
|
|
|
|
|
let singleInfo = null;
|
|
|
for (let i = 0; i < surroundPointIds.length; ++i) {
|
|
@@ -885,19 +880,24 @@ export class MoveService implements OnModuleInit {
|
|
|
neighPoints.push(neighPoint);
|
|
|
++count;
|
|
|
} else if (Math.abs(angle - move_angle) == 0) {
|
|
|
- console.log(
|
|
|
- 'joystick直走--->' + breakPointId + '-' + surroundPointIds[i],
|
|
|
- );
|
|
|
- return await this.moveDirect(
|
|
|
- playerPosition,
|
|
|
- closestDis,
|
|
|
- breakPointId,
|
|
|
- surroundPointIds[i],
|
|
|
- appId,
|
|
|
- userId,
|
|
|
- traceId,
|
|
|
- actionType,
|
|
|
- );
|
|
|
+ count = 2
|
|
|
+ console.log('handlejoysticktesttest:刚好45°的倍数')
|
|
|
+ //debugger;
|
|
|
+ break;
|
|
|
+
|
|
|
+ // console.log(
|
|
|
+ // 'joystick直走--->' + breakPointId + '-' + surroundPointIds[i],
|
|
|
+ // );
|
|
|
+ // return await this.moveDirect(
|
|
|
+ // playerPosition,
|
|
|
+ // closestDis,
|
|
|
+ // breakPointId,
|
|
|
+ // surroundPointIds[i],
|
|
|
+ // appId,
|
|
|
+ // userId,
|
|
|
+ // traceId,
|
|
|
+ // actionType,
|
|
|
+ // );
|
|
|
}
|
|
|
|
|
|
//if (angle == 0 && Math.abs(360 - move_angle) < 45) {
|
|
@@ -928,9 +928,10 @@ export class MoveService implements OnModuleInit {
|
|
|
);
|
|
|
} else {
|
|
|
if (singleInfo != null) {
|
|
|
- console.log(
|
|
|
- 'joystick校验--->' + breakPointId + '-' + singleInfo.breakPointId,
|
|
|
- );
|
|
|
+ // console.log(
|
|
|
+ // 'joystick校验--->' + breakPointId + '-' + singleInfo.breakPointId,
|
|
|
+ // );
|
|
|
+ //console.log('handlejoysticktesttest校验0角度:'+_angle+','+move_angle)
|
|
|
return await this.moveDirect(
|
|
|
playerPosition,
|
|
|
closestDis,
|
|
@@ -985,6 +986,7 @@ export class MoveService implements OnModuleInit {
|
|
|
console.log(
|
|
|
'joystick镜头过渡--->' + breakPointId + '-' + chooseBreakPointId,
|
|
|
);
|
|
|
+ //this.reply.moveOver = true;
|
|
|
return await this.moveCamera(
|
|
|
breakPointId,
|
|
|
chooseBreakPointId,
|
|
@@ -1010,9 +1012,15 @@ export class MoveService implements OnModuleInit {
|
|
|
if (cameraInfo.mediaSrc) {
|
|
|
this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
}
|
|
|
- if (this.cameraInfos.length == 0) {
|
|
|
- this.reply.moveOver = true;
|
|
|
- }
|
|
|
+ // if (this.cameraInfos.length == 0) {
|
|
|
+ // this.reply.moveOver = true;
|
|
|
+ // }
|
|
|
+
|
|
|
+ user.camera.position = JSON.parse(
|
|
|
+ JSON.stringify(cameraInfo.camera_position),
|
|
|
+ );
|
|
|
+ user.camera.angle.yaw = cameraInfo.camera_angle.yaw;
|
|
|
+
|
|
|
this.sendingFrameForJoystick = true;
|
|
|
} else {
|
|
|
console.log('joystick自由--->不合并');
|
|
@@ -1045,7 +1053,10 @@ export class MoveService implements OnModuleInit {
|
|
|
breakPoint.position,
|
|
|
this.breakPointInfo[neighBreakPointId].position,
|
|
|
);
|
|
|
-
|
|
|
+ // console.log('handlejoysticktesttest校验1线段:'+breakPointId+','+neighBreakPointId)
|
|
|
+ // console.log('handlejoysticktesttest校验2计算后的:'+JSON.stringify(player_Position))
|
|
|
+ // console.log('handlejoysticktesttest校验3人物变化前:'+JSON.stringify(user.player.position))
|
|
|
+ // console.log('handlejoysticktesttest校验4人物本应该的坐标:'+JSON.stringify(playerPosition))
|
|
|
if (player_Position != null) {
|
|
|
playerPosition.x = player_Position.x;
|
|
|
playerPosition.y = player_Position.y;
|
|
@@ -1053,6 +1064,7 @@ export class MoveService implements OnModuleInit {
|
|
|
}
|
|
|
|
|
|
if (this.getDistance(playerPosition, breakPoint.position) > closestDis) {
|
|
|
+ //this.reply.moveOver = true;
|
|
|
return await this.moveCamera(
|
|
|
breakPointId,
|
|
|
neighBreakPointId,
|
|
@@ -1076,9 +1088,15 @@ export class MoveService implements OnModuleInit {
|
|
|
if (cameraInfo.mediaSrc) {
|
|
|
this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
}
|
|
|
- if (this.cameraInfos.length == 0) {
|
|
|
- this.reply.moveOver = true;
|
|
|
- }
|
|
|
+ // if (this.cameraInfos.length == 0) {
|
|
|
+ // this.reply.moveOver = true;
|
|
|
+ // }
|
|
|
+
|
|
|
+ user.camera.position = JSON.parse(
|
|
|
+ JSON.stringify(cameraInfo.camera_position),
|
|
|
+ );
|
|
|
+ user.camera.angle.yaw = cameraInfo.camera_angle.yaw;
|
|
|
+
|
|
|
this.sendingFrameForJoystick = true;
|
|
|
}
|
|
|
return this.reply;
|
|
@@ -1143,7 +1161,9 @@ export class MoveService implements OnModuleInit {
|
|
|
const moveFramesRes = await this.cacheService.get(key);
|
|
|
const moveFrames = JSON.parse(moveFramesRes);
|
|
|
this.setCameraInfo(appId,moveFrames,breakPointId,chooseBreakPointId);
|
|
|
- //user.breakPointId = chooseBreakPointId;
|
|
|
+
|
|
|
+ user.breakPointId = chooseBreakPointId;
|
|
|
+
|
|
|
const cameraInfo = this.getCameraInfo();
|
|
|
if (cameraInfo != null) {
|
|
|
this.reply['newUserStates'][0].playerState.camera.position =
|
|
@@ -1219,9 +1239,9 @@ export class MoveService implements OnModuleInit {
|
|
|
this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
}
|
|
|
|
|
|
- if(this.cameraInfos.length == 0){
|
|
|
- this.reply.moveOver = true;
|
|
|
- }
|
|
|
+ // if(this.cameraInfos.length == 0){
|
|
|
+ // this.reply.moveOver = true;
|
|
|
+ // }
|
|
|
this.sendingFrameForJoystick = true;
|
|
|
return this.reply;
|
|
|
}
|