diff --git a/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js b/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js index 7b1d10be7..c4e021c74 100644 --- a/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js +++ b/src/jlmap3d/jl3dtrafficplan/jl3dtraffictrain.js @@ -112,7 +112,7 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) { camerass.position.z = -0.016; controls.target = new THREE.Vector3(camerass.position.x+0.5,camerass.position.y-0.1,camerass.position.z); controls.update(); - controls.enabled = false; + // controls.enabled = false; this.selectmodel = null; // let mouse = new THREE.Vector2(); @@ -140,17 +140,19 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) { passerTrain.toptrain.position.x = 0; passerTrain.toptrain.position.y = 0; passerTrain.toptrain.position.z = 0; + // passerTrain.downtrain.position.z = 40; getPublishMapDetail(skinCode).then(netdata => { scope.switchviews('freeview'); - passerHuman.initHumans(scope.modelmanager.man1.mesh,scope.modelmanager.man2.mesh); + passerHuman.init(scope.modelmanager.man1.mesh,scope.modelmanager.man2.mesh,scope.modelmanager.seat.mesh); scene.add(humanlist); socktest = new TrainConnect(scope,deviceaction,passerTrain.toptrain,routegroup,passerAi); - store.dispatch('app/animationsClose'); + let checkobject = setInterval(function(){ + store.dispatch('app/animationsClose'); clearInterval(checkobject); //进站控制 @@ -339,6 +341,7 @@ export function Jl3dTrafficTrain(dom,skinCode,routegroup,viewMap,initCode) { let trainDataList = getnum(scope.trainList[k].num,6); // nowTrunk.code = newCode; scope.nowTrunk.numList = trainDataList; + scope.trainList[k].text = k+"(现有乘客"+scope.trainList[k].num+"人)"; updateTrainNum(trainDataList); } // i = scope.trainList.length; diff --git a/src/jlmap3d/jl3dtrafficplan/loader/loader.js b/src/jlmap3d/jl3dtrafficplan/loader/loader.js index 1fe0a8933..8f655cb70 100644 --- a/src/jlmap3d/jl3dtrafficplan/loader/loader.js +++ b/src/jlmap3d/jl3dtrafficplan/loader/loader.js @@ -67,6 +67,14 @@ export function ModelManager(){ action:null }; + this.seat = { + code:null, + screenDoorOpenStatus:"01", + animations:null, + mesh:null, + action:null + }; + //读取模型 this.loadpromise = function (data,mixers,loadmode){ mode = loadmode; @@ -96,6 +104,9 @@ export function ModelManager(){ if(data[i].type == "cctvSection"){ initlist.push(fbxpromise(data[i],mixers,scope.section)); } + if(data[i].type == "seat"){ + initlist.push(fbxpromise(data[i],mixers,scope.seat)); + } } //promise按顺序加载 return new Promise(function(resolve, reject){ diff --git a/src/jlmap3d/jl3dtrafficplan/loader/trainconfig.js b/src/jlmap3d/jl3dtrafficplan/loader/trainconfig.js index e6a8c78c6..94f35ce62 100644 --- a/src/jlmap3d/jl3dtrafficplan/loader/trainconfig.js +++ b/src/jlmap3d/jl3dtrafficplan/loader/trainconfig.js @@ -5,14 +5,14 @@ var Staticmodel = [ name: "人物1", deviceType: "man1", type: "man1", - url: BASE_ASSET_API + "/MODEL/2020-07-16/1-9933.FBX" + url: BASE_ASSET_API + "/MODEL/2020-11-30/447-44484.fbx" }, { id: "2", name: "人物2", deviceType: "man2", type: "man2", - url: BASE_ASSET_API + "/MODEL/2020-07-16/2-87850.FBX" + url: BASE_ASSET_API + "/MODEL/2020-11-30/448-11525.fbx" }, { id: "7", @@ -21,6 +21,14 @@ var Staticmodel = [ type: "cctvTrain", url: BASE_ASSET_API + "/MODEL/2020-11-16/48-14909.FBX" }, + { + id: "8", + name: "seat", + deviceType: "seat", + type: "seat", + url: JL3D_LOCAL_STATIC + "/trafficplan/seatposition.FBX" + }, + ]; diff --git a/src/jlmap3d/jl3dtrafficplan/model/traintrunk/passertrunkhuman.js b/src/jlmap3d/jl3dtrafficplan/model/traintrunk/passertrunkhuman.js index f3445af7e..f73f631b1 100644 --- a/src/jlmap3d/jl3dtrafficplan/model/traintrunk/passertrunkhuman.js +++ b/src/jlmap3d/jl3dtrafficplan/model/traintrunk/passertrunkhuman.js @@ -4,7 +4,7 @@ export function PasserHuman() { let trunkManager = new PasserTrunkManager(); let waitGroup = new THREE.Group(); - this.nowTrunk = ""; + this.nowTrunk = 0+''; this.speed = "0"; @@ -14,7 +14,7 @@ export function PasserHuman() { let originanima1 = null; let originanima2 = null; //初始化人物模型动画 - this.initHumans = function(object1,object2,mixers,deviceaction,scene){ + this.init = function(object1,object2,seatmesh,mixers,deviceaction,scene){ originhuman1 = object1; originhuman1.progress = 1; // scene.add(originhuman1); @@ -22,38 +22,22 @@ export function PasserHuman() { let mixer1 = new THREE.AnimationMixer( originhuman1 ); let mixer2 = new THREE.AnimationMixer( originhuman2 ); - originanima1 = originhuman1.animations[ 0 ]; - originanima2 = originhuman2.animations[ 0 ]; + originanima1 = originhuman1.animations; + originanima2 = originhuman2.animations; originhuman1.remove(originhuman1.children[2]); for(let i=0;i<220;i++){ let newhuman; createHumanModel(newhuman,waitGroup,mixers,new THREE.Vector3(0,0,0)); } + + for(let i=0;i Math.round(Math.random()*(max-min))+min; this.getDoorRandomPos = function(trunkNum,direct){ @@ -108,15 +132,55 @@ export function PasserTrunkManager(data) { return newPos; } + + + this.getSeatRandomPos = function(index){ + + for(let i=0;i { alert(netdata); @@ -199,7 +200,8 @@ export default { }, init: function (code) { // let mapdata = this.$store.state.socket.device; - this.value = code; + this.nowCode = code; + this.value = this.nowCode; const dom = document.getElementById('jl3d'); this.jl3d = new Jl3dTrafficTrain(dom, this.$route.query.mapid, this.$route.query.group, 'normal',code); }, @@ -211,17 +213,7 @@ export default { updateValue(newcode){ this.value = newcode; }, - switchrender() { - if (this.renderswitch == true) { - this.rendermode = '退出监控'; - this.renderswitch = false; - this.jl3d.switchviews('freeview'); - } else { - this.rendermode = '监控视角'; - this.renderswitch = true; - this.jl3d.switchviews('4views'); - } - }, + // updateTrainCode(codeData){ // this.jl3d.updateNowTrainCode(codeData); // }, @@ -242,15 +234,13 @@ export default { }, updateTrainCode(selVal) { - // console.log(selVal); - // this.jl3d.changeTrain(selVal); - this.isActive=0; - this.jl3d.updateNowTrainCode(selVal); - this.jl3d.switchcamera(0+''); - - - // let oldgroupnum = this.groupnum; - // this.value = selVal; + // this.jl3d.changeTrain(selVal); + this.isActive=0; + this.jl3d.updateNowTrainCode(selVal); + this.jl3d.switchcamera(0+''); + this.value = selVal; + // let oldgroupnum = this.groupnum; + // this.value = selVal; }, updateTrainNum(dataList){ this.takelist = dataList; @@ -258,7 +248,7 @@ export default { for(let i = 0;i