diff --git a/src/jlmap3d/jl3ddrive/jl3ddrive.js b/src/jlmap3d/jl3ddrive/jl3ddrive.js index 0fff2a9f2..cf301566e 100644 --- a/src/jlmap3d/jl3ddrive/jl3ddrive.js +++ b/src/jlmap3d/jl3ddrive/jl3ddrive.js @@ -57,7 +57,7 @@ export function JLmapDriving(dom, data, skinCode) { document.getElementById('jlsimulation').appendChild(renderer.domElement); document.getElementById('jlcctv').appendChild(renderercctv.domElement); // 定义相机 - let camera = SetCamera(dom); + //let camera = SetCamera(dom); // 定义场景(渲染容器) const scene = SetScene(); @@ -95,24 +95,22 @@ export function JLmapDriving(dom, data, skinCode) { // 地图模型数据 let mapdata = new Jl3ddata(); - const camera2 = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 1100 ); - camera2.name = 'camera2'; + let camera = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 1100); + camera.position.set( 0, 0, 0 ); + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); - const controls3 = new MouseControls(camera2, 1.6); + const controls3 = new MouseControls(camera, 1.6); controls3.enabled = true; scene.add(controls3.getObject()); - let cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 50); + let cameracctv = new THREE.PerspectiveCamera(70, dom.clientWidth/dom.clientHeight, 1, 150); cameracctv.position.set( 5, -3,27 ); - cameracctv.rotation.y = Math.PI/2; - camera2.add(cameracctv); + cameracctv.rotation.y = Math.PI/5*3; + camera.add(cameracctv); // 订阅仿真socket this.Subscribe = new Jl3dDriving(scope); - // 连接到通信 - // console.log(this.Subscribe.config); - - // this.webwork.postMessage(this.Subscribe.teststomp); this.Subscribe.socketon(scope.Subscribe.topic); @@ -137,7 +135,7 @@ export function JLmapDriving(dom, data, skinCode) { // 判断渲染是否开启 if (scope.animateswitch == true) { // 根据相机渲染场景 - renderer.render(scene, camera2); + renderer.render(scene, camera); renderercctv.render(scene,cameracctv); // updatcontrols(); // renderercctv diff --git a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js index e38ac90b7..592dd0722 100644 --- a/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js +++ b/src/jlmap3d/jl3ddrive/moveupdate/DrivingConnect.js @@ -213,47 +213,48 @@ export function Jl3dDriving(jlmap3d) { } trainlisttest.list[code].runMode = data.body[i].runMode; // 车门开关验证 - if (data.body[i].directionType == '02') { - if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = actions[code].top[an]._clip.duration; - actions[code].top[an].timeScale = -1; - actions[code].top[an].play(); - } - } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an=actions[code].top.length-1; an>=0; an--) { - actions[code].top[an].reset(); - actions[code].top[an].time = 0; - actions[code].top[an].timeScale = 1; - actions[code].top[an].play(); - } + if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { + // console.log("close"); + trainlisttest.list[code].doorStatus = '01'; + for (let an=actions[code].top.length-1; an>=0; an--) { + actions[code].top[an].reset(); + actions[code].top[an].time = actions[code].top[an]._clip.duration; + actions[code].top[an].timeScale = -1; + actions[code].top[an].play(); } - } else { - if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { - // console.log("close"); - trainlisttest.list[code].doorStatus = '01'; - for (let an=actions[code].down.length-1; an>=0; an--) { - actions[code].down[an].reset(); - actions[code].down[an].time = actions[code].top[an]._clip.duration; - actions[code].down[an].timeScale = -1; - actions[code].down[an].play(); - } - } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { - // console.log("open"); - trainlisttest.list[code].doorStatus = '02'; - for (let an=actions[code].down.length-1; an>=0; an--) { - actions[code].down[an].reset(); - actions[code].down[an].time = 0; - actions[code].down[an].timeScale = 1; - actions[code].down[an].play(); - } + } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { + // console.log("open"); + trainlisttest.list[code].doorStatus = '02'; + for (let an=actions[code].top.length-1; an>=0; an--) { + actions[code].top[an].reset(); + actions[code].top[an].time = 0; + actions[code].top[an].timeScale = 1; + actions[code].top[an].play(); } } + // if (data.body[i].directionType == '02') { + // + // } else { + // if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '01') { + // // console.log("close"); + // trainlisttest.list[code].doorStatus = '01'; + // for (let an=actions[code].down.length-1; an>=0; an--) { + // actions[code].down[an].reset(); + // actions[code].down[an].time = actions[code].top[an]._clip.duration; + // actions[code].down[an].timeScale = -1; + // actions[code].down[an].play(); + // } + // } else if (trainlisttest.list[code].doorStatus != data.body[i].doorStatus && data.body[i].doorStatus == '02') { + // // console.log("open"); + // trainlisttest.list[code].doorStatus = '02'; + // for (let an=actions[code].down.length-1; an>=0; an--) { + // actions[code].down[an].reset(); + // actions[code].down[an].time = 0; + // actions[code].down[an].timeScale = 1; + // actions[code].down[an].play(); + // } + // } + // } // 遍历获取所在轨道 if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 72be3b2f1..2e575c51e 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,8 +3,8 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; - BASE_API = 'http://192.168.3.5:9000'; // 袁琪 + BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 // BASE_API = 'http://192.168.3.4:9000' // 琰培 } else { diff --git a/static/model/suidao/suidao.FBX b/static/model/suidao/suidao.FBX index 77a5127d2..562e67b84 100644 Binary files a/static/model/suidao/suidao.FBX and b/static/model/suidao/suidao.FBX differ