|
@@ -26,7 +26,7 @@ export default class ActionsHandler {
|
|
//xst
|
|
//xst
|
|
window.workerReady = false
|
|
window.workerReady = false
|
|
this.vDecoder = new VDecoder({
|
|
this.vDecoder = new VDecoder({
|
|
- maxChip: 100,
|
|
|
|
|
|
+ maxChip: 10,
|
|
});
|
|
});
|
|
window.vDecoder = this.vDecoder
|
|
window.vDecoder = this.vDecoder
|
|
this.init()
|
|
this.init()
|
|
@@ -43,7 +43,7 @@ export default class ActionsHandler {
|
|
|
|
|
|
initSocket() {
|
|
initSocket() {
|
|
|
|
|
|
- const sdk = new SrsRTC();
|
|
|
|
|
|
+ // const sdk = new SrsRTC();
|
|
const testConfig = {
|
|
const testConfig = {
|
|
sceneCode: "testApp",
|
|
sceneCode: "testApp",
|
|
userId: "testUser",
|
|
userId: "testUser",
|
|
@@ -51,17 +51,17 @@ export default class ActionsHandler {
|
|
};
|
|
};
|
|
const connection = new Connection(testConfig);
|
|
const connection = new Connection(testConfig);
|
|
|
|
|
|
- console.log("sdk", sdk);
|
|
|
|
- console.log("sdk", connection);
|
|
|
|
- const url = "webrtc://demo-kms.4dage.com/live/test1";
|
|
|
|
- sdk.start(url);
|
|
|
|
|
|
+ // console.log("sdk", sdk);
|
|
|
|
+ // console.log("sdk", connection);
|
|
|
|
+ // const url = "webrtc://demo-kms.4dage.com/live/test1";
|
|
|
|
+ // sdk.start(url);
|
|
|
|
|
|
window.connection = connection
|
|
window.connection = connection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.connection.socket.on("getRoute", (pathArr) => {
|
|
window.connection.socket.on("getRoute", (pathArr) => {
|
|
- console.error("getRoute", pathArr);
|
|
|
|
|
|
+ console.log("getRoute", pathArr);
|
|
|
|
|
|
if(!pathArr) return
|
|
if(!pathArr) return
|
|
|
|
|
|
@@ -76,9 +76,11 @@ export default class ActionsHandler {
|
|
const frameRate = 29 // fps
|
|
const frameRate = 29 // fps
|
|
|
|
|
|
let walkPoints = []
|
|
let walkPoints = []
|
|
- let walkFrames = []
|
|
|
|
|
|
+ let sumWalkFrame = 0
|
|
let videoArr = []
|
|
let videoArr = []
|
|
for(let i = 0; i < pathArr.length - 1; i++) {
|
|
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 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)
|
|
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,
|
|
path: ossVideoDir + pathArr[i].id + "/" + pathArr[i].id + "_" + pathArr[i+1].id + "_" + dircNum,
|
|
frame: walkFrame
|
|
frame: walkFrame
|
|
})
|
|
})
|
|
- walkFrames.push(walkFrame)
|
|
|
|
|
|
+ sumWalkFrame += walkFrame
|
|
for(let currentFrame = 1; currentFrame <= walkFrame; currentFrame++) {
|
|
for(let currentFrame = 1; currentFrame <= walkFrame; currentFrame++) {
|
|
walkPoints.push(point0.add(dir.scale(distancePerFrame * 100 * currentFrame))) // 单位转换成cm
|
|
walkPoints.push(point0.add(dir.scale(distancePerFrame * 100 * currentFrame))) // 单位转换成cm
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- console.error(walkPoints)
|
|
|
|
|
|
+ console.log("[Walk]::path", walkPoints)
|
|
|
|
|
|
window.walkSettings = {
|
|
window.walkSettings = {
|
|
- "frameNum": walkFrames.reduce(function(prev, curr){
|
|
|
|
- // 计算总帧数
|
|
|
|
- return prev + curr;
|
|
|
|
- }),
|
|
|
|
|
|
+ "frameNum": sumWalkFrame,
|
|
"walkPoints": walkPoints,
|
|
"walkPoints": walkPoints,
|
|
}
|
|
}
|
|
|
|
|
|
@@ -236,7 +235,7 @@ export default class ActionsHandler {
|
|
let closestPoint = window.room.sceneManager.getClosestPointData(t)
|
|
let closestPoint = window.room.sceneManager.getClosestPointData(t)
|
|
let closestPointSelf = window.room.sceneManager.getClosestPointData(player.position)
|
|
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", {
|
|
window.connection.socket.emit("getRoute", {
|
|
sceneCode: "testApp",
|
|
sceneCode: "testApp",
|
|
userId: "testUser",
|
|
userId: "testUser",
|
|
@@ -661,7 +660,7 @@ export default class ActionsHandler {
|
|
}
|
|
}
|
|
|
|
|
|
mutiFetchData({type, videoDataArr}){
|
|
mutiFetchData({type, videoDataArr}){
|
|
- console.error(videoDataArr)
|
|
|
|
|
|
+ console.log("[Walk]::videoData", videoDataArr)
|
|
if(window.workerReady){
|
|
if(window.workerReady){
|
|
// https://laser-data.oss-cn-shenzhen.aliyuncs.com/test-video/optest/0/0_1_0/
|
|
// https://laser-data.oss-cn-shenzhen.aliyuncs.com/test-video/optest/0/0_1_0/
|
|
let sendData = []
|
|
let sendData = []
|