diff --git a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js index 3cee45db3..07d59d8d7 100644 --- a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js +++ b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js @@ -1,51 +1,61 @@ import { Staticmodel } from '@/jlmap3d/jl3dpassflow/config.js'; +//静态资源文件路劲 import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js'; //loader import { FBXLoader } from '@/jlmap3d/main/loaders/FBXLoader'; +//轨道视角控制 import { OrbitControls } from '@/jlmap3d/main/control/OrbitControls'; +//模型管理器 import { ModelManager } from '@/jlmap3d/jl3dpassflow/loader.js'; +//骨骼动画模型辅助工具 import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js'; +//获取信息接口 import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; - +//cctv站台对象 import { PasserStation } from '@/jlmap3d/jl3dpassflow/model/passerstation.js'; +//cctv检票机对象 import { PasserCheckDoor } from '@/jlmap3d/jl3dpassflow/model/passercheckdoor.js'; +//cctv列车对象 import { PasserTrain } from '@/jlmap3d/jl3dpassflow/model/passertrain.js'; +//cctv行人对象 import { PasserHuman } from '@/jlmap3d/jl3dpassflow/model/passerhuman.js'; - +//cctv渲染器 import { PasserRender } from '@/jlmap3d/jl3dpassflow/passerrender/passerrender.js'; - +//cctv行人ai import { PasserAi } from '@/jlmap3d/jl3dpassflow/passerai/passerai.js'; - +//行人寻路相关工具 import { ZoneManager } from '@/jlmap3d/jl3dpassflow/model/zonemanager.js'; import { PathFinder } from '@/jlmap3d/jl3dpassflow/passerai/pathfinder.js'; - +//cctv通信工具 import { PassflowConnect } from '@/jlmap3d/jl3dpassflow/connect/passflowconnect.js'; + import StompClient from '@/utils/sock'; import store from '@/store/index_APP_TARGET'; // import { Loading } from 'element-ui'; import {Stats} from '@/jlmap3d/main/lib/stats.min.js'; - +//动画播放相关 let clock = new THREE.Clock(); let delta; + let scene,camerass,renderer; + let aiswitch = 0; - +//动画组 let mixers = []; - +//车站摄像机模型 let monitor; - +//寻路相关对象 let passerZone = new ZoneManager(); let pathFinder = new PathFinder(); let path; - +//设备动画action组 let deviceaction = []; - +//控制帧率的webworker线程 let passerWebWork = new Worker(JL3D_LOCAL_STATIC+"/workertest/passsimulation/station.js"); - //老版本临时ai控制 let olddataai = false; diff --git a/src/jlmap3d/jl3dpassflow/loader.js b/src/jlmap3d/jl3dpassflow/loader.js index b06796566..f1f58b5d5 100644 --- a/src/jlmap3d/jl3dpassflow/loader.js +++ b/src/jlmap3d/jl3dpassflow/loader.js @@ -1,5 +1,5 @@ import { BASE_ASSET_API } from '@/api/jlmap3d/assets3d.js'; - +//模型管理器 export function ModelManager(){ let scope = this; @@ -65,7 +65,7 @@ export function ModelManager(){ action:null }; - + //读取模型 this.loadpromise = function (data,mixers){ let initlist = []; for(let i=0,leni=data.length;i { @@ -108,18 +108,13 @@ export function ModelManager(){ } } - +//fbx模型加载 function fbxpromise(asset,mixers,model){ return new Promise(function(resolve, reject){ var loader = new THREE.FBXLoader(); loader.load( BASE_ASSET_API+asset.url, function ( object ) { - // let mixer = new THREE.AnimationMixer( object ); - // object.traverse( function ( child ) { - // if ( child.isMesh ) { - // child.castShadow = true; - // child.receiveShadow = true; - // } - // } ); + + //列车模型子物体重新排序 if(asset.type == "cctvTrain"){ // let mixer = new THREE.AnimationMixer( object ); let realtrain = new THREE.Group(); diff --git a/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js b/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js index f55ea858c..9f87578d3 100644 --- a/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js +++ b/src/jlmap3d/jl3dpassflow/model/passercheckdoor.js @@ -1,9 +1,10 @@ export function PasserCheckDoor(data) { var scope = this; - + //入口闸机组 this.zhajiin = []; + //出口闸机组 this.zhajiout = []; - + //定义闸机状态 for(let i=0;i<5;i++){ let zhaji = { id:"in0"+(i+1), @@ -12,7 +13,6 @@ export function PasserCheckDoor(data) { } scope.zhajiin.push(zhaji); } - for(let i=0;i<5;i++){ let zhaji = { id:"out0"+(i+1), @@ -21,6 +21,7 @@ export function PasserCheckDoor(data) { } scope.zhajiout.push(zhaji); } + //初始化闸机动画 this.initCheckDoorInAnimation = function(object,mixers ,deviceaction ,scene){ let mixer = new THREE.AnimationMixer( object ); let newclip = object.animations[ 0 ]; @@ -116,6 +117,7 @@ export function PasserCheckDoor(data) { scene.add(newzhaji); } + //初始化闸机动画 this.initCheckDoorOutAnimation = function(object,mixers ,deviceaction ,scene){ let mixer = new THREE.AnimationMixer( object ); let newclip = object.animations[ 0 ]; @@ -207,7 +209,7 @@ export function PasserCheckDoor(data) { } scene.add(newzhaji); } - + //闸机动画控制 this.checkDoorControl = function(type,door,deviceaction){ let devicenum = door; diff --git a/src/jlmap3d/jl3dpassflow/model/passerhuman.js b/src/jlmap3d/jl3dpassflow/model/passerhuman.js index ba3466a16..ee7369d80 100644 --- a/src/jlmap3d/jl3dpassflow/model/passerhuman.js +++ b/src/jlmap3d/jl3dpassflow/model/passerhuman.js @@ -1,12 +1,12 @@ export function PasserHuman() { let scope = this; - + //初始人物模型和动画 let originhuman1 = null; let originhuman2 = null; let originanima1 = null; let originanima2 = null; - + //初始化人物模型动画 this.initHumans = function(object1,object2,mixers,deviceaction,scene){ originhuman1 = object1; originhuman1.progress = 1; @@ -20,7 +20,7 @@ export function PasserHuman() { originhuman1.remove(originhuman1.children[2]); } - + //创建新的乘客 this.newHumanCreate = function(humanlist,position,stage,direct,door){ let mantype = Math.floor(Math.random()*(3-1+1))+1; let newhuman; @@ -63,7 +63,7 @@ export function PasserHuman() { humanlist.add(newhuman); // console.log(humanlist.children.length); } - + //定义新模型走路动画 this.initMoveAnimate = function(model,name,points,index){ model.status = 1; let curve = new THREE.CatmullRomCurve3(points); @@ -80,7 +80,7 @@ export function PasserHuman() { model.runrail = curve; model.speed = 0.2/curve.getLength(); } - + //更新人物列表中人物的动画 this.moveAnimateUpdate = function(humanlist,olddataai,passerHuman){ for(let i=0;i0.01){ - console.log(newsection.railpoint); closedSpline = new THREE.CatmullRomCurve3( [ new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z), new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[1].y,newsection.railpoint[1].z+0.001), @@ -110,9 +110,9 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){ ] ); }else{ closedSpline = new THREE.CatmullRomCurve3( [ - new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[0].y,newsection.railpoint[0].z), - new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[0].y,newsection.railpoint[1].z+0.001), - new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[0].y,newsection.railpoint[2].z) + new THREE.Vector3(newsection.railpoint[0].x,newsection.railpoint[2].y,newsection.railpoint[0].z), + new THREE.Vector3(newsection.railpoint[1].x,newsection.railpoint[2].y,newsection.railpoint[1].z+0.01), + new THREE.Vector3(newsection.railpoint[2].x,newsection.railpoint[2].y,newsection.railpoint[2].z) ] ); } @@ -123,18 +123,18 @@ this.loadpromise = function(sectionList,sectiondata,rails,scene,assetloader){ closedSpline.tension = 0.15; closedSpline.closed = false; var extrudeSettings = { - steps : 6, - curveSegments : 1, - bevelSegments : 1, - bevelEnabled : false, - extrudePath : closedSpline, + steps : 6, + curveSegments : 1, + bevelSegments : 1, + bevelEnabled : false, + extrudePath : closedSpline, }; var shape = new THREE.Shape(); len = closedSpline.getLength(); - if(Math.abs(newsection.railpoint[0].y - newsection.railpoint[2].y)>0.001){ + if(Math.abs(newsection.railpoint[0].y - newsection.railpoint[2].y)>0.01){ shape.moveTo( -2, 0 ); shape.lineTo( 2, 0 ); }else{ diff --git a/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue b/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue index a26b3d458..a4e92cc21 100644 --- a/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue +++ b/src/views/jlmap3d/jl3dassetmanager/component/modellist.vue @@ -152,17 +152,13 @@ export default { handleDelete(index, row) { console.log(row); - deleteAsset(row.modelurl).then(netdata => { - console.log(netdata); deleteAssetData(row.id).then(netdata => { this.tableData.splice(index, 1); console.log(netdata); }).catch(error => { console.log(error); }); - }).catch(error => { - console.log(error); - }); + } }