|
@@ -435,9 +435,9 @@ export class MoveService implements OnModuleInit {
|
|
|
const user = this.users[userId];
|
|
|
user.breakPointId = breakPointId;
|
|
|
|
|
|
- if (lastReply.actionResponses[0].actionType != 15) {
|
|
|
- user.player.position =
|
|
|
- lastReply['newUserStates'][0].playerState.player.position;
|
|
|
+ if(lastReply.actionResponses[0].actionType != 15)
|
|
|
+ {
|
|
|
+ user.player.position = lastReply['newUserStates'][0].playerState.player.position;
|
|
|
}
|
|
|
user.player.angle = lastReply['newUserStates'][0].playerState.player.angle;
|
|
|
user.camera.position =
|
|
@@ -682,6 +682,7 @@ export class MoveService implements OnModuleInit {
|
|
|
// neighPoints.push(neighPoint);
|
|
|
// ++count;
|
|
|
// }
|
|
|
+
|
|
|
|
|
|
// if(Math.abs(angle - move_angle)<45||Math.abs(angle+360 - move_angle)<45){
|
|
|
// if(singleInfo == null){
|
|
@@ -699,7 +700,7 @@ export class MoveService implements OnModuleInit {
|
|
|
// this.reply['newUserStates'][0].playerState.player.position = JSON.parse(
|
|
|
// JSON.stringify(playerPosition),
|
|
|
// );
|
|
|
- // }
|
|
|
+ // }
|
|
|
// else{
|
|
|
// if(singleInfo != null){
|
|
|
// return await this.moveDirect(
|
|
@@ -827,6 +828,8 @@ export class MoveService implements OnModuleInit {
|
|
|
this.reply['actionResponses'][0].traceId = traceId;
|
|
|
this.reply.mediaSrc = null;
|
|
|
|
|
|
+ console.log('joystickjoystick:'+this.cameraInfos.length);
|
|
|
+
|
|
|
if (surroundPointIds.length == 1) {
|
|
|
console.log(
|
|
|
'joystick校验--->' + breakPointId + '-' + surroundPointIds[0],
|
|
@@ -995,10 +998,31 @@ export class MoveService implements OnModuleInit {
|
|
|
const cameraInfo = this.getCameraInfo();
|
|
|
if (cameraInfo != null) {
|
|
|
console.log('joystick自由--->合并');
|
|
|
- this.reply['newUserStates'][0].playerState.camera.position =
|
|
|
- cameraInfo.cameraPosition;
|
|
|
- this.reply['newUserStates'][0].playerState.camera.angle =
|
|
|
- cameraInfo.cameraAngle;
|
|
|
+ this.reply['newUserStates'][0].playerState.camera.position = cameraInfo.cameraPosition;
|
|
|
+ this.reply['newUserStates'][0].playerState.camera.angle = cameraInfo.cameraAngle;
|
|
|
+
|
|
|
+ if (cameraInfo.mediaSrc) {
|
|
|
+ this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
+ }
|
|
|
+ else if (cameraInfo.file_name) {
|
|
|
+ this.reply.mediaSrc =
|
|
|
+ '/' +
|
|
|
+ appId +
|
|
|
+ '/' +
|
|
|
+ breakPointId +
|
|
|
+ '/' +
|
|
|
+ cameraInfo.file_name.substring(
|
|
|
+ 0,
|
|
|
+ cameraInfo.file_name.indexOf('.'),
|
|
|
+ ) +
|
|
|
+ '/' +
|
|
|
+ cameraInfo.file_name +
|
|
|
+ '?m=' +
|
|
|
+ new Date().getTime();
|
|
|
+ }
|
|
|
+ if(this.cameraInfos.length == 0){
|
|
|
+ this.reply.moveOver = true;
|
|
|
+ }
|
|
|
} else {
|
|
|
console.log('joystick自由--->不合并');
|
|
|
}
|
|
@@ -1024,7 +1048,7 @@ export class MoveService implements OnModuleInit {
|
|
|
) {
|
|
|
const breakPoint = this.breakPointInfo[breakPointId];
|
|
|
const user = this.users[userId];
|
|
|
- const player_Position = this.getTarget(
|
|
|
+ let player_Position = this.getTarget(
|
|
|
playerPosition,
|
|
|
breakPoint.position,
|
|
|
this.breakPointInfo[neighBreakPointId].position,
|
|
@@ -1052,10 +1076,32 @@ export class MoveService implements OnModuleInit {
|
|
|
this.reply.actionResponses[0].actionType = actionType;
|
|
|
const cameraInfo = this.getCameraInfo();
|
|
|
if (cameraInfo != null) {
|
|
|
- this.reply['newUserStates'][0].playerState.camera.position =
|
|
|
- cameraInfo.camera_position;
|
|
|
- this.reply['newUserStates'][0].playerState.camera.angle =
|
|
|
- cameraInfo.camera_angle;
|
|
|
+ this.reply['newUserStates'][0].playerState.camera.position = cameraInfo.camera_position;
|
|
|
+ this.reply['newUserStates'][0].playerState.camera.angle = cameraInfo.camera_angle;
|
|
|
+
|
|
|
+ if (cameraInfo.mediaSrc) {
|
|
|
+ this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
+ }
|
|
|
+ else if (cameraInfo.file_name) {
|
|
|
+ this.reply.mediaSrc =
|
|
|
+ '/' +
|
|
|
+ appId +
|
|
|
+ '/' +
|
|
|
+ breakPointId +
|
|
|
+ '/' +
|
|
|
+ cameraInfo.file_name.substring(
|
|
|
+ 0,
|
|
|
+ cameraInfo.file_name.indexOf('.'),
|
|
|
+ ) +
|
|
|
+ '/' +
|
|
|
+ cameraInfo.file_name +
|
|
|
+ '?m=' +
|
|
|
+ new Date().getTime();
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.cameraInfos.length == 0){
|
|
|
+ this.reply.moveOver = true;
|
|
|
+ }
|
|
|
}
|
|
|
return this.reply;
|
|
|
}
|
|
@@ -1165,6 +1211,7 @@ export class MoveService implements OnModuleInit {
|
|
|
} else {
|
|
|
debugger;
|
|
|
}
|
|
|
+ this.reply.moveStart = true;
|
|
|
}
|
|
|
return this.reply;
|
|
|
// user.camera.position = JSON.parse(
|
|
@@ -1176,7 +1223,9 @@ export class MoveService implements OnModuleInit {
|
|
|
}
|
|
|
|
|
|
setCameraInfo(moveFrames) {
|
|
|
- this.cameraInfos = moveFrames;
|
|
|
+ for(let i=0;i<moveFrames.length;i += 5){
|
|
|
+ this.cameraInfos.push(moveFrames[i]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
addCameraInfo(cameraPosition, cameraAngle, mediaSrc) {
|