修改仿真渲染设置
This commit is contained in:
parent
675dc32516
commit
2a39905de3
@ -309,7 +309,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == false) {
|
||||
|
||||
if (rails.linkrail[data.body[i].linkCode]) {
|
||||
// console.log(trainlisttest.group);
|
||||
console.log(trainlisttest.group);
|
||||
if(trainlisttest.group.children.length<1){
|
||||
trainlisttest.group.add(trainlisttest.list[code]);
|
||||
}
|
||||
@ -421,41 +421,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
}
|
||||
}
|
||||
if (trainlisttest.list[code].status != data.body[i].directionType) {
|
||||
if (data.body[i].directionType == '02') { // 向右
|
||||
|
||||
trainlisttest.list[code].progress = 0;
|
||||
const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
|
||||
const rotaposz = trainlisttest.list[code].children[0].matrixWorld.elements[14];
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = rotaposz;
|
||||
}
|
||||
|
||||
trainlisttest.list[code].progress = (rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '02';
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineleft;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
|
||||
} else if (data.body[i].directionType == '03') { // 向左
|
||||
trainlisttest.list[code].progress = 0;
|
||||
const rotaposx = trainlisttest.list[code].children[5].matrixWorld.elements[12];
|
||||
const rotaposz = Math.abs(trainlisttest.list[code].children[0].matrixWorld.elements[14]);
|
||||
trainlisttest.list[code].rotation.y = Math.PI;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = -rotaposz;
|
||||
}
|
||||
trainlisttest.list[code].progress = 1-(rotaposx-rails.linkrail[data.body[i].linkCode].lp.x)/rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
trainlisttest.list[code].status = '03';
|
||||
trainlisttest.list[code].curve = rails.linkrail[data.body[i].linkCode].lineright;
|
||||
trainlisttest.list[code].nextcurve = null;
|
||||
|
||||
trainlisttest.list[code].len = rails.linkrail[data.body[i].linkCode].lengthfact;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,8 +90,8 @@ export function JLmap3d(dom, data,skinCode,storemod) {
|
||||
ModelLoad(data,scope,netdata.data,mapdata,camera,controls,scene,storemod);
|
||||
});
|
||||
//
|
||||
let stats = new Stats();
|
||||
dom.appendChild( stats.dom );
|
||||
// let stats = new Stats();
|
||||
// dom.appendChild( stats.dom );
|
||||
//开启渲染
|
||||
animate();
|
||||
startWorker();
|
||||
@ -108,7 +108,7 @@ export function JLmap3d(dom, data,skinCode,storemod) {
|
||||
//根据相机渲染场景
|
||||
renderer.render(scene,camera);
|
||||
//检测动画构造器播放动画
|
||||
stats.update();
|
||||
// stats.update();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user