|
@@ -828,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],
|
|
@@ -996,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自由--->不合并');
|
|
|
}
|
|
@@ -1053,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;
|
|
|
}
|
|
@@ -1166,6 +1211,7 @@ export class MoveService implements OnModuleInit {
|
|
|
} else {
|
|
|
debugger;
|
|
|
}
|
|
|
+ this.reply.moveStart = true;
|
|
|
}
|
|
|
return this.reply;
|
|
|
// user.camera.position = JSON.parse(
|
|
@@ -1177,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) {
|