|
@@ -61,7 +61,7 @@ export default class ActionsHandler {
|
|
|
|
|
|
|
|
|
window.connection.socket.on("getRoute", (pathArr) => {
|
|
|
- console.error("getRoute", pathArr);
|
|
|
+ console.log("getRoute", pathArr);
|
|
|
|
|
|
if(!pathArr) return
|
|
|
|
|
@@ -76,9 +76,11 @@ export default class ActionsHandler {
|
|
|
const frameRate = 29 // fps
|
|
|
|
|
|
let walkPoints = []
|
|
|
- let walkFrames = []
|
|
|
+ let sumWalkFrame = 0
|
|
|
let videoArr = []
|
|
|
for(let i = 0; i < pathArr.length - 1; i++) {
|
|
|
+ // 目前视频返回帧数到159条会停止
|
|
|
+ if(sumWalkFrame + walkFrame > 159) break
|
|
|
|
|
|
let point0 = new BABYLON.Vector3(pathArr[i].location.x, pathArr[i].location.y, pathArr[i].location.z)
|
|
|
let point1 = new BABYLON.Vector3(pathArr[i+1].location.x, pathArr[i+1].location.y, pathArr[i+1].location.z)
|
|
@@ -92,19 +94,16 @@ export default class ActionsHandler {
|
|
|
path: ossVideoDir + pathArr[i].id + "/" + pathArr[i].id + "_" + pathArr[i+1].id + "_" + dircNum,
|
|
|
frame: walkFrame
|
|
|
})
|
|
|
- walkFrames.push(walkFrame)
|
|
|
+ sumWalkFrame += walkFrame
|
|
|
for(let currentFrame = 1; currentFrame <= walkFrame; currentFrame++) {
|
|
|
walkPoints.push(point0.add(dir.scale(distancePerFrame * 100 * currentFrame))) // 单位转换成cm
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- console.error(walkPoints)
|
|
|
+ console.log("[Walk]::path", walkPoints)
|
|
|
|
|
|
window.walkSettings = {
|
|
|
- "frameNum": walkFrames.reduce(function(prev, curr){
|
|
|
- // 计算总帧数
|
|
|
- return prev + curr;
|
|
|
- }),
|
|
|
+ "frameNum": sumWalkFrame,
|
|
|
"walkPoints": walkPoints,
|
|
|
}
|
|
|
|
|
@@ -236,7 +235,7 @@ export default class ActionsHandler {
|
|
|
let closestPoint = window.room.sceneManager.getClosestPointData(t)
|
|
|
let closestPointSelf = window.room.sceneManager.getClosestPointData(player.position)
|
|
|
|
|
|
- console.error(closestPointSelf.position0, closestPoint.position0)
|
|
|
+ console.log("[Walk]::from", closestPointSelf.position0, ":to", closestPoint.position0)
|
|
|
window.connection.socket.emit("getRoute", {
|
|
|
sceneCode: "testApp",
|
|
|
userId: "testUser",
|
|
@@ -661,7 +660,7 @@ export default class ActionsHandler {
|
|
|
}
|
|
|
|
|
|
mutiFetchData({type, videoDataArr}){
|
|
|
- console.error(videoDataArr)
|
|
|
+ console.log("[Walk]::videoData", videoDataArr)
|
|
|
if(window.workerReady){
|
|
|
// https://laser-data.oss-cn-shenzhen.aliyuncs.com/test-video/optest/0/0_1_0/
|
|
|
let sendData = []
|