|
|
|
@ -27,8 +27,8 @@ var typeObj = [{ ft: 0, type: 0, code: 'ft', name: '扶梯' }, { upft: 1, type: |
|
|
|
{ mzjd: 115, type: 115, code: 'mzjd', name: '门诊综合接待室' }, { hd: 116, type: 116, code: 'hd', name: '活动点' }, { bsl: 117, type: 117, code: 'bsl', name: '白石龙' }]; |
|
|
|
|
|
|
|
QMUtil = function () { |
|
|
|
this.shopServerInfo = "static/offline/JSON/QueryShopList.json"; |
|
|
|
this.mapServerInfo = "static/offline/JSON/GetMapInfo.json"; |
|
|
|
this.shopServerInfo = "static/offline/JSON/getMapInfo.json"; |
|
|
|
this.mapServerInfo = "static/offline/JSON/getMap.json"; |
|
|
|
this.beforPath = "./"; |
|
|
|
this.options = { |
|
|
|
playSpeed: 6, //动画播放速度
|
|
|
|
@ -97,38 +97,48 @@ QMUtil = function () { |
|
|
|
*/ |
|
|
|
this.modelArr = []; |
|
|
|
this.modelStr = [ //种树
|
|
|
|
{ 'key': 'tree', 'url': 'static/img/model/tree.gltf', 'colorModel': 'line', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 1, 'y': 1, 'z': 1 } }, |
|
|
|
{ 'key': 'tree2', 'url': 'static/img/model/tree2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'huatan1', 'url': 'static/img/model/huatan1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'huatan2', 'url': 'static/img/model/huatan2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'penquan2', 'url': 'static/img/model/penquan2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche1', 'url': 'static/img/model/qiche1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche2', 'url': 'static/img/model/qiche2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche3', 'url': 'static/img/model/qiche3.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche4', 'url': 'static/img/model/qiche4.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche5', 'url': 'static/img/model/qiche5.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche6', 'url': 'static/img/model/qiche6.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche7', 'url': 'static/img/model/qiche7.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche8', 'url': 'static/img/model/qiche8.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'qiche9', 'url': 'static/img/model/qiche9.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
|
|
|
|
{ 'key': 'chongdianzhuang', 'url': 'static/img/model/chongdianzhuang.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'IDS_H', 'url': 'static/img/model/IDS_H.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'IDS_V', 'url': 'static/img/model/IDS_V.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'xiaofangshuan', 'url': 'static/img/model/xiaofangshuan.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'tingchechang', 'url': 'static/img/model/tingchechang.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'chechanglangan', 'url': 'static/img/model/chechanglangan.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'bangongyi', 'url': 'static/img/model/bangongyi.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'lvzhi', 'url': 'static/img/model/lvzhi.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'ren1', 'url': 'static/img/model/ren1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'ren2', 'url': 'static/img/model/ren2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'ren3', 'url': 'static/img/model/ren3.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'ren4', 'url': 'static/img/model/ren4.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'ren5', 'url': 'static/img/model/ren5.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'ren6', 'url': 'static/img/model/ren6.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'yizi1', 'url': 'static/img/model/yizi1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } }, |
|
|
|
{ 'key': 'gjz1', 'url': 'static/img/model/gjz1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 } } |
|
|
|
]; |
|
|
|
{ 'key': 'tree', 'url': 'static/img/model/tree.gltf', 'colorModel': 'line', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 1, 'y': 1, 'z': 1 }, 'load':false}, |
|
|
|
{ 'key': 'tree2', 'url': 'static/img/model/tree2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'huatan1', 'url': 'static/img/model/huatan1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'huatan2', 'url': 'static/img/model/huatan2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'penquan2', 'url': 'static/img/model/penquan2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche1', 'url': 'static/img/model/qiche1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche2', 'url': 'static/img/model/qiche2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche3', 'url': 'static/img/model/qiche3.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche4', 'url': 'static/img/model/qiche4.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche5', 'url': 'static/img/model/qiche5.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche6', 'url': 'static/img/model/qiche6.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche7', 'url': 'static/img/model/qiche7.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche8', 'url': 'static/img/model/qiche8.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'qiche9', 'url': 'static/img/model/qiche9.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
|
|
|
|
{ 'key': 'jt_up', 'url': 'static/img/model/jt_up.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'jt_left', 'url': 'static/img/model/jt_left.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'jt_left_up', 'url': 'static/img/model/jt_left_up.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'jt_right', 'url': 'static/img/model/jt_right.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'jt_right_up', 'url': 'static/img/model/jt_right_up.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'jt_turn', 'url': 'static/img/model/jt_turn.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'ludeng', 'url': 'static/img/model/ludeng.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'taiyangsan', 'url': 'static/img/model/taiyangsan.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'honglvdeng', 'url': 'static/img/model/honglvdeng.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
|
|
|
|
{ 'key': 'chongdianzhuang', 'url': 'static/img/model/chongdianzhuang.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'IDS_H', 'url': 'static/img/model/IDS_H.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'IDS_V', 'url': 'static/img/model/IDS_V.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'xiaofangshuan', 'url': 'static/img/model/xiaofangshuan.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'tingchechang', 'url': 'static/img/model/tingchechang.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'chechanglangan', 'url': 'static/img/model/chechanglangan.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'bangongyi', 'url': 'static/img/model/bangongyi.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'lvzhi', 'url': 'static/img/model/lvzhi.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'ren1', 'url': 'static/img/model/ren1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'ren2', 'url': 'static/img/model/ren2.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'ren3', 'url': 'static/img/model/ren3.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'ren4', 'url': 'static/img/model/ren4.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'ren5', 'url': 'static/img/model/ren5.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'ren6', 'url': 'static/img/model/ren6.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'yizi1', 'url': 'static/img/model/yizi1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false}, |
|
|
|
{ 'key': 'gjz1', 'url': 'static/img/model/gjz1.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 20, 'y': 20, 'z': 20 }, 'load':false} |
|
|
|
]; |
|
|
|
this.fbxModels = []; //精灵模型
|
|
|
|
/** |
|
|
|
* 模型弹窗 |
|
|
|
@ -194,7 +204,26 @@ QMUtil = function () { |
|
|
|
this.leftPoint; //左侧平行线交点
|
|
|
|
this.rightPoint; //右侧平行线交点
|
|
|
|
} |
|
|
|
|
|
|
|
this.assignUVs = function (geometry) { |
|
|
|
geometry.computeBoundingBox(); |
|
|
|
var max = geometry.boundingBox.max, |
|
|
|
min = geometry.boundingBox.min; |
|
|
|
var offset = new THREE.Vector2(0 - min.x, 0 - min.y); |
|
|
|
var range = new THREE.Vector2(max.x - min.x, max.y - min.y); |
|
|
|
var faces = geometry.faces; |
|
|
|
geometry.faceVertexUvs[0] = []; |
|
|
|
for (var i = 0; i < faces.length ; i++) { |
|
|
|
var v1 = geometry.vertices[faces[i].a], |
|
|
|
v2 = geometry.vertices[faces[i].b], |
|
|
|
v3 = geometry.vertices[faces[i].c]; |
|
|
|
geometry.faceVertexUvs[0].push([ |
|
|
|
new THREE.Vector2((v1.x + offset.x) / range.x, (v1.y + offset.y) / range.y), |
|
|
|
new THREE.Vector2((v2.x + offset.x) / range.x, (v2.y + offset.y) / range.y), |
|
|
|
new THREE.Vector2((v3.x + offset.x) / range.x, (v3.y + offset.y) / range.y) |
|
|
|
]); |
|
|
|
} |
|
|
|
geometry.uvsNeedUpdate = true; |
|
|
|
} |
|
|
|
/** |
|
|
|
* 检测点是否在多边形区域内 |
|
|
|
*/ |
|
|
|
@ -401,12 +430,13 @@ QMUtil = function () { |
|
|
|
* 传入A中心点和A的宽、高 |
|
|
|
* B的中心点和B的宽、高 |
|
|
|
*/ |
|
|
|
this.isCollision = function (A, aW, aH, B, bW, bH) { |
|
|
|
let noCol = false; |
|
|
|
if (Math.abs(A.x - B.x) < (aW + bW) / 2 + 20 && Math.abs(A.y - B.y) < (aH + bH) / 2 + 10) { |
|
|
|
noCol = true; |
|
|
|
} |
|
|
|
return noCol; |
|
|
|
this.isCollision = function (A, B) { |
|
|
|
return ( |
|
|
|
A.x < B.x + B.width && |
|
|
|
A.x + A.width > B.x && |
|
|
|
A.y < B.y + B.height && |
|
|
|
A.y + A.height > B.y |
|
|
|
); |
|
|
|
} |
|
|
|
this.changeParkToString = function (area) { |
|
|
|
let areaArr = []; |
|
|
|
@ -679,7 +709,7 @@ QMUtil = function () { |
|
|
|
this.getPointArr = function (s1, s3, s4, s2, sp = 0.01) { |
|
|
|
let pArr = []; |
|
|
|
let sz = [s1, s3, s4, s2]; |
|
|
|
let p = Map_QM.util.P_BEZ(0, sz); |
|
|
|
let p; |
|
|
|
for (let j = 0; j < 1; j += sp) { |
|
|
|
p = Map_QM.util.P_BEZ(j, sz); |
|
|
|
pArr.push(p); |
|
|
|
@ -782,7 +812,6 @@ QMUtil = function () { |
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
this.getWallPoints = function (points, wallWidth) { |
|
|
|
if (points.length < 2) { |
|
|
|
//console.log("getWallPoints", "points size is letter than 2");
|
|
|
|
return new Array(); |
|
|
|
} |
|
|
|
//构建线段列表
|
|
|
|
@ -866,7 +895,7 @@ QMUtil = function () { |
|
|
|
} else { |
|
|
|
//不是横线时 根据斜率计算点位
|
|
|
|
x = point.x + 5; |
|
|
|
y = parseInt(gradient * (x - point.x) + point.y); |
|
|
|
y = gradient * (x - point.x) + point.y; |
|
|
|
} |
|
|
|
|
|
|
|
return Map_QM.util.pointXY(point, new Map_QM.util.Point(x, y), wallWidth / 2); |
|
|
|
@ -889,8 +918,8 @@ QMUtil = function () { |
|
|
|
let x1 = (-B + Math.sqrt(Math.pow(B, 2) - 4 * A * C)) / (2 * A); |
|
|
|
let x2 = (-B - Math.sqrt(Math.pow(B, 2) - 4 * A * C)) / (2 * A); |
|
|
|
|
|
|
|
result.push(new Map_QM.util.Point(parseInt(x1), parseInt(k * x1 + b))); |
|
|
|
result.push(new Map_QM.util.Point(parseInt(x2), parseInt(k * x2 + b))); |
|
|
|
result.push(new Map_QM.util.Point(x1, k * x1 + b)); |
|
|
|
result.push(new Map_QM.util.Point(x2, k * x2 + b)); |
|
|
|
return result; |
|
|
|
} |
|
|
|
//计算两条直线的相交点
|
|
|
|
@ -1359,7 +1388,7 @@ MainMap_QM.prototype = { |
|
|
|
|
|
|
|
_space.util.readTextFile(_space.util.beforPath + _space.util.shopServerInfo, function (res) { |
|
|
|
console.log(res) |
|
|
|
_space.util.shopData = res.data; |
|
|
|
_space.util.shopData = res.data.shopList; |
|
|
|
let backObj = { "code": 200, msg: "加载成功", "data": [] }; |
|
|
|
if (_space.util.shopData && Array.isArray(_space.util.shopData)) { |
|
|
|
_space.util.shopData.sort(_space.util.sortShopByFloor); |
|
|
|
@ -1461,7 +1490,6 @@ MainMap_QM.prototype = { |
|
|
|
for (let i = 0; i < _this.util.initModelArr.length; i++) { |
|
|
|
let loader = new THREE.GLTFLoader(); |
|
|
|
loader.load(_this.util.beforPath + _this.util.initModelArr[i].url, function (collada) { |
|
|
|
console.log(); |
|
|
|
collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = _this.util.initModelArr[i].scale; |
|
|
|
collada.scene.position.set(_this.util.initModelArr[i].site.x, _this.util.initModelArr[i].site.y, _this.util.initModelArr[i].site.z); |
|
|
|
collada.scene.rotation.set(_this.util.initModelArr[i].rot.x * Math.PI / 180, _this.util.initModelArr[i].rot.y * Math.PI / 180, _this.util.initModelArr[i].rot.z * Math.PI / 180); |
|
|
|
@ -1648,7 +1676,7 @@ MainMap_QM.prototype = { |
|
|
|
this.initGuide(); |
|
|
|
this.controls.target.set(this.util.guiOptions.targatX, this.util.guiOptions.targatY, this.util.guiOptions.targatZ); |
|
|
|
let pathData = this.util.allMap[parseInt(this.util.deviceObj.build)].buildArr[parseInt(this.util.deviceObj.floor)].mapData.path; |
|
|
|
pathData.nodes.sort(this.util.sortNode); |
|
|
|
pathData && pathData.nodes.sort(this.util.sortNode); |
|
|
|
if (parseInt(this.util.deviceObj.node) != -1) { |
|
|
|
if (pathData && pathData.nodes.length > parseInt(this.util.deviceObj.node)) { |
|
|
|
this.util.deviceObj.xaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].x; |
|
|
|
@ -1680,32 +1708,32 @@ MainMap_QM.prototype = { |
|
|
|
let ftPathObj = JSON.parse(jcStr); |
|
|
|
let dtPathObj = JSON.parse(jcStr); |
|
|
|
try { |
|
|
|
for (let j = 0; j < Map_QM.util.pathStateObj.facAllArr.length; j++) { |
|
|
|
for (let k = 0; k < Map_QM.util.pathStateObj.facAllArr[j].length; k++) { |
|
|
|
let facP = Map_QM.util.pathStateObj.facAllArr[j][k].buildOrder + "_" + Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder + "_" + Map_QM.util.pathStateObj.facAllArr[j][k].navCode; |
|
|
|
for (let h = 0; h < Map_QM.util.pathStateObj.facAllArr[j].length; h++) { |
|
|
|
if (h != k && Map_QM.util.pathStateObj.facAllArr[j][k].buildOrder == Map_QM.util.pathStateObj.facAllArr[j][h].buildOrder) { |
|
|
|
let nP = Map_QM.util.pathStateObj.facAllArr[j][h].buildOrder + "_" + Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder + "_" + Map_QM.util.pathStateObj.facAllArr[j][h].navCode; |
|
|
|
if (Map_QM.util.pathStateObj.facAllArr[j][h].facCode == "dt") { |
|
|
|
ftPathObj[facP][nP] = 1000 + 600 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder));; |
|
|
|
if (Map_QM.util.pathStateObj.facAllArr[j][k].no == Map_QM.util.pathStateObj.seldtFacNo) { |
|
|
|
graphPathObj[facP][nP] = 300 + 100 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
for (let j = 0; j < this.util.pathStateObj.facAllArr.length; j++) { |
|
|
|
for (let k = 0; k < this.util.pathStateObj.facAllArr[j].length; k++) { |
|
|
|
let facP = this.util.pathStateObj.facAllArr[j][k].buildOrder + "_" + this.util.pathStateObj.facAllArr[j][k].floorOrder + "_" + this.util.pathStateObj.facAllArr[j][k].navCode; |
|
|
|
for (let h = 0; h < this.util.pathStateObj.facAllArr[j].length; h++) { |
|
|
|
if (h != k && this.util.pathStateObj.facAllArr[j][k].buildOrder == this.util.pathStateObj.facAllArr[j][h].buildOrder) { |
|
|
|
let nP = this.util.pathStateObj.facAllArr[j][h].buildOrder + "_" + this.util.pathStateObj.facAllArr[j][h].floorOrder + "_" + this.util.pathStateObj.facAllArr[j][h].navCode; |
|
|
|
if (this.util.pathStateObj.facAllArr[j][h].facCode == "dt") { |
|
|
|
ftPathObj[facP][nP] = 1000 + 600 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder));; |
|
|
|
if (this.util.pathStateObj.facAllArr[j][k].no == this.util.pathStateObj.seldtFacNo) { |
|
|
|
graphPathObj[facP][nP] = 300 + 100 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} else { |
|
|
|
graphPathObj[facP][nP] = 800 + 100 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
graphPathObj[facP][nP] = 800 + 100 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} |
|
|
|
dtPathObj[facP][nP] = 1000 + 100 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} else if (Map_QM.util.pathStateObj.facAllArr[j][h].facCode == "td") { |
|
|
|
graphPathObj[facP][nP] = 800 + 300 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
ftPathObj[facP][nP] = 800 + 300 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
dtPathObj[facP][nP] = 800 + 300 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
dtPathObj[facP][nP] = 1000 + 100 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} else if (this.util.pathStateObj.facAllArr[j][h].facCode == "td") { |
|
|
|
graphPathObj[facP][nP] = 800 + 300 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
ftPathObj[facP][nP] = 800 + 300 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
dtPathObj[facP][nP] = 800 + 300 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} else { |
|
|
|
dtPathObj[facP][nP] = 1000 + 600 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
if (Map_QM.util.pathStateObj.facAllArr[j][k].no == Map_QM.util.pathStateObj.selupftFacNo || Map_QM.util.pathStateObj.facAllArr[j][k].no == Map_QM.util.pathStateObj.seldownftFacNo) { |
|
|
|
graphPathObj[facP][nP] = 300 + 100 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
dtPathObj[facP][nP] = 1000 + 600 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
if (this.util.pathStateObj.facAllArr[j][k].no == this.util.pathStateObj.selupftFacNo || this.util.pathStateObj.facAllArr[j][k].no == this.util.pathStateObj.seldownftFacNo) { |
|
|
|
graphPathObj[facP][nP] = 300 + 100 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} else { |
|
|
|
graphPathObj[facP][nP] = 800 + 100 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
graphPathObj[facP][nP] = 800 + 100 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} |
|
|
|
ftPathObj[facP][nP] = 1000 + 100 * Math.abs(parseInt(Map_QM.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(Map_QM.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
ftPathObj[facP][nP] = 1000 + 100 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1715,9 +1743,9 @@ MainMap_QM.prototype = { |
|
|
|
console.log("交通设施点位问题: " + e); |
|
|
|
} |
|
|
|
|
|
|
|
Map_QM.util.pathStateObj.graphPath = graphPathObj; |
|
|
|
Map_QM.util.pathStateObj.ftPath = ftPathObj; |
|
|
|
Map_QM.util.pathStateObj.dtPath = dtPathObj; |
|
|
|
this.util.pathStateObj.graphPath = graphPathObj; |
|
|
|
this.util.pathStateObj.ftPath = ftPathObj; |
|
|
|
this.util.pathStateObj.dtPath = dtPathObj; |
|
|
|
var fIndex = 0, bIndex = 0; |
|
|
|
this.mapArr[bIndex] = []; |
|
|
|
intTimer = setInterval(() => { |
|
|
|
@ -1744,7 +1772,7 @@ MainMap_QM.prototype = { |
|
|
|
Map_QM.mapArr[parseInt(Map_QM.util.deviceObj.build)][parseInt(Map_QM.util.deviceObj.floor)].setStartSite(Map_QM.util.deviceObj.xaxis, Map_QM.util.deviceObj.yaxis, parseInt(Map_QM.util.shopHeight)); |
|
|
|
} else { |
|
|
|
if (parseInt(Map_QM.util.deviceObj.node) != -1) { |
|
|
|
pathData.nodes.sort(Map_QM.util.sortNode); |
|
|
|
pathData && pathData.nodes.sort(Map_QM.util.sortNode); |
|
|
|
if (pathData && !Map_QM.util.deviceObj.xaxis && pathData.nodes.length > parseInt(Map_QM.util.deviceObj.node)) { |
|
|
|
Map_QM.util.deviceObj.xaxis = pathData.nodes[parseInt(Map_QM.util.deviceObj.node)].x; |
|
|
|
Map_QM.util.deviceObj.yaxis = pathData.nodes[parseInt(Map_QM.util.deviceObj.node)].y; |
|
|
|
@ -2024,7 +2052,7 @@ MainMap_QM.prototype = { |
|
|
|
TweenMax.to(Map_QM.buildObj.position, 0.5, { |
|
|
|
x: build * Map_QM.util.options.bSpace * -1, |
|
|
|
onComplete: function () { |
|
|
|
Map_QM.changeFloorInner(-1, fIndex); //结束后切换楼层
|
|
|
|
Map_QM.changeFloorInner(build, fIndex); //结束后切换楼层
|
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
@ -2095,17 +2123,13 @@ MainMap_QM.prototype = { |
|
|
|
for (let i = 0; i < Map_QM.mapArr[t].length; i++) { |
|
|
|
Map_QM.mapArr[t][i].allObj.visible = t == build ? true : false; |
|
|
|
Map_QM.mapArr[t][i].labelObj.traverse((obj) => { |
|
|
|
obj.visible = false; |
|
|
|
}); |
|
|
|
Map_QM.mapArr[t][i].iconLabel.traverse((obj) => { |
|
|
|
obj.visible = false; |
|
|
|
obj.element && (obj.element.style.visibility = "hidden"); |
|
|
|
}); |
|
|
|
|
|
|
|
Map_QM.mapArr[t][i].tagObj.traverse((obj) => { |
|
|
|
obj.visible = false; |
|
|
|
obj.element && (obj.element.style.visibility = "hidden"); |
|
|
|
}); |
|
|
|
Map_QM.mapArr[t][i].showTagObj.traverse((obj) => { |
|
|
|
obj.visible = false; |
|
|
|
obj.element && (obj.element.style.visibility = "hidden"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -2114,18 +2138,14 @@ MainMap_QM.prototype = { |
|
|
|
} else { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
for (let i = 0; i < Map_QM.mapArr[build].length; i++) { |
|
|
|
if (i == fIndex || (i == midIndex && Map_QM.util.options.overlap) || (i == endIndex && Map_QM.util.options.overlap)) { |
|
|
|
Map_QM.mapArr[build][i].allObj.visible = true; |
|
|
|
Map_QM.mapArr[build][i].labelObj.traverse((obj) => { |
|
|
|
obj.visible = true; |
|
|
|
}); |
|
|
|
Map_QM.mapArr[build][i].iconLabel.traverse((obj) => { |
|
|
|
obj.visible = true; |
|
|
|
obj.element && (obj.element.style.visibility = "visible") |
|
|
|
}); |
|
|
|
Map_QM.mapArr[build][i].showTagObj.traverse((obj) => { |
|
|
|
obj.visible = true; |
|
|
|
obj.element && (obj.element.style.visibility = "visible"); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
Map_QM.mapArr[build][i].allObj.visible = false; |
|
|
|
@ -2138,6 +2158,7 @@ MainMap_QM.prototype = { |
|
|
|
Map_QM.timeOutInit(); |
|
|
|
} else if (endIndex === -1) { //一层
|
|
|
|
if (build == Map_QM.util.selectBuild && fIndex == Map_QM.util.selectFloor) { |
|
|
|
Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.position.y = 0; |
|
|
|
Map_QM.timeOutInit(); |
|
|
|
if (callBack) callBack(); |
|
|
|
} else { |
|
|
|
@ -3315,7 +3336,7 @@ MainMap_QM.prototype = { |
|
|
|
if (!Map_QM || !Map_QM.util.options.collision) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
clearTimeout(Map_QM.util.timeObj.collTime); |
|
|
|
Map_QM.util.timeObj.collTime = setTimeout(() => { |
|
|
|
clearTimeout(Map_QM.util.timeObj.collTime); |
|
|
|
let checkList = []; |
|
|
|
@ -3328,59 +3349,38 @@ MainMap_QM.prototype = { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
if (Map_QM.mapArr[Map_QM.util.selectBuild]) { |
|
|
|
if (Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.buildObj.visible) { |
|
|
|
for (let m = 0; m < Map_QM.mapArr[Map_QM.util.selectBuild].length; m++) { |
|
|
|
if (Map_QM.mapArr[Map_QM.util.selectBuild][m].allObj.visible && (!Map_QM.buildObj.userData.hasOwnProperty("visible") || Map_QM.buildObj.userData.visible)) { |
|
|
|
let IconChilds = Map_QM.mapArr[Map_QM.util.selectBuild][m].iconLabel.children; |
|
|
|
IconChilds.forEach((item) => { |
|
|
|
item.element.style.visibility = "visible"; |
|
|
|
}); |
|
|
|
let childs = Map_QM.mapArr[Map_QM.util.selectBuild][m].labelObj.children; |
|
|
|
childs.forEach((item) => { |
|
|
|
item.element.style.visibility = "hidden"; |
|
|
|
}); |
|
|
|
let len = childs.length; |
|
|
|
for (let i = 0; i < len; i++) { |
|
|
|
let obj = childs[i].element |
|
|
|
if (obj.style.visibility == 'hidden' && obj.style.transform) { |
|
|
|
obj.style.visibility = 'visible' |
|
|
|
let labP = obj.style.transform.split('translate')[2].split(', ') |
|
|
|
if (childs[i].userData.mapShow) { |
|
|
|
obj.style.visibility = "visible"; |
|
|
|
} else { |
|
|
|
obj.style.visibility = "hidden"; |
|
|
|
} |
|
|
|
if (obj.style.transform) { |
|
|
|
obj.style.visibility = "visible" |
|
|
|
let labP = obj.getBoundingClientRect(); |
|
|
|
for (let j = 0; j < i; j++) { |
|
|
|
if (childs[j].element.style.visibility == 'visible') { |
|
|
|
let pb = childs[j].element.style.transform.split('translate')[2].split(', ') |
|
|
|
let isCol = Map_QM.util.isCollision( |
|
|
|
new Map_QM.util.Point(labP[0].substring(1, labP[0].length - 2), labP[1].substring(0, labP[1].length - 3)), |
|
|
|
obj.clientWidth, |
|
|
|
obj.clientHeight, |
|
|
|
new Map_QM.util.Point(pb[0].substring(1, pb[0].length - 2), pb[1].substring(0, pb[1].length - 3)), |
|
|
|
childs[j].element.clientWidth, |
|
|
|
childs[j].element.clientHeight |
|
|
|
) |
|
|
|
if (childs[j].element.style.visibility == "visible") { |
|
|
|
let pb = childs[j].element.getBoundingClientRect(); |
|
|
|
let isCol = Map_QM.util.isCollision(labP, pb); |
|
|
|
if (isCol) { |
|
|
|
obj.style.visibility = 'hidden' |
|
|
|
break; |
|
|
|
if (!childs[i].userData.mapShow) { |
|
|
|
obj.style.visibility = "hidden" |
|
|
|
break; |
|
|
|
} else if (!childs[j].userData.mapShow) { |
|
|
|
childs[j].element.style.visibility = "hidden" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
let iLen = IconChilds.length; |
|
|
|
for (let ii = 0; ii < iLen; ii++) { |
|
|
|
let objIcon = IconChilds[ii].element; |
|
|
|
if (objIcon.style.visibility == "visible" && objIcon.style.transform) { |
|
|
|
let labPIcon = objIcon.style.transform.split("translate")[2].split(", "); |
|
|
|
for (let jj = ii + 1; jj < iLen; jj++) { |
|
|
|
let pbe = IconChilds[jj].element.style.transform.split("translate")[2].split(", "); |
|
|
|
let isCol2 = Map_QM.util.isCollision(new Map_QM.util.Point(labPIcon[0].substring(1, labPIcon[0].length - 2), labPIcon[1].substring(0, |
|
|
|
labPIcon[1].length - 3)), objIcon.clientWidth, objIcon.clientHeight, |
|
|
|
new Map_QM.util.Point(pbe[0].substring(1, pbe[0].length - 2), pbe[1].substring(0, pbe[1].length - 3)), IconChilds[jj].element |
|
|
|
.clientWidth, IconChilds[jj].element.clientHeight); |
|
|
|
if (isCol2) { |
|
|
|
IconChilds[jj].element.style.visibility = "hidden"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (Map_QM.util.options.overlap) { |
|
|
|
let renChild = Map_QM.mapArr[Map_QM.util.selectBuild][m].showTagObj.children; |
|
|
|
const { left, top } = Map_QM.renderer.domElement.getBoundingClientRect(); |
|
|
|
@ -3400,20 +3400,8 @@ MainMap_QM.prototype = { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
IconChilds.forEach((item) => { |
|
|
|
if (item.element.style.visibility == "visible") { |
|
|
|
let check = Map_QM.util.blocked(item.element, checkList, m, top, left); |
|
|
|
if (check) { |
|
|
|
item.element.style.visibility = "hidden"; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
let IconChilds = Map_QM.mapArr[Map_QM.util.selectBuild][m].iconLabel.children; |
|
|
|
IconChilds.forEach((item) => { |
|
|
|
item.element.style.visibility = "hidden"; |
|
|
|
}); |
|
|
|
let childs = Map_QM.mapArr[Map_QM.util.selectBuild][m].labelObj.children; |
|
|
|
childs.forEach((item) => { |
|
|
|
item.element.style.visibility = "hidden"; |
|
|
|
@ -3963,6 +3951,13 @@ MainMap_QM.prototype = { |
|
|
|
if (!usePath) { |
|
|
|
usePath = Map_QM.util.pathStateObj.graphPath; |
|
|
|
} |
|
|
|
if (Map_QM.util.overObj.comeIn) { |
|
|
|
const costall = dijkstra.single_source_shortest_paths(Map_QM.util.pathStateObj.graphPath, startNade, startNade).costs; |
|
|
|
if (costall) { |
|
|
|
let inArray = Map_QM.util.overObj.comeIn.split(","); |
|
|
|
Map_QM.util.overObj.node = Map_QM.getMinCostByArray(Map_QM.util.overObj.floor, inArray, costall); |
|
|
|
} |
|
|
|
} |
|
|
|
Map_QM.forShopPath(usePath); |
|
|
|
}, |
|
|
|
forShopPath: function (usePath) { |
|
|
|
@ -4756,7 +4751,7 @@ FloorMap_QM.prototype = { |
|
|
|
obj.rotateY(Map_QM.util.modelArr[i].list[t].rot.y); |
|
|
|
obj.rotateZ(Map_QM.util.modelArr[i].list[t].rot.z); |
|
|
|
sopce.allObj.add(obj); |
|
|
|
} showTagObj |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -4878,56 +4873,25 @@ FloorMap_QM.prototype = { |
|
|
|
logo = ""; |
|
|
|
showLeb = ""; |
|
|
|
navRecommend = false; |
|
|
|
mapShow = false; |
|
|
|
shopD = {}; |
|
|
|
if (shopData) { |
|
|
|
for (let h = 0; h < shopData.length; h++) { |
|
|
|
let houseNum = iot ? shopData[h].houseNumber : shopData[h].houseNum; |
|
|
|
if (typeof (shopData[h].buildingOrder) == "undefined") { |
|
|
|
if (shopData[h].floorOrder == this.floorOrder) { |
|
|
|
|
|
|
|
if (houseNum == mapData.shopArea[i].name) { |
|
|
|
show = iot ? shopData[h].shopName : shopData[h].name; |
|
|
|
showLeb = houseNum; |
|
|
|
showE = iot ? shopData[h].shopNameEn : shopData[h].nameEn; |
|
|
|
logo = shopData[h].logoPath; |
|
|
|
if (shopData[h].navRecommend == undefined) { |
|
|
|
navRecommend = true; |
|
|
|
} else { |
|
|
|
navRecommend = shopData[h].navRecommend; |
|
|
|
} |
|
|
|
shopD = shopData[h]; |
|
|
|
if (shopData[h].isNewStore) { //新店
|
|
|
|
mapData.shopArea[i].type = "new-shop"; |
|
|
|
this.addTagLabel(mapData.shopArea[i], { "node": mapData.shopArea[i].shopNav, "floor": this.floorOrder, "build": this.buildOrder }); |
|
|
|
} |
|
|
|
if ((shopData[h].shopActList && shopData[h].shopActList.length > 0)) { //促销
|
|
|
|
mapData.shopArea[i].type = "promotion"; |
|
|
|
this.addTagLabel(mapData.shopArea[i], { "node": mapData.shopArea[i].shopNav, "floor": this.floorOrder, "build": this.buildOrder }); |
|
|
|
} |
|
|
|
if (shopData[h].formatColor) { |
|
|
|
entColor = parseInt(shopData[h].formatColor.replace("#", "0x"), 16); |
|
|
|
} else { |
|
|
|
entColor = "#eab16e"; |
|
|
|
} |
|
|
|
if (shopData[h].borderColor) { |
|
|
|
borderColor = parseInt(shopData[h].borderColor.replace("#", "0x"), 16); |
|
|
|
} else { |
|
|
|
borderColor = "#eab16e"; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (shopData[h].buildingOrder == this.buildOrder && shopData[h].floorOrder == this.floorOrder) { |
|
|
|
if (houseNum == mapData.shopArea[i].name) { |
|
|
|
show = iot ? shopData[h].shopName : shopData[h].name; |
|
|
|
if(houseNum == "FB130B"){ |
|
|
|
console.log(mapData.shopArea[i],shopData[h]); |
|
|
|
} |
|
|
|
show = shopData[h].shopName || shopData[h].name; |
|
|
|
showLeb = houseNum; |
|
|
|
showE = iot ? shopData[h].shopNameEn : shopData[h].nameEn; |
|
|
|
logo = shopData[h].logoPath; |
|
|
|
if (shopData[h].navRecommend == undefined) { |
|
|
|
navRecommend = true; |
|
|
|
showE = shopData[h].shopNameEn || shopData[h].nameEn; |
|
|
|
logo = shopData[h].logoPath || shopData[h].logoUrl; |
|
|
|
mapShow = shopData[h].mapShow ?? false; |
|
|
|
if (shopData[h].navRecommend || shopData[h].isPass) { |
|
|
|
navRecommend = shopData[h].navRecommend || shopData[h].isPass; |
|
|
|
} else { |
|
|
|
navRecommend = shopData[h].navRecommend; |
|
|
|
navRecommend = false; |
|
|
|
} |
|
|
|
shopD = shopData[h]; |
|
|
|
if (shopData[h].isNewStore) { //新店
|
|
|
|
@ -4939,18 +4903,13 @@ FloorMap_QM.prototype = { |
|
|
|
this.addTagLabel(mapData.shopArea[i], { "node": mapData.shopArea[i].shopNav, "floor": this.floorOrder, "build": this.buildOrder }); |
|
|
|
} |
|
|
|
if (shopData[h].formatColor) { |
|
|
|
entColor = parseInt(shopData[h].formatColor.replace("#", "0x"), 16); |
|
|
|
} else { |
|
|
|
entColor = "#eab16e"; |
|
|
|
entColor = shopData[h].formatColor; |
|
|
|
} |
|
|
|
if (shopData[h].borderColor) { |
|
|
|
borderColor = parseInt(shopData[h].borderColor.replace("#", "0x"), 16); |
|
|
|
} else { |
|
|
|
borderColor = "#eab16e"; |
|
|
|
borderColor = shopData[h].borderColor; |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -4982,13 +4941,15 @@ FloorMap_QM.prototype = { |
|
|
|
mahc.xaxis = mapData.shopArea[i].xaxis >> 0; |
|
|
|
mahc.yaxis = mapData.shopArea[i].yaxis >> 0; |
|
|
|
this.shopObj.add(mahc); |
|
|
|
|
|
|
|
if (mapData.shopArea[i].logoUrl && mapData.shopArea[i].isLabel == 0) { //添加logo
|
|
|
|
this.logoUtil.renderIcon(mapData.shopArea[i], mahc, parseInt(mapData.shopArea[i].toHeight) + parseInt(mapData.shopArea[i].site || 0) + 1); |
|
|
|
} else { //添加文字
|
|
|
|
let some = Map_QM.util.options.boxShop.some((item) => { |
|
|
|
return mapData.shopArea[i].name.includes(item); |
|
|
|
}); |
|
|
|
let some = false; |
|
|
|
if (Map_QM.util.options.boxShop.length && Map_QM.util.options.boxShop[0] !== "") { |
|
|
|
some = Map_QM.util.options.boxShop.some((item) => { |
|
|
|
return mapData.shopArea[i].name.includes(item); |
|
|
|
}); |
|
|
|
} |
|
|
|
if ((showLeb != "" || some )&&show != "shop") { |
|
|
|
showLeb = mapData.shopArea[i].name; |
|
|
|
let shopDiv = document.createElement('div'); |
|
|
|
@ -5000,6 +4961,7 @@ FloorMap_QM.prototype = { |
|
|
|
let shopLabel = new THREE.CSS2DObject(shopDiv); |
|
|
|
shopLabel.position.set(mapData.shopArea[i].xaxis >> 0, -1 * mapData.shopArea[i].yaxis >> 0, parseInt(mapData.shopArea[i].toHeight) + parseInt(mapData.shopArea[i].site || 0)); |
|
|
|
shopLabel.name = mapData.shopArea[i].name; |
|
|
|
shopLabel.userData.mapShow = mapShow; |
|
|
|
this.labelObj.add(shopLabel); |
|
|
|
} |
|
|
|
} |