From 041528ebaa274d01e7d2a6eb41b1f17fd9bfef3f Mon Sep 17 00:00:00 2001 From: sunzhenyu Date: Mon, 1 Jun 2020 15:43:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BB=B4cctv?= =?UTF-8?q?=E4=B8=AD=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jlmap3d/jl3dpassflow/jl3dpassflownew.js | 98 +- src/jlmap3d/jl3dpassflow/model/zonemanager.js | 28 +- src/views/jlmap3d/passflow/jl3dpassflow.vue | 2 +- static/model/path/path.obj | 1973 +++++++++-------- 4 files changed, 1111 insertions(+), 990 deletions(-) diff --git a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js index 74de4cee8..754221b2b 100644 --- a/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js +++ b/src/jlmap3d/jl3dpassflow/jl3dpassflownew.js @@ -12,6 +12,8 @@ import { Pathfinding } from '@/jlmap3d/jl3dpassflow/utils/Pathfinding.js'; // const Pathfinding = window.threePathfinding.Pathfinding; import { ZoneManager } from '@/jlmap3d/jl3dpassflow/model/zonemanager.js'; +import { getPublishMapVersion, getPublishMapDetail,getPublish3dMapDetail} from '@/api/jlmap3d/load3ddata'; + import StompClient from '@/utils/sock'; import { Loading } from 'element-ui'; @@ -143,7 +145,7 @@ var views = [ ]; -export function Jl3dpassflow(dom) { +export function Jl3dpassflow(dom,skinCode) { var scope = this; this.dom = dom; @@ -235,6 +237,29 @@ export function Jl3dpassflow(dom) { let mouse = new THREE.Vector2(); let raycaster = new THREE.Raycaster(); + + getPublishMapDetail(skinCode).then(netdata => { + + // let assetsdata = JSON.parse(netdata.data.sections); + console.log(netdata); + // if(assetsdata.link){ + // scope.datatype = "old"; + // scope.jsonwebwork = new Worker("../../static/workertest/jsonworker.js"); + // scope.Subscribe = new Jlmap3dSubscribe(scope,routegroup,scope.jsonwebwork); + // scope.Subscribe.socketon(scope.Subscribe.topic); + // SimulationLoad(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); + // + // }else{ + // scope.datatype = "new"; + // scope.jsonwebworknew = new Worker("../../static/workertest/jsonworkernew.js"); + // scope.Subscribe = new Jlmap3dSubscribeNew(scope,routegroup,scope.jsonwebworknew); + // scope.Subscribe.socketon(scope.Subscribe.topic); + // SimulationLoadNew(mapnetdata,scope,netdata.data,mapdata,camera,controls,scenesimulation,storemod); + // } + + }); + + var loader = new THREE.OBJLoader(); // load a resource @@ -364,7 +389,7 @@ export function Jl3dpassflow(dom) { initzhajiinaimation(scope.modelmanager.zhajiin.mesh); initzhajioutanimation(scope.modelmanager.zhajiout.mesh); scene.add(scope.modelmanager.section.mesh); - scene.add(scope.modelmanager.train.mesh); + // scene.add(scope.modelmanager.train.mesh); level = scope.modelmanager.station.mesh; monitor = scope.modelmanager.monitor.mesh; @@ -511,13 +536,13 @@ export function Jl3dpassflow(dom) { if(humanlist.children[i].status == 0){ if(humanlist.children[i].stage == 0){ - - groupID = pathfinder.getGroup( ZONE, humanlist.children[i].position ); - targetPosition = stationzon.getzoneposition("security"); - path = pathfinder.findPath( humanlist.children[i].position, targetPosition, ZONE, groupID ); - let points = []; points.push(new THREE.Vector3(humanlist.children[i].position.x,humanlist.children[i].position.y,humanlist.children[i].position.z)); + + groupID = pathfinder.getGroup( ZONE, points[0] ); + targetPosition = stationzon.getzoneposition("security"); + path = pathfinder.findPath( points[0], targetPosition, ZONE, groupID ); + for(let i=0;i