|
@@ -45,6 +45,8 @@ export class MoveService implements OnModuleInit {
|
|
traceIds: [],
|
|
traceIds: [],
|
|
vehicle: null,
|
|
vehicle: null,
|
|
mediaSrc: null,
|
|
mediaSrc: null,
|
|
|
|
+ moveOver:false,
|
|
|
|
+ moveStart:false,
|
|
newUserStates: [
|
|
newUserStates: [
|
|
{
|
|
{
|
|
userId: 'dcff36ae4fc1d',
|
|
userId: 'dcff36ae4fc1d',
|
|
@@ -435,7 +437,7 @@ export class MoveService implements OnModuleInit {
|
|
updateUser(userId, breakPointId, lastReply) {
|
|
updateUser(userId, breakPointId, lastReply) {
|
|
const user = this.users[userId];
|
|
const user = this.users[userId];
|
|
user.breakPointId = breakPointId;
|
|
user.breakPointId = breakPointId;
|
|
-
|
|
|
|
|
|
+ console.log('handlejoystick:updateUser');
|
|
if (lastReply.actionResponses[0].actionType != 15) {
|
|
if (lastReply.actionResponses[0].actionType != 15) {
|
|
user.player.position =
|
|
user.player.position =
|
|
lastReply['newUserStates'][0].playerState.player.position;
|
|
lastReply['newUserStates'][0].playerState.player.position;
|
|
@@ -790,7 +792,6 @@ 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 step = 0.3;
|
|
const closestDis = 85; //小于这个距离就跳到邻居呼吸点
|
|
const closestDis = 85; //小于这个距离就跳到邻居呼吸点
|
|
const distance = step * dir_action.speed_level;
|
|
const distance = step * dir_action.speed_level;
|
|
@@ -1172,21 +1173,8 @@ export class MoveService implements OnModuleInit {
|
|
Math.floor(user.camera.angle.yaw / 45);
|
|
Math.floor(user.camera.angle.yaw / 45);
|
|
const moveFramesRes = await this.cacheService.get(key);
|
|
const moveFramesRes = await this.cacheService.get(key);
|
|
const moveFrames = JSON.parse(moveFramesRes);
|
|
const moveFrames = JSON.parse(moveFramesRes);
|
|
- this.setCameraInfo(moveFrames);
|
|
|
|
- // const pathReplys = this.createCacheReplys(
|
|
|
|
- // appId,
|
|
|
|
- // moveFrames,
|
|
|
|
- // traceId,
|
|
|
|
- // userId,
|
|
|
|
- // breakPointId,
|
|
|
|
- // chooseBreakPointId,
|
|
|
|
- // true,
|
|
|
|
- // );
|
|
|
|
- // for (let i = 0; i < pathReplys.length; ++i) {
|
|
|
|
- // pathReplys[i].actionResponses[0].actionType = actionType;
|
|
|
|
- // }
|
|
|
|
- // replys.push(pathReplys);
|
|
|
|
- user.breakPointId = chooseBreakPointId;
|
|
|
|
|
|
+ this.setCameraInfo(moveFrames,chooseBreakPointId);
|
|
|
|
+ //user.breakPointId = chooseBreakPointId;
|
|
const cameraInfo = this.getCameraInfo();
|
|
const cameraInfo = this.getCameraInfo();
|
|
if (cameraInfo != null) {
|
|
if (cameraInfo != null) {
|
|
this.reply['newUserStates'][0].playerState.camera.position =
|
|
this.reply['newUserStates'][0].playerState.camera.position =
|
|
@@ -1226,8 +1214,9 @@ export class MoveService implements OnModuleInit {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- setCameraInfo(moveFrames) {
|
|
|
|
|
|
+ setCameraInfo(moveFrames,endBreakPointId) {
|
|
for (let i = 0; i < moveFrames.length; i += 5) {
|
|
for (let i = 0; i < moveFrames.length; i += 5) {
|
|
|
|
+ moveFrames[i].endBreakPointId = endBreakPointId;
|
|
this.cameraInfos.push(moveFrames[i]);
|
|
this.cameraInfos.push(moveFrames[i]);
|
|
}
|
|
}
|
|
}
|
|
}
|