xushiting 3 年之前
父節點
當前提交
29223b86e7

+ 20 - 0
src/main/java/com/fdkk/fdkkmeta/domain/po/MovePO.java

@@ -0,0 +1,20 @@
+package com.fdkk.fdkkmeta.domain.po;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.fdkk.fdkkmeta.grpc.ClickingAction;
+import com.fdkk.fdkkmeta.grpc.State;
+import lombok.Data;
+
+@Data
+public class MovePO {
+    private int action_type=1;
+    private ClickingAction clicking_action;
+    private State clicking_state;
+    private String trace_id;
+    private String user_id;
+    private JSONArray path;
+    private boolean isMoving = false;
+    private boolean isRotated = false;
+    private long currentFrameId = 0;
+}

+ 154 - 92
src/main/java/com/fdkk/fdkkmeta/grpcService/sceneGrpcServer.java

@@ -1,16 +1,14 @@
 package com.fdkk.fdkkmeta.grpcService;
 
 import cn.hutool.core.util.ArrayUtil;
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkk.fdkkmeta.config.MetaConfig;
 import com.fdkk.fdkkmeta.domain.dto.RouteDto;
 import com.fdkk.fdkkmeta.domain.entity.mysql.BreakpointsEntity;
 import com.fdkk.fdkkmeta.domain.entity.mysql.UserEntity;
-import com.fdkk.fdkkmeta.domain.po.AnglePO;
-import com.fdkk.fdkkmeta.domain.po.JoystickPO;
-import com.fdkk.fdkkmeta.domain.po.PointPO;
-import com.fdkk.fdkkmeta.domain.po.RotatePO;
+import com.fdkk.fdkkmeta.domain.po.*;
 import com.fdkk.fdkkmeta.grpc.*;
 import com.fdkk.fdkkmeta.redis.RedisCache;
 import com.fdkk.fdkkmeta.service.BreakpointsService;
@@ -320,100 +318,164 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
 			//builder.setCode(0);
     	}
     }
+	@Override
 	public void echo(EchoRequest request, StreamObserver<EchoReply> responseObserver){
 
-		int action_type = request.getActionType();
-		String trace_id = request.getTraceId();
-
-		EchoReply.Builder builder = EchoReply.newBuilder();
-		builder.setActionType(action_type);
-		builder.setPointType(100);
-		builder.setExtra("");
-		builder.setTraceId(trace_id);
-		builder.setPacketId("");
-		//builder.setNps(nps);
-		builder.setPeopleNum(0);
-		builder.setZoneId("");
-		builder.setEchoMsg("");
-		builder.setReserveDetail(null);
-		//builder.setUserWithAvatarList();
-		//builder.setNewUserStates();
-		builder.setCode(0);
-		builder.setMsg("");
-
-		responseObserver.onNext(builder.build());
-		responseObserver.onCompleted();
+		try{
+			int action_type = request.getActionType();
+			String trace_id = request.getTraceId();
+
+			EchoReply.Builder builder = EchoReply.newBuilder();
+			builder.setActionType(action_type);
+			builder.setPointType(100);
+			builder.setExtra("");
+			builder.setTraceId(trace_id);
+			builder.setPacketId("");
+			//builder.setNps(nps);
+			builder.setPeopleNum(0);
+			builder.setZoneId("");
+			builder.setEchoMsg("");
+			builder.setReserveDetail(null);
+			//builder.setUserWithAvatarList();
+			//builder.setNewUserStates();
+			builder.setCode(0);
+			builder.setMsg("");
+
+			responseObserver.onNext(builder.build());
+			responseObserver.onCompleted();
+		}
+		catch(Exception e) {
+			e.printStackTrace();
+		}
 	}
-	public void usersState(RotateRequest request, StreamObserver<GetNewUserStateReply> responseObserver){
-
-		int action_type = request.getActionType();
-		String trace_id = request.getTraceId();
-		String user_id = request.getUserId();
-
-		//从数据库中取全部在线的user表
-		List<UserEntity> list =  userService.findUserOnline(true);
-
-		GetNewUserStateReply.Builder builder = GetNewUserStateReply.newBuilder();
-		builder.setActionType(action_type);
-		builder.setPointType(100);
-		builder.setExtra("");
-		builder.setTraceId(trace_id);
-		builder.setPacketId("");
-		//builder.setNps(nps);
-		builder.setPeopleNum(0);
-		builder.setZoneId("");
-		builder.setEchoMsg("");
-		builder.setReserveDetail(null);
-		//builder.setUserWithAvatarList();
-		if(list.size()>0){
-			for(int i=0;i<list.size();++i){
-				UserEntity user = list.get(i);
-				JSONObject userInfo = new JSONObject();
-			    userInfo.put("roomTypeId","");
-				userInfo.put("person",0);
-				userInfo.put("avatarId",user.getAvatarId());
-				userInfo.put("skinId",user.getSkinId());
-				userInfo.put("roomId",user.getRoomId());
-				userInfo.put("isHost",false);
-				userInfo.put("isFollowHost",false);
-				userInfo.put("skinDataVersion",user.getSkinDataVersion());
-				userInfo.put("avatarComponents","");
-				userInfo.put("nickName",user.getNickName());
-				userInfo.put("movingMode",0);                                      //后续会修改
-				userInfo.put("attitude","walk");
-				userInfo.put("areaName","");
-				userInfo.put("pathName","");
-				userInfo.put("pathId","thirdwalk");
-				userInfo.put("avatarSize",1);
-				Extra extra = Extra.newBuilder().setRemoveWhenDisconnected(true).build();
-				userInfo.put("extra",extra);
-				userInfo.put("prioritySync",false);
-
-				Space.Builder player = Space.newBuilder();
-				PointPO playerPosition = user.getPlayerPosition();
-				Point playerPt = Point.newBuilder().setX(String.valueOf(playerPosition.getX())).setY(String.valueOf(playerPosition.getY())).setZ(String.valueOf(playerPosition.getZ())).build();
-				player.setPosition(playerPt);
-				AnglePO playerAngle = user.getPlayerAngle();
-				AngleUe4 playerAg =AngleUe4.newBuilder().setPitch(playerAngle.getPitch()).setYaw(playerAngle.getYaw()).setRoll(playerAngle.getRoll()).build();
-				player.setAngle(playerAg);
-				userInfo.put("player",player);
-				userInfo.put("camera",null);
-				userInfo.put("cameraCenter",null);
-
-				State playerState = sceneGrpcService.createPlayerState(userInfo);
-				RenderInfo renderInfo = sceneGrpcService.createRenderInfo();
-				Event event = sceneGrpcService.createEvent();
-
-				UserState userState = sceneGrpcService.createUserState( user.getUserId(), playerState, renderInfo, event);
-				builder.addNewUserStates(userState);
+	@Override
+	public void usersState(GetNewUserStateRequest request, StreamObserver<GetNewUserStateReply> responseObserver){
+
+		try{
+			int action_type = request.getActionType();
+			String trace_id = request.getTraceId();
+			String user_id = request.getUserId();
+
+			//从数据库中取全部在线的user表
+			List<UserEntity> list =  userService.findUserOnline(true);
+
+			GetNewUserStateReply.Builder builder = GetNewUserStateReply.newBuilder();
+			builder.setActionType(action_type);
+			builder.setPointType(100);
+			builder.setExtra("");
+			builder.setTraceId(trace_id);
+			builder.setPacketId("");
+			//builder.setNps(nps);
+			builder.setPeopleNum(0);
+			builder.setZoneId("");
+			builder.setEchoMsg("");
+			builder.setReserveDetail(null);
+			//builder.setUserWithAvatarList();
+			if(list.size()>0){
+				for(int i=0;i<list.size();++i){
+					UserEntity user = list.get(i);
+					JSONObject userInfo = new JSONObject();
+					userInfo.put("roomTypeId","");
+					userInfo.put("person",0);
+					userInfo.put("avatarId",user.getAvatarId());
+					userInfo.put("skinId",user.getSkinId());
+					userInfo.put("roomId",user.getRoomId());
+					userInfo.put("isHost",false);
+					userInfo.put("isFollowHost",false);
+					userInfo.put("skinDataVersion",user.getSkinDataVersion());
+					userInfo.put("avatarComponents","");
+					userInfo.put("nickName",user.getNickName());
+					userInfo.put("movingMode",0);                                      //后续会修改
+					userInfo.put("attitude","walk");
+					userInfo.put("areaName","");
+					userInfo.put("pathName","");
+					userInfo.put("pathId","thirdwalk");
+					userInfo.put("avatarSize",1);
+					Extra extra = Extra.newBuilder().setRemoveWhenDisconnected(true).build();
+					userInfo.put("extra",extra);
+					userInfo.put("prioritySync",false);
+
+					Space.Builder player = Space.newBuilder();
+					PointPO playerPosition = user.getPlayerPosition();
+					Point playerPt = Point.newBuilder().setX(String.valueOf(playerPosition.getX())).setY(String.valueOf(playerPosition.getY())).setZ(String.valueOf(playerPosition.getZ())).build();
+					player.setPosition(playerPt);
+					AnglePO playerAngle = user.getPlayerAngle();
+					AngleUe4 playerAg =AngleUe4.newBuilder().setPitch(playerAngle.getPitch()).setYaw(playerAngle.getYaw()).setRoll(playerAngle.getRoll()).build();
+					player.setAngle(playerAg);
+					userInfo.put("player",player);
+					userInfo.put("camera",null);
+					userInfo.put("cameraCenter",null);
+
+					State playerState = sceneGrpcService.createPlayerState(userInfo);
+					RenderInfo renderInfo = sceneGrpcService.createRenderInfo();
+					Event event = sceneGrpcService.createEvent();
+
+					UserState userState = sceneGrpcService.createUserState( user.getUserId(), playerState, renderInfo, event);
+					builder.addNewUserStates(userState);
+				}
 			}
+			//builder.setNewUserStates();
+			builder.setCode(0);
+			builder.setMsg("");
+
+			responseObserver.onNext(builder.build());
+			responseObserver.onCompleted();
+		}
+		catch (Exception e){
+			e.printStackTrace();
 		}
-										//builder.setNewUserStates();
-		builder.setCode(0);
-		builder.setMsg("");
+	}
+	@Override
+	public void move(MoveRequest request, StreamObserver<NormalReply> responseObserver){
+		try{
+			int action_type= request.getActionType();
+			ClickingAction clicking_action = request.getClickingAction();
+			State clicking_state = request.getClickingState();
+			String trace_id = request.getTraceId();
+			String user_id = request.getUserId();
+
+			UserEntity user = userService.findUserId(user_id);
+			String appId = user.getAppId();
+			//Long breakPointId = user.getBreakPointId();
+			//BreakpointsEntity breakpointsEntity = breakpointsService.findByAppIdAndBreakPointId(appId,breakPointId);
+			Point end = clicking_action.getClickingPoint();
+			//RotateFrameEntity rotateFrameEntity = rotateFrameService.findById(user.getFrameId());
+			//计算路径
+			RouteDto po=new RouteDto();
+			PointPO s= user.getPlayerPosition();
+			PointPO e=new PointPO();
+			e.setX(Double.parseDouble(end.getX()));
+			e.setY(Double.parseDouble(end.getY()));
+			e.setZ(Double.parseDouble(end.getZ()));
+			po.setE_location(e);
+			po.setS_location(s);
+			po.setSceneCode(appId);
+			JSONArray path = new JSONArray();
+
+			JSONArray maps = GetRoute.getRoute(metaConfig.getFreespacePath()+ File.separator +appId+"_target_freespace.json", po);
+			if (maps!=null&&maps.size()>=2){
+				Long nextbreakPointId = JSON.parseObject(JSONObject.toJSON(maps.get(1)).toString()).getLong("id");
+				path.add(nextbreakPointId);
+			}
 
-		responseObserver.onNext(builder.build());
-		responseObserver.onCompleted();
+			MovePO movePO = new MovePO();
+			movePO.setAction_type(action_type);
+			movePO.setClicking_action(clicking_action);
+			movePO.setClicking_state(clicking_state);
+			movePO.setTrace_id(trace_id);
+			movePO.setUser_id(user_id);
+			movePO.setPath(path);
+
+			redisCache.setCacheList("setCacheRequest:move:"+user_id, Arrays.asList(movePO));
+			NormalReply.Builder builder = NormalReply.newBuilder();
+			builder.setCode(1);
+			responseObserver.onNext(builder.build());
+			responseObserver.onCompleted();
+		}
+		catch (Exception e){
+			e.printStackTrace();
+			//builder.setCode(0);
+		}
 	}
 	/*
     //返回的是角度矫正数据

+ 229 - 3
src/main/java/com/fdkk/fdkkmeta/task/UpdateFrameMetaTask.java

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ArrayUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkk.fdkkmeta.domain.entity.mysql.BreakpointsEntity;
+import com.fdkk.fdkkmeta.domain.entity.mysql.MoveFrameEntity;
 import com.fdkk.fdkkmeta.domain.entity.mysql.RotateFrameEntity;
 import com.fdkk.fdkkmeta.domain.entity.mysql.UserEntity;
 import com.fdkk.fdkkmeta.domain.po.*;
@@ -11,13 +12,17 @@ import com.fdkk.fdkkmeta.grpc.*;
 import com.fdkk.fdkkmeta.grpcService.SceneGrpcService;
 import com.fdkk.fdkkmeta.redis.RedisCache;
 import com.fdkk.fdkkmeta.service.BreakpointsService;
+import com.fdkk.fdkkmeta.service.MoveFrameService;
 import com.fdkk.fdkkmeta.service.UserService;
 import com.fdkk.fdkkmeta.service.RotateFrameService;
+import com.fdkk.fdkkmeta.util.kesar.GetRoute;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import java.io.File;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -34,6 +39,8 @@ public class UpdateFrameMetaTask {
     @Autowired
     RotateFrameService rotateFrameService;
     @Autowired
+    MoveFrameService moveFrameService;
+    @Autowired
     SceneGrpcService sceneGrpcService;
     @Autowired
     BreakpointsService breakpointsService;
@@ -48,11 +55,74 @@ public class UpdateFrameMetaTask {
                userEntity -> {
                    //UserEntity user = redisCache.getCacheObject("setCacheRequest:" + userEntity.getUserId());
 //                   redisCache.set("updateFrameMetadata:"+userEntity.getUserId(),a.toJSONString());
+                   String userId = userEntity.getUserId();
+                   handle( userId);
                }
        );
 
    }
 
+   
+   private void handle(String userId){
+       List<MovePO> list = redisCache.getCacheList("setCacheRequest:move:"+userId);
+       if(list.size() == 0){
+           createMetaDataForRotate(userId);
+           createMetaDataForJoystick(userId);
+       }
+       else{
+           MovePO movePO = list.get(0);
+           UserEntity user = userService.findUserId(userId);
+           //true表示可以过渡了,false表示需要继续旋转
+           boolean flag = movePO.isRotated();
+           if(!flag){
+               boolean flag_rotated = rotateForMove( user, movePO);
+               if(flag_rotated) {
+                   //矫正完成
+                   movePO.setRotated(true);
+               }
+               //设置
+               /*********************************************************************************************/
+               //redisCache.setCacheList("setCacheRequest:move:"+userId, Arrays.asList(movePO));
+               return;
+           }
+           //可以过渡了
+           else {
+               flag = movePO.isMoving();
+               //打断
+               if(list.size()>1){
+                   //删除第一个元素
+                   /*********************************************************************************************/
+                   return;
+               }
+               //还没开始过渡,只是打算过渡
+               if(!flag) {
+                   flag = createMetaDataForRotate(userId);
+                   if(!flag){
+                       flag = createMetaDataForJoystick(userId);
+                   }
+                   if(!flag){
+                       //开始过渡
+                       movePO.setMoving(true);
+                       //过渡中
+                       /*********************************************************************************************/
+                   }
+                   //有旋转/操作的动作,所以打断了过渡
+                   else{
+                       //删除第一个元素
+                       /*********************************************************************************************/
+                       return;
+                   }
+               }
+               else{
+                   //开始过渡
+                   movePO.setMoving(true);
+                   //过渡中
+                   /*********************************************************************************************/
+               }
+           }
+       }
+   }
+
    private boolean createMetaDataForRotate(String userId){
        List<RotatePO> list = redisCache.getCacheList("setCacheRequest:rotate:"+userId);
        UserEntity user = userService.findUserId(userId);
@@ -82,6 +152,9 @@ public class UpdateFrameMetaTask {
            else{
                currentFrame = currentFrame % 359;
            }
+
+           setRotate( user, traceIds, actionResponses, currentFrame);
+           /*
            rotateFrameEntity = rotateFrameService.findByAppIdAndBreakPointIdAndFrameIndex(user.getAppId(),user.getBreakPointId(),currentFrame);
            PointPO playerPosition = user.getPlayerPosition();
            Point playerPt = Point.newBuilder().setX(String.valueOf(playerPosition.getX())).setY(String.valueOf(playerPosition.getY())).setZ(String.valueOf(playerPosition.getZ())).build();
@@ -113,15 +186,34 @@ public class UpdateFrameMetaTask {
            metaDataFramePO.setMsg("");
 
            redisCache.setCacheObject("updateFrameMetadata:"+userId,metaDataFramePO);
+           */
            //删除操作数据
-           //redisCache.delete("setCacheRequest:rotate:"+userId);
+           redisCache.delete("setCacheRequest:rotate:"+userId);
+           //更新user表
            return true;
        }
        return false;
    }
 
-    private void createMetaDataForMove(){
-
+    private boolean createMetaDataForMove(String userId){
+        List<MovePO> list = redisCache.getCacheList("setCacheRequest:move:"+userId);
+        if(list.size()>0){
+            MovePO movePO = list.get(list.size()-1);
+            UserEntity user = userService.findUserId(userId);
+            JSONArray path = movePO.getPath();
+            //true表示可以过渡了,false表示需要继续旋转
+            boolean flag = rotateForMove( user,movePO);
+            if(flag){
+                //打断
+                /*********************************************************************************************/
+                //开始过渡
+                movePO.setMoving(true);
+                //过渡中
+                /*********************************************************************************************/
+            }
+            return true;
+        }
+        return false;
     }
 
     private boolean createMetaDataForJoystick(String userId){
@@ -201,11 +293,145 @@ public class UpdateFrameMetaTask {
             }
 
             //开始过渡
+            //更新user表
+
+        }
+        return false;
+    }
+
+    private void setRotate(UserEntity user,String[] traceIds,JSONArray actionResponses,int currentFrame){
+        RotateFrameEntity rotateFrameEntity = rotateFrameService.findByAppIdAndBreakPointIdAndFrameIndex(user.getAppId(),user.getBreakPointId(),currentFrame);
+        PointPO playerPosition = user.getPlayerPosition();
+        Point playerPt = Point.newBuilder().setX(String.valueOf(playerPosition.getX())).setY(String.valueOf(playerPosition.getY())).setZ(String.valueOf(playerPosition.getZ())).build();
+        AnglePO playerAngle = user.getPlayerAngle();
+        AngleUe4 playerAg =AngleUe4.newBuilder().setPitch(playerAngle.getPitch()).setYaw(playerAngle.getYaw()).setRoll(playerAngle.getRoll()).build();
+        Space player = sceneGrpcService.createSpace(playerPt,playerAg);
 
+        PointPO cameraPoint = rotateFrameEntity.getCameraPosition();
+        Point cameraPosition = sceneGrpcService.createPoint(String.valueOf(cameraPoint.getX()),String.valueOf(cameraPoint.getY()),String.valueOf(cameraPoint.getZ()));
+        AnglePO cameraAnglePO = rotateFrameEntity.getCameraAngle();
+        AngleUe4 cameraAngle = sceneGrpcService.createAngle(cameraAnglePO.getPitch(),cameraAnglePO.getYaw(),cameraAnglePO.getRoll());
+        Space camera = sceneGrpcService.createSpace(cameraPosition,cameraAngle);
 
+        MetaDataFramePO metaDataFramePO = new MetaDataFramePO();
+        metaDataFramePO.setTraceIds(traceIds);
+        metaDataFramePO.setVehicle(null);
+        State playerState = sceneGrpcService.createPlayerState2(player,camera,playerPt);
+
+        RenderInfo renderInfo = sceneGrpcService.createRenderInfo();
+        UserState userState = sceneGrpcService.createUserState( user.getUserId(), playerState, renderInfo, null);
+
+        //newUserStates
+        JSONArray newUserStates = new JSONArray();
+        newUserStates.add(userState);
+        metaDataFramePO.setNewUserStates(newUserStates);
+        metaDataFramePO.setActionResponses(actionResponses);
+        metaDataFramePO.setGetStateType(0);
+        metaDataFramePO.setCode(0);
+        metaDataFramePO.setMsg("");
+
+        redisCache.setCacheObject("updateFrameMetadata:"+user.getUserId(),metaDataFramePO);
+    }
+
+    //过渡前先纠正角度,走第一段的时候才需要纠正
+    private boolean rotateForMove(UserEntity user,MovePO movePO){
+        String traceId = movePO.getTrace_id();
+        int actionType = movePO.getAction_type();
+        long startBreakPointId = user.getFrameId();
+        long endBreakPointId = movePO.getPath().getLong(0);
+        JSONObject result = new JSONObject();
+        JSONArray players = new JSONArray();
+        JSONArray cameras = new JSONArray();
+        JSONArray cameraCenters = new JSONArray();
+
+        BreakpointsEntity startBreakpointsEntity = breakpointsService.findByAppIdAndBreakPointId(user.getAppId(),startBreakPointId);
+        BreakpointsEntity endBreakpointsEntity = breakpointsService.findByAppIdAndBreakPointId(user.getAppId(),endBreakPointId);
+
+        PointPO startPosition = startBreakpointsEntity.getPosition();
+        PointPO endPosition = endBreakpointsEntity.getPosition();
+
+        PointPO temp = new PointPO();
+        temp.setX(startPosition.getX()+1);
+        temp.setY(startPosition.getY());
+        temp.setZ(startPosition.getZ());
+        int angle = (int)sceneGrpcService.calAngle(startPosition, temp, endPosition);
+        AnglePO anglePO = user.getPlayerAngle();
+        AngleUe4 playerAg =AngleUe4.newBuilder().setPitch(anglePO.getPitch()).setYaw(anglePO.getYaw()+angle).setRoll(anglePO.getRoll()).build();
+        PointPO playerPosition = user.getPlayerPosition();
+        Point playerPt = Point.newBuilder().setX(String.valueOf(playerPosition.getX())).setY(String.valueOf(playerPosition.getY())).setZ(String.valueOf(playerPosition.getZ())).build();
+        Space player = sceneGrpcService.createSpace(playerPt,playerAg);
+
+        //相机
+        RotateFrameEntity rotateFrameEntity = rotateFrameService.findById(user.getFrameId());
+        AnglePO cameraAnglePO = rotateFrameEntity.getCameraAngle();
+        angle = cameraAnglePO.getYaw();
+        int offAngle = 0;
+        offAngle = angle%45;
+        if(offAngle == 0){
+            return true;
+        }
+        int currentFrame = angle;
+        if(offAngle>45-offAngle) {
+            ++currentFrame;
+        }
+        else {
+            --currentFrame;
         }
+
+        String[] traceIds = new String[1];
+        traceIds[0] = traceId;
+        JSONArray actionResponses = new JSONArray();
+        JSONObject actionResponse = sceneGrpcService.createActionResponse(actionType,traceId);
+        actionResponses.add(actionResponse);
+
+        setRotate( user, traceIds, actionResponses, currentFrame);
         return false;
     }
+
+    //点对点开始移动
+     private JSONObject movePointToPoint(String userId,int angle,long startBreakPointId,long endBreakPointId){
+         JSONObject result = new JSONObject();
+         JSONArray players = new JSONArray();
+         JSONArray cameras = new JSONArray();
+         JSONArray cameraCenters = new JSONArray();
+
+         UserEntity user = userService.findUserId(userId);
+         List<MoveFrameEntity> list = moveFrameService.findByAppIAndStartBreakPointIdAndEndBreakPointIdAndAngle(user.getAppId(),startBreakPointId,endBreakPointId,angle);
+
+         BreakpointsEntity startBreakpointsEntity = breakpointsService.findByAppIdAndBreakPointId(user.getAppId(),startBreakPointId);
+         PointPO startPosition = startBreakpointsEntity.getPosition();
+
+         BreakpointsEntity endBreakpointsEntity = breakpointsService.findByAppIdAndBreakPointId(user.getAppId(),endBreakPointId);
+         PointPO endPosition = endBreakpointsEntity.getPosition();
+
+         for(int i=0;i<list.size();++i){
+             MoveFrameEntity moveFrameEntity = list.get(i);
+             //PointPO playerPosition = user.getPlayerPosition();
+             PointPO position = new PointPO();
+             position.setX(startPosition.getX()+(endPosition.getX()-startPosition.getX())/list.size()*i);
+             position.setY(startPosition.getY()+(endPosition.getY()-startPosition.getY())/list.size()*i);
+             position.setZ(startPosition.getZ()+(endPosition.getZ()-startPosition.getZ())/list.size()*i);
+
+             Point playerPt = Point.newBuilder().setX(String.valueOf(position.getX())).setY(String.valueOf(position.getY())).setZ(String.valueOf(position.getZ())).build();
+             AnglePO playerAngle = user.getPlayerAngle();
+             AngleUe4 playerAg =AngleUe4.newBuilder().setPitch(playerAngle.getPitch()).setYaw(playerAngle.getYaw()).setRoll(playerAngle.getRoll()).build();
+             Space player = sceneGrpcService.createSpace(playerPt,playerAg);
+             players.add(player);
+
+             PointPO cameraPoint = moveFrameEntity.getCameraPosition();
+             Point cameraPosition = sceneGrpcService.createPoint(String.valueOf(cameraPoint.getX()),String.valueOf(cameraPoint.getY()),String.valueOf(cameraPoint.getZ()));
+             AnglePO cameraAnglePO = moveFrameEntity.getCameraAngle();
+             AngleUe4 cameraAngle = sceneGrpcService.createAngle(cameraAnglePO.getPitch(),cameraAnglePO.getYaw(),cameraAnglePO.getRoll());
+             Space camera = sceneGrpcService.createSpace(cameraPosition,cameraAngle);
+             cameras.add(camera);
+
+             cameraCenters.add(playerPt);
+         }
+         result.put("players",players);
+         result.put("cameras",cameras);
+         result.put("cameraCenters",cameraCenters);
+         return result;
+    }
    /*
    * {
         "traceIds": ["d0864cd0-378d-4d49-b7b0-3e8e1b9494c3", "d0864cd0-378d-4d49-b7b0-3e8e1b9494c3", "939087ff-4999-4551-92e4-26ecb67f8aa2"],

+ 1 - 0
src/main/proto/scene.proto

@@ -10,6 +10,7 @@ service SceneGrpcService {
   rpc getRoute (RouteRequest) returns (RouteReply){}
   rpc init (InitRequest) returns (NormalReply){}
   rpc rotate (RotateRequest) returns (NormalReply){}
+  rpc move (MoveRequest) returns (NormalReply){}
 //  rpc moveStart (StartMoveRequest) returns (MoveReply){}
 //  rpc moveProcess (MoveNextNeighborRequest) returns (MoveReply){}
   rpc echo (EchoRequest) returns (EchoReply){}

+ 1 - 1
src/main/resources/application-dev.yml

@@ -10,7 +10,7 @@ socketio:
   upgradeTimeout: 1000000
   workCount: 100
 fdkk:
-  freespacePath: H:\workfile
+  freespacePath: F:\2022\minmap
   videoFramePath: /mnt/oss/metaverse/scene
 # 日志配置
 logging: