测试站台停车坐标
This commit is contained in:
parent
523a2ac803
commit
8e11c76cd7
@ -148,9 +148,6 @@ export function Jlmap3ddata(mapid,scope){
|
||||
//console.log(data);
|
||||
return jlmap3ddata.linklist.loadpromise(loaderdata.link,scene,assetloader);
|
||||
})
|
||||
.then(function(data){
|
||||
return jlmap3ddata.sectionlist.sectionpromise(loaderdata.link,mapdata.linkList,mapdata.sectionList,switchdata,scene);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return jlmap3ddata.sectionlist.loadpromise(jlmap3ddata,assetloader,loaderdata.section,switchdata,scene);
|
||||
@ -163,6 +160,9 @@ export function Jlmap3ddata(mapid,scope){
|
||||
//console.log(data);
|
||||
return jlmap3ddata.stationstandlist.initpromise(jlmap3ddata,mapdata.stationList,mapdata.stationStandList,scene,assetloader,standsdata);
|
||||
})
|
||||
.then(function(data){
|
||||
return jlmap3ddata.sectionlist.sectionpromise(loaderdata.link,mapdata.linkList,mapdata.sectionList,switchdata,standsdata,scene);
|
||||
})
|
||||
.then(function(data){
|
||||
//console.log(data);
|
||||
return jlmap3ddata.trainlisttest.initpromise(mapdata.trainList,scene,assetloader,"0");
|
||||
|
@ -196,10 +196,11 @@ export function SectionList() {
|
||||
|
||||
}
|
||||
|
||||
this.sectionpromise = function(linkdata,linklist,sectiondata,switchdata,scene){
|
||||
this.sectionpromise = function(linkdata,linklist,sectiondata,switchdata,standsdata,scene){
|
||||
// console.log(linkdata);
|
||||
// console.log(linklist);
|
||||
// console.log(sectiondata);
|
||||
console.log(standsdata);
|
||||
return new Promise(function(resolve, reject){
|
||||
let linkrail = [];
|
||||
let switchrail = [];
|
||||
@ -274,8 +275,8 @@ export function SectionList() {
|
||||
let switchpoint = switchrail[linkrail[linkdata[i].code].lswitch].position;
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+4.5,0,switchpoint.z-0.05));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z-0.01));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+3.5,0,switchpoint.z-0.05));
|
||||
}
|
||||
|
||||
linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12));
|
||||
@ -285,8 +286,8 @@ export function SectionList() {
|
||||
|
||||
if(linkrail[linkdata[i].code].rswitch){
|
||||
let switchpoint = switchrail[linkrail[linkdata[i].code].rswitch].position;
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-4.5,0,switchpoint.z+0.05));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-3.5,0,switchpoint.z+0.05));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z+0.01));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
}
|
||||
@ -301,8 +302,8 @@ export function SectionList() {
|
||||
let switchpoint = switchrail[linkrail[linkdata[i].code].lswitch].position;
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+1.5,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+4.5,0,switchpoint.z+0.05));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+2,0,switchpoint.z+0.01));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x+3.5,0,switchpoint.z+0.05));
|
||||
}
|
||||
|
||||
linkrail[linkdata[i].code].points.push(testline.getPointAt(0.12));
|
||||
@ -312,8 +313,8 @@ export function SectionList() {
|
||||
|
||||
if(linkrail[linkdata[i].code].rswitch){
|
||||
let switchpoint = switchrail[linkrail[linkdata[i].code].rswitch].position;
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-4.5,0,switchpoint.z-0.05));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-3.5,0,switchpoint.z-0.05));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-2,0,switchpoint.z-0.01));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x-1.5,0,switchpoint.z));
|
||||
linkrail[linkdata[i].code].points.push(new THREE.Vector3(switchpoint.x,0,switchpoint.z));
|
||||
}
|
||||
@ -376,6 +377,7 @@ export function SectionList() {
|
||||
|
||||
let progress1 = standsections[i].leftStopPointOffset/linklist[j].lengthFact;
|
||||
let progress2 = standsections[i].rightStopPointOffset/linklist[j].lengthFact;
|
||||
|
||||
let point1 = linkrail[linklist[j].code].lineleft.getPointAt(progress1);
|
||||
|
||||
var geometry = new THREE.CircleGeometry( 3, 16 );
|
||||
@ -394,14 +396,16 @@ export function SectionList() {
|
||||
circle2.position.z = point2.z;
|
||||
circle2.rotation.x = -Math.PI/2;
|
||||
scene.add( circle2 );
|
||||
console.log(progress1);
|
||||
console.log(progress2);
|
||||
console.log(standsections[i].leftStopPointOffset);
|
||||
console.log(standsections[i].rightStopPointOffset);
|
||||
console.log(linkrail[linklist[j].code].lineleft.points);
|
||||
console.log(linklist[j].lengthFact);
|
||||
console.log(linkrail[linklist[j].code].lineleft.points);
|
||||
console.log(point1);
|
||||
console.log(point2);
|
||||
console.log("====================================");
|
||||
|
||||
|
||||
j = lenj;
|
||||
|
||||
|
||||
|
@ -225,11 +225,11 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
for (let i=data.body.length-1; i>=0; i--) {
|
||||
// 遍历列车对象组
|
||||
if (trainlisttest) {
|
||||
console.log(data.body[i]);
|
||||
code = data.body[i].code;
|
||||
// 剔除不显示的车
|
||||
// 找到对应列车
|
||||
|
||||
if ( trainlisttest.list[code]) {
|
||||
if (code == drivingcode) {
|
||||
driverswitch = data.body[i].runMode;
|
||||
//更新车组号
|
||||
@ -551,7 +551,7 @@ export function Jl3dDriving(updatemmi,sound,translation) {
|
||||
// console.log("==========================================");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user