From dc81a70747a14bf5ef192018272a6311190ad0dc Mon Sep 17 00:00:00 2001 From: gaozl Date: Mon, 27 May 2024 16:07:19 +0800 Subject: [PATCH] fix: ci --- public/static/img/model/flower1.glb | Bin 0 -> 13912 bytes public/static/img/model/flower2.glb | Bin 0 -> 10204 bytes public/static/img/model/grass.glb | Bin 0 -> 6552 bytes public/static/img/model/officeTV.glb | Bin 0 -> 9388 bytes public/static/img/model/table.glb | Bin 0 -> 20412 bytes public/static/img/model/tree3.glb | Bin 0 -> 67188 bytes public/static/qm/MainMap_QM_go.js | 9813 +++++++++++++++----------- public/static/qm/three.js | 1796 ++++- 8 files changed, 7496 insertions(+), 4113 deletions(-) create mode 100644 public/static/img/model/flower1.glb create mode 100644 public/static/img/model/flower2.glb create mode 100644 public/static/img/model/grass.glb create mode 100644 public/static/img/model/officeTV.glb create mode 100644 public/static/img/model/table.glb create mode 100644 public/static/img/model/tree3.glb diff --git a/public/static/img/model/flower1.glb b/public/static/img/model/flower1.glb new file mode 100644 index 0000000000000000000000000000000000000000..c411ad03558f9858ad6d30fcd29ab6b7b50157d3 GIT binary patch literal 13912 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 WGUj;wc_oMr86?CcMem86TKZpr6O>;7 literal 0 HcmV?d00001 diff --git a/public/static/img/model/grass.glb b/public/static/img/model/grass.glb new file mode 100644 index 0000000000000000000000000000000000000000..4f1680bd36f967af15a65b8cf8746679dda37ccf GIT binary patch literal 6552 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 DM&;k- literal 0 HcmV?d00001 diff --git a/public/static/img/model/table.glb b/public/static/img/model/table.glb new file mode 100644 index 0000000000000000000000000000000000000000..4d2cdf5e05447ed12cc9739792156098d9951fb5 GIT binary patch literal 20412 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 literal 0 HcmV?d00001 diff --git a/public/static/img/model/tree3.glb b/public/static/img/model/tree3.glb new file mode 100644 index 0000000000000000000000000000000000000000..542561fc6ca805c04b4529bb1fe26f99dcac725f GIT binary patch literal 67188 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 literal 0 HcmV?d00001 diff --git a/public/static/qm/MainMap_QM_go.js b/public/static/qm/MainMap_QM_go.js index 57c32c4..e443b56 100644 --- a/public/static/qm/MainMap_QM_go.js +++ b/public/static/qm/MainMap_QM_go.js @@ -1,143 +1,158 @@ var Map_QM, renderFrame = -1, - renderCount=0, + renderCount = 0, pathCameraState, - stats, + mapState = "mall", + iconState = "3d", + heatmapInstance, + isShowElement = true, isJUZ = false, + allJU = true, + hasLine = false, + startRotate = false, + intTimer, shopTime, - debug = false -//basePath 基础路径 graphPath最佳路径 ftPath 扶梯路径 dtPath 电梯路径 + allTime, + language = "zh"; + + //basePath 基础路径 graphPath最佳路径 ftPath 扶梯路径 dtPath 电梯路径 var css_LR = - 'color:#000000;height: 16px;font-size: 14px; z-index: 90; text-shadow: 1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; pointer-events:none;' - + 'color:#000000;font-size: 14px; z-index: 90; text-shadow: 1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff; pointer-events:none;' + var typeObj = [ - { ft: 0, type: 0, code: 'ft', name: '扶梯' }, - { upft: 1, type: 1, code: 'upft', name: '上扶梯' }, - { downft: 2, type: 2, code: 'downft', name: '下扶梯' }, - { mys: 3, type: 3, code: 'mys', name: '母婴室' }, - { xsj: 4, type: 4, code: 'xsj', name: '洗手间' }, - { dt: 5, type: 5, code: 'dt', name: '直梯' }, - { hxkj: 6, type: 6, code: 'hxkj', name: '焕醒空间' }, - { fwt: 7, type: 7, code: 'fwt', name: '服务台' }, - { tcc: 8, type: 8, code: 'tcc', name: '停车场' }, - { hhkj: 9, type: 9, code: 'hhkj', name: '焕活空间' }, - { cjr: 10, type: 10, code: 'cjr', name: '无障碍洗手间' }, - { xys: 11, type: 11, code: 'xys', name: '吸烟室' }, - { upft: 12, type: 12, code: 'upft', name: '上扶梯' }, - { downft: 13, type: 13, code: 'downft', name: '下扶梯' }, - { dkbc: 14, type: 14, code: 'dkbc', name: '代客泊车' }, - { tczj: 15, type: 15, code: 'tczj', name: '童车租借' }, - { ysc: 16, type: 16, code: 'ysc', name: '饮水处' }, - { ztg: 17, type: 17, code: 'ztg', name: 'L1自提柜' }, - { thg: 18, type: 18, code: 'thg', name: 'B1自提柜' }, - { cwysd: 19, type: 19, code: 'cwysd', name: '宠物饮水点' }, - { td: 20, type: 20, code: 'td', name: '人行通道' }, - { dit: 21, type: 21, code: 'dit', name: '地铁' }, - { czc: 22, type: 22, code: 'czc', name: '出租车' }, - { atm: 23, type: 23, code: 'atm', name: 'ATM' }, - { jcfw: 24, type: 24, code: 'jcfw', name: '寄存服务' }, - { sjcd: 25, type: 25, code: 'sjcd', name: '手机充电' }, - { bc: 26, type: 26, code: 'bc', name: '泊车' }, - { cjc: 27, type: 27, code: 'cjc', name: '裁剪处' }, - { jtn: 28, type: 28, code: 'jtn', name: '家庭洗手间(男)' }, - { jtv: 29, type: 29, code: 'jtv', name: '家庭洗手间(女)' }, - { ksgj: 30, type: 30, code: 'ksgj', name: '公交' }, - { sjxsn: 31, type: 31, code: 'sjxsn', name: '无障碍洗手间男' }, - { sjxsv: 32, type: 32, code: 'sjxsv', name: '无障碍洗手间女' }, - { tcjf: 33, type: 33, code: 'tcjf', name: '停车缴费' }, - { vip: 34, type: 34, code: 'vip', name: 'VIP' }, - { xsjn: 35, type: 35, code: 'xsjn', name: '男洗手间' }, - { xsjv: 36, type: 36, code: 'xsjv', name: '女洗手间' }, - { yszj: 37, type: 37, code: 'yszj', name: '雨伞租借' }, - { dyj: 38, type: 38, code: 'dyj', name: '打印机' }, - { door: 39, type: 39, code: 'door', name: '出入口' }, - { pq: 40, type: 40, code: 'pq', name: '喷泉' }, - { d1k: 41, type: 41, code: 'd1k', name: '1号出入口' }, - { d2k: 42, type: 42, code: 'd2k', name: '2号出入口' }, - { d3k: 43, type: 43, code: 'd3k', name: '3号出入口' }, - { d4k: 44, type: 44, code: 'd4k', name: '4号出入口' }, - { mjzyf: 45, type: 45, code: 'mjzyf', name: '门急诊药房' }, - { cryc: 46, type: 46, code: 'cryc', name: '出入院处' }, - { rggh: 47, type: 47, code: 'rggh', name: '人工挂号收费处' }, - { zzyl: 48, type: 48, code: 'zzyl', name: '自动饮料贩卖机' }, - { gxly: 49, type: 49, code: 'gxly', name: '共享轮椅' }, - { ysp: 50, type: 50, code: 'ysp', name: '艺术品' }, - { B1up: 51, type: 51, code: 'B1up', name: '' }, - { B1down: 52, type: 52, code: 'B1down', name: '' }, - { B2up: 53, type: 53, code: 'B2up', name: '' }, - { B2down: 54, type: 54, code: 'B2down', name: '' }, - { B3up: 55, type: 55, code: 'B3up', name: '' }, - { B3down: 56, type: 56, code: 'B3down', name: '' }, - { xcgc: 57, type: 57, code: 'xcgc', name: '下沉广场' }, - { tthy: 58, type: 58, code: 'tthy', name: '天台花园' }, - { ybck: 59, type: 59, code: 'ybck', name: '医保窗口' }, - { zzfw: 60, type: 60, code: 'zzfw', name: '自助服务' }, - { gjj: 61, type: 61, code: 'gjj', name: '工具间' }, - { syt1: 62, type: 62, code: 'syt1', name: 'mall收银台' }, - { gwc: 63, type: 63, code: 'gwc', name: '购物车' }, - { ht: 64, type: 64, code: 'ht', name: '花坛' }, - { jrc: 65, type: 65, code: 'jrc', name: '自助加热' }, - { qbc: 66, type: 66, code: 'qbc', name: '自助取冰' }, - { zxc: 67, type: 67, code: 'zxc', name: '自行车停放' }, - { jws: 68, type: 68, code: 'jws', name: '警务室' }, - { etxsj: 69, type: 69, code: 'etxsj', name: '儿童洗手间' }, - { vip_xxq: 70, type: 70, code: 'vip_xxq', name: 'vip休息区' }, - { ab: 71, type: 71, code: 'ab', name: '安保' }, - { abjks: 72, type: 72, code: 'abjks', name: '安保监控室' }, - { bys: 73, type: 73, code: 'bys', name: '播音室' }, - { cpgys: 74, type: 74, code: 'cpgys', name: '裁判更衣室' }, - { gzyld: 75, type: 75, code: 'gzyld', name: '观众医疗点' }, - { hqgys: 76, type: 76, code: 'hqgys', name: '后勤更衣室' }, - { jjs: 77, type: 77, code: 'jjs', name: '急救室' }, - { jw: 78, type: 78, code: 'jw', name: '警卫' }, - { ksj: 79, type: 79, code: 'ksj', name: '开水间' }, - { kt: 80, type: 80, code: 'kt', name: '看台' }, - { qzgysn: 81, type: 81, code: 'qzgysn', name: '亲自更衣(男)' }, - { rsggys: 82, type: 82, code: 'rsggys', name: '热身馆更衣室' }, - { swzl: 83, type: 83, code: 'swzl', name: '失物招领' }, - { tsgbs1: 84, type: 84, code: 'tsgbs1', name: '特殊贵宾室1' }, - { tsgbs2: 85, type: 85, code: 'tsgbs2', name: '特殊贵宾室2' }, - { tsgbs3: 86, type: 86, code: 'tsgbs3', name: '特殊贵宾室3' }, - { wxc: 87, type: 87, code: 'wxc', name: '闻讯处' }, - { lt: 88, type: 88, code: 'lt', name: '楼梯' }, - { yhs: 89, type: 89, code: 'yhs', name: '医护室' }, - { yls: 90, type: 90, code: 'yls', name: '医疗室' }, - { ylz: 91, type: 91, code: 'ylz', name: '医疗站' }, - { ydygys: 92, type: 92, code: 'ydygys', name: '运动员更衣室' }, - { ydygysn: 93, type: 93, code: 'ydygysn', name: '运动员男更衣室' }, - { ydygysv: 94, type: 94, code: 'ydygysv', name: '运动员女更衣室' }, - { zls: 95, type: 95, code: 'zls', name: '诊疗室' }, - { zys: 96, type: 96, code: 'zys', name: '直饮水' }, - { zas: 97, type: 97, code: 'zas', name: '治安室' }, - { xxq: 98, type: 98, code: 'xxq', name: '休息区' }, - { jtxsj: 99, type: 99, code: 'jtxsj', name: '家庭洗手间' }, - { hzs: 100, type: 100, code: 'hzs', name: '化妆室' }, - { brs: 101, type: 101, code: 'brs', name: '哺乳室' }, - { mtl: 102, type: 102, code: 'mtl', name: '摩天轮' }, - { dgnxsj: 103, type: 103, code: 'dgnxsj', name: '多功能洗手间' }, - { wxbxsj: 104, type: 104, code: 'wxbxsj', name: '无性别洗手间' }, - { sjzx: 105, type: 105, code: 'sjzx', name: '设计中心' }, - { dxp: 106, type: 106, code: 'dxp', name: '导向牌' }, - { gydh: 107, type: 107, code: 'gydh', name: '公用电话' }, - { sgq: 108, type: 108, code: 'sgq', name: '石拱桥' }, - { wxw: 109, type: 109, code: 'wxw', name: '无线网' }, - { xmb: 110, type: 110, code: 'xmb', name: '小卖部' }, - { zyzfwz: 111, type: 111, code: 'zyzfwz', name: '志愿者服务站' }, - { ykzx: 112, type: 112, code: 'ykzx', name: '服务中心' }, - { zjyy: 113, type: 113, code: 'zjyy', name: '专家预约处' }, - { yjt: 114, type: 114, code: 'yjt', name: '预检台' }, - { 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/getMapInfo.json' - this.mapServerInfo = 'static/offline/JSON/getMap.json' - this.beforPath = './' + { ft: 0, type: 0, code: "ft", name: "扶梯" }, + { upft: 1, type: 1, code: "upft", name: "上扶梯" }, + { downft: 2, type: 2, code: "downft", name: "下扶梯" }, + { mys: 3, type: 3, code: "mys", name: "母婴室" }, + { xsj: 4, type: 4, code: "xsj", name: "洗手间" }, + { dt: 5, type: 5, code: "dt", name: "直梯" }, + { hxkj: 6, type: 6, code: "hxkj", name: "焕醒空间" }, + { fwt: 7, type: 7, code: "fwt", name: "服务台" }, + { tcc: 8, type: 8, code: "tcc", name: "停车场" }, + { hhkj: 9, type: 9, code: "hhkj", name: "焕活空间" }, + { cjr: 10, type: 10, code: "cjr", name: "无障碍洗手间" }, + { xys: 11, type: 11, code: "xys", name: "吸烟室" }, + { upft: 12, type: 12, code: "upft", name: "上扶梯" }, + { downft: 13, type: 13, code: "downft", name: "下扶梯" }, + { dkbc: 14, type: 14, code: "dkbc", name: "代客泊车" }, + { tczj: 15, type: 15, code: "tczj", name: "童车租借" }, + { ysc: 16, type: 16, code: "ysc", name: "饮水处" }, + { ztg: 17, type: 17, code: "ztg", name: "L1自提柜" }, + { thg: 18, type: 18, code: "thg", name: "B1自提柜" }, + { cwysd: 19, type: 19, code: "cwysd", name: "宠物饮水点" }, + { td: 20, type: 20, code: "td", name: "人行通道" }, + { dit: 21, type: 21, code: "dit", name: "地铁" }, + { czc: 22, type: 22, code: "czc", name: "出租车" }, + { atm: 23, type: 23, code: "atm", name: "ATM" }, + { jcfw: 24, type: 24, code: "jcfw", name: "寄存服务" }, + { sjcd: 25, type: 25, code: "sjcd", name: "手机充电" }, + { bc: 26, type: 26, code: "bc", name: "泊车" }, + { cjc: 27, type: 27, code: "cjc", name: "裁剪处" }, + { jtn: 28, type: 28, code: "jtn", name: "家庭洗手间(男)" }, + { jtv: 29, type: 29, code: "jtv", name: "家庭洗手间(女)" }, + { ksgj: 30, type: 30, code: "ksgj", name: "公交" }, + { sjxsn: 31, type: 31, code: "sjxsn", name: "无障碍洗手间男" }, + { sjxsv: 32, type: 32, code: "sjxsv", name: "无障碍洗手间女" }, + { tcjf: 33, type: 33, code: "tcjf", name: "停车缴费" }, + { vip: 34, type: 34, code: "vip", name: "VIP" }, + { xsjn: 35, type: 35, code: "xsjn", name: "男洗手间" }, + { xsjv: 36, type: 36, code: "xsjv", name: "女洗手间" }, + { yszj: 37, type: 37, code: "yszj", name: "雨伞租借" }, + { dyj: 38, type: 38, code: "dyj", name: "打印机" }, + { door: 39, type: 39, code: "door", name: "出入口" }, + { pq: 40, type: 40, code: "pq", name: "喷泉" }, + { d1k: 41, type: 41, code: "d1k", name: "1号出入口" }, + { d2k: 42, type: 42, code: "d2k", name: "2号出入口" }, + { d3k: 43, type: 43, code: "d3k", name: "3号出入口" }, + { d4k: 44, type: 44, code: "d4k", name: "4号出入口" }, + { mjzyf: 45, type: 45, code: "mjzyf", name: "门急诊药房" }, + { cryc: 46, type: 46, code: "cryc", name: "出入院处" }, + { rggh: 47, type: 47, code: "rggh", name: "人工挂号收费处" }, + { zzyl: 48, type: 48, code: "zzyl", name: "自动饮料贩卖机" }, + { gxly: 49, type: 49, code: "gxly", name: "共享轮椅" }, + { ysp: 50, type: 50, code: "ysp", name: "艺术品" }, + { B1up: 51, type: 51, code: "B1up", name: "" }, + { B1down: 52, type: 52, code: "B1down", name: "" }, + { B2up: 53, type: 53, code: "B2up", name: "" }, + { B2down: 54, type: 54, code: "B2down", name: "" }, + { B3up: 55, type: 55, code: "B3up", name: "" }, + { B3down: 56, type: 56, code: "B3down", name: "" }, + { xcgc: 57, type: 57, code: "xcgc", name: "下沉广场" }, + { tthy: 58, type: 58, code: "tthy", name: "天台花园" }, + { ybck: 59, type: 59, code: "ybck", name: "医保窗口" }, + { zzfw: 60, type: 60, code: "zzfw", name: "自助服务" }, + { gjj: 61, type: 61, code: "gjj", name: "工具间" }, + { syt1: 62, type: 62, code: "syt1", name: "mall收银台" }, + { gwc: 63, type: 63, code: "gwc", name: "购物车" }, + { ht: 64, type: 64, code: "ht", name: "花坛" }, + { jrc: 65, type: 65, code: "jrc", name: "自助加热" }, + { qbc: 66, type: 66, code: "qbc", name: "自助取冰" }, + { zxc: 67, type: 67, code: "zxc", name: "自行车停放" }, + { jws: 68, type: 68, code: "jws", name: "警务室" }, + { etxsj: 69, type: 69, code: "etxsj", name: "儿童洗手间" }, + { vip_xxq: 70, type: 70, code: "vip_xxq", name: "vip休息区" }, + { ab: 71, type: 71, code: "ab", name: "安保" }, + { abjks: 72, type: 72, code: "abjks", name: "安保监控室" }, + { bys: 73, type: 73, code: "bys", name: "播音室" }, + { cpgys: 74, type: 74, code: "cpgys", name: "裁判更衣室" }, + { gzyld: 75, type: 75, code: "gzyld", name: "观众医疗点" }, + { hqgys: 76, type: 76, code: "hqgys", name: "后勤更衣室" }, + { jjs: 77, type: 77, code: "jjs", name: "急救室" }, + { jw: 78, type: 78, code: "jw", name: "警卫" }, + { ksj: 79, type: 79, code: "ksj", name: "开水间" }, + { kt: 80, type: 80, code: "kt", name: "看台" }, + { qzgysn: 81, type: 81, code: "qzgysn", name: "亲自更衣(男)" }, + { rsggys: 82, type: 82, code: "rsggys", name: "热身馆更衣室" }, + { swzl: 83, type: 83, code: "swzl", name: "失物招领" }, + { tsgbs1: 84, type: 84, code: "tsgbs1", name: "特殊贵宾室1" }, + { tsgbs2: 85, type: 85, code: "tsgbs2", name: "特殊贵宾室2" }, + { tsgbs3: 86, type: 86, code: "tsgbs3", name: "特殊贵宾室3" }, + { wxc: 87, type: 87, code: "wxc", name: "闻讯处" }, + { lt: 88, type: 88, code: "lt", name: "楼梯" }, + { yhs: 89, type: 89, code: "yhs", name: "医护室" }, + { yls: 90, type: 90, code: "yls", name: "医疗室" }, + { ylz: 91, type: 91, code: "ylz", name: "医疗站" }, + { ydygys: 92, type: 92, code: "ydygys", name: "运动员更衣室" }, + { ydygysn: 93, type: 93, code: "ydygysn", name: "运动员男更衣室" }, + { ydygysv: 94, type: 94, code: "ydygysv", name: "运动员女更衣室" }, + { zls: 95, type: 95, code: "zls", name: "诊疗室" }, + { zys: 96, type: 96, code: "zys", name: "直饮水" }, + { zas: 97, type: 97, code: "zas", name: "治安室" }, + { xxq: 98, type: 98, code: "xxq", name: "休息区" }, + { jtxsj: 99, type: 99, code: "jtxsj", name: "家庭洗手间" }, + { hzs: 100, type: 100, code: "hzs", name: "化妆室" }, + { brs: 101, type: 101, code: "brs", name: "哺乳室" }, + { mtl: 102, type: 102, code: "mtl", name: "摩天轮" }, + { dgnxsj: 103, type: 103, code: "dgnxsj", name: "多功能洗手间" }, + { wxbxsj: 104, type: 104, code: "wxbxsj", name: "无性别洗手间" }, + { sjzx: 105, type: 105, code: "sjzx", name: "设计中心" }, + { dxp: 106, type: 106, code: "dxp", name: "导向牌" }, + { gydh: 107, type: 107, code: "gydh", name: "公用电话" }, + { sgq: 108, type: 108, code: "sgq", name: "石拱桥" }, + { wxw: 109, type: 109, code: "wxw", name: "无线网" }, + { xmb: 110, type: 110, code: "xmb", name: "小卖部" }, + { zyzfwz: 111, type: 111, code: "zyzfwz", name: "志愿者服务站" }, + { ykzx: 112, type: 112, code: "ykzx", name: "服务中心" }, + { zjyy: 113, type: 113, code: "zjyy", name: "专家预约处" }, + { yjt: 114, type: 114, code: "yjt", name: "预检台" }, + { mzjd: 115, type: 115, code: "mzjd", name: "门诊综合接待室" }, + { hd: 116, type: 116, code: "hd", name: "活动点" }, + { bsl: 117, type: 117, code: "bsl", name: "白石龙" }, + { xzl: 118, type: 118, code: "xzl", name: "写字楼" }, + { axzj: 119, type: 119, code: "axzj", name: "爱心租借" }, + { cdz: 120, type: 120, code: "cdz", name: "充电桩" }, + { hjcq: 121, type: 121, code: "hjcq", name: "黑金车区" }, + { yjjj: 122, type: 122, code: "yjjj", name: "宜家家居" }, +]; + +var QMUtil = function () { + this.shopServerInfo = "static/offline/JSON/QueryShopList.json"; + this.mapServerInfo = "static/offline/JSON/GetMapInfo.json"; + this.beforPath = "./"; //https://qianmu-iot.1000my.com/QMAPSDK/ this.tomUrl = "https://qianmu-iot.1000my.com"; this.options = { - playSpeed: 6, //动画播放速度 + playSpeed: 8, //动画播放速度 + speedMult: 1, //动画播放倍数 collision: true, //是否支持名称的碰撞检测 modelIcon: true, //是否使用模型 true 模型 false 图标 otherPath: [], //人为干预的路线 [{f:"0_5_10",s:"1_5_47",d:500},{f:"1_5_47",s:"0_5_10",d:500}]; @@ -145,524 +160,589 @@ QMUtil = function () { fSpace: 500, //双叠层状态下楼层的间距 maxDis: 1000, minDis: 60, + shadow: true, //是否显示阴影 navColor: 0xee6a50, //途径店铺颜色 aRadius: 2, //圆角半径 大于2 则店铺box显示圆角 iconName: false, //图标名称是否显示 mapScale: 18, //地图比例尺 - pathColor: "#6e95fe", // - pathColor2: "#6e7dfe", - pathStyle: '3D', - shopStyle: 'shopName', //设置box显示名称shopName或编号shopNum + pathColor: "#6e95fe", // + pathColor2: "#6e7dfe", //'rgb(110,125,254)' + pathBgColor: "#a9b5d3", //'rgb(169,181,211)' + pathBgColor2: "#bdc0cb", //'rgb(189, 192, 203)', + pathStyle: "3D", + shopStyle: "shopName", //设置box显示名称shopName或编号shopNum inArea: false, //点击后是否聚焦到店铺 - camZoom: 3, //设置我的方向状态地图放大倍数 boxShop: [], //设置box上显示的文字(过滤指),可点击触发onlyShop deviceAng: false, //地图初始化方向是否使用设备角度 - facSize: 20 //设施大小 - } + northShow: false, //指南针显示 + facSize: 20, //设施大小 + }; this.lightOptions = { - d_col: '#ffffff', + d_col: "#ffffff", d_int: 0.2, - s_col: '#fffffa', - g_col: '#ffffff', - a_int: 0.85 - } - this.m_zoom = 1.2 - this._clock = new THREE.Clock() - this._indexPathFloor = 0 // 遍历途径数据 - this.changeDist = { inner: 310, outner: 900 } //室内外切换的极限值, 如果 inner小于minDis 则不支持缩放切换 + s_col: "#fffffa", + g_col: "#ffffff", + a_int: 0.85, + }; + this.m_zoom = 1.2; //2D地图缩放大小 + this._clock = new THREE.Clock(); + this._indexPathFloor = 0; // 遍历途径数据 + this.changeDist = { inner: 300, outner: 900 }; /** * isPathState 寻路状态 */ this.pathStateObj = { isPathState: false, isPathPlay: true, - basePath: '', - graphPath: '', - ftPath: '', - dtPath: '', + basePath: "", + graphPath: "", + ftPath: "", + dtPath: "", facAllArr: [], forShopArr: {}, elevator: null, straight: null, elevatorDown: null, - seldtFacNo: '', - seldownftFacNo: '', - selupftFacNo: '' - } - this.timeObj = { timeS: 0, collTime: -1, pathTime: -1 } - - this.sceneGap = { cameraX: 0, cameraY: 220, cameraZ: 220, x: -10, y: 0, z: 0, scale: 0.08 } //改变地图位置,大小 - this.selectBuild = 0 - this.selectFloor = 0 - this.deviceObj = {} //angle --- 设备旋转角度 node ---- 设备导航点位 floor --- 设备楼层 - this.startObj = {} // 导航起点; - this.overObj = {} //导航结束点 - this.buildHeight = 5 - this.shopHeight = 30 //店铺高度 控制店铺相关的其它第三方组件高度 - //服务icon 英文配置 - this.iconEn = { 洗手间: 'Toilets', 停车场: 'Parking', 电梯: 'Lift', 扶梯: 'Escalator', 母婴室: 'Baby care room', 服务台: 'service desk' } + seldtFacNo: { type: "", no: "" }, + }; + this.timeObj = { collTime: -1, pathTime: -1 }; + this.sceneGap = { cameraX: 0, cameraY: 220, cameraZ: 220, x: 0, y: 0, z: 0, scale: 0.08 }; //改变地图位置,大小 + this.isMorePath = false; //多节点寻路模式 + this.selectBuild = 0; + this.selectFloor = 0; + this.deviceObj = {}; //angle --- 设备旋转角度 node ---- 设备导航点位 floor --- 设备楼层 + this.startObj = {}; // 导航起点; + this.overObj = {}; //导航结束点 + this.buildHeight = 5; + this.shopHeight = 30; //店铺高度 控制店铺相关的其它第三方组件高度 //添加平铺logo {floor:5, logoUrl:"./static/img/ss.png", imgW:395, imgH:376, xaxis:1550, yaxis:-860, site:30} - this.logos = [] + this.logos = []; /** * 外立面 - * Map_QM.util.initModelArr=[{url:"./static/model/jianfa.gltf",type:"out", scale:0.038, rot:{x:0,y:30,z:0}, site:{x:-20,y:-100,z:20}, colorModel:"gama" }]; + * Map_QM.util.initModelArr=[{url:"./static/img/out/yong.glb",type:"out", scale:1, rot:{x:0,y:0,z:0}, site:{x:0,y:0,z:0}, colorModel:"gama" }]; */ - this.initModelArr = [] // + this.initModelArr = []; // /** * 一直显示不隐藏, 在楼层内显示 + * {floor:6, url:"static/img/out/skp.glb", list:[{size:{x:12.5,y:12.5,z:12.5}, rot:{x:1.5708,y:0,z:0}, site:{x:0,y:0,z:0}}]} */ - this.modelArr = [] + 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 }, 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': 'park_paly', 'url': 'static/img/model/park_paly.glb', 'colorModel': 'gama', 'rot': { 'x': 1.5708, 'y': 0, 'z': 0 }, 'size': { 'x': 80, 'y': 80, 'z': 80 }, '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 = [] //精灵模型 + {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: "tree3", url: "static/img/model/tree3.glb", colorModel: "gama", rot: { x: 1.5708, y: 0, z: 0 }, size: { x: 20, y: 20, z: 20 }, load: false }, + {key: "grass", url: "static/img/model/grass.glb", colorModel: "gama", rot: { x: 1.5708, y: 0, z: 0 }, size: { x: 20, y: 20, z: 20 }, load: false }, + {key: "flower1", url: "static/img/model/flower1.glb", colorModel: "gama", rot: { x: 1.5708, y: 0, z: 0 }, size: { x: 20, y: 20, z: 20 },load: false}, + {key: "flower2", url: "static/img/model/flower2.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: "park_paly", url: "static/img/model/park_paly.glb", colorModel: "gama", rot: { x: 1.5708, y: 0, z: 0 }, size: { x: 80, y: 80, z: 80 }, 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: "officeTV", url: "static/img/model/officeTV.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: "table", url: "static/img/model/table.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 = []; //精灵模型 /** * 模型弹窗 - * { htmlUrl: "

进入商场

", x: 55, y: 12, z: 3, click: true, type: "out" } + * { htmlUrl: "

进入商场

", x: 55, y: 12, z: 3, show:"zh", type: "out" } */ - this.tipArr = [] //模型标签 periphery + this.tipArr = []; //模型标签 periphery /** * 室内地图标签 * Map_QM.util.labelIconArr([{floor:0,title:'', click:false, site:{x:0,y:1870,z:10},data:{type:"labelIcon",id:"1",show:"cn"}}]); */ - this.labelIconArr = [] - this.spriteMaterialArr = [] - this.lineBasicMaterialArr = [] - this.meshMaterialArr = [] - this.parkMaterialArr = [] - this.shopData = [] //店铺数据 - this.iconUrl = [] - this.allMap = [] + this.labelIconArr = []; + this.spriteMaterialArr = []; + this.lineBasicMaterialArr = []; + this.meshMaterialArr = []; + this.parkMaterialArr = []; + this.shopData = []; //店铺数据 + this.iconUrl = []; + this.allMap = []; /*** ------------------------------------------------ 参数 API START ------------------------------------------------- */ - this.setModelState = function (state = '3d') { - //设置模型显示状态 2d 3d - if (Map_QM) { - Map_QM.changeIconState(state) - } - } - this.exportImg = function () { - let tempSrc = Map_QM.renderer.domElement.toDataURL('image/png') - let a = document.createElement('a') - a.href = tempSrc - a.setAttribute('download', 'floor.png') - a.click() - } + let tempSrc = Map_QM.renderer.domElement.toDataURL("image/png"); + let a = document.createElement("a"); + a.href = tempSrc; + a.setAttribute("download", "floor.png"); + a.click(); + }; /** - * @api {方法} changePlaySpeed(speed) 改变导航速度 - * @apiGroup 地图交互 - * @apiDescription 改变导航播放速度 - * @apiVersion 2.0.0 + * @api {方法} changePlaySpeed(speedMult) 改变导航速度倍数 + * @apiGroup 地图导航 + * @apiDescription 改变导航播放速度倍数 + * @apiVersion 4.0.0 * - * @apiParam {int} speed 播放速度(默认 6) + * @apiParam {int} speedMult 播放速度倍数(默认 1) * * @apiSampleRequest off * * @apiParamExample 请求示例 * - * Map_QM.util.changePlaySpeed(6) + * Map_QM.util.changePlaySpeed() * */ - this.changePlaySpeed = function (speed = 6) { - Map_QM.util.options.playSpeed = speed - } + this.changePlaySpeed = function (speedMult = 1) { + Map_QM.util.options.speedMult = speedMult; + }; /*** ----------------------------------------------- 参数 API END ----------------------------------------------- **** */ this.Point = function (x = 0, y = 0) { - this.x = x - this.y = y - } + this.x = x; + this.y = y; + }; this.WallLine = function (start, end) { - this.start = start //起始点位 - this.end = end //结束点位 - this.leftParLine //左侧平行线段 - this.rightParLine //右侧平行线段 - this.leftPoint //左侧平行线交点 - this.rightPoint //右侧平行线交点 - } - this.assignUVs = function (geometry) { - geometry.computeBoundingBox(); + this.start = start; //起始点位 + this.end = end; //结束点位 + this.leftParLine; //左侧平行线段 + this.rightParLine; //右侧平行线段 + this.leftPoint; //左侧平行线交点 + this.rightPoint; //右侧平行线交点 + }; + + this.assignUVs = function (geometry) { + geometry.computeBoundingBox(); let max = geometry.boundingBox.max, - min = geometry.boundingBox.min; + min = geometry.boundingBox.min; let offset = new THREE.Vector2(0 - min.x, 0 - min.y); let range = new THREE.Vector2(max.x - min.x, max.y - min.y); - let addX=1, addY=1; - range.x/range.y < 1 ? (addX = range.x/range.y) : (addY = range.y/range.x) - geometry.faceVertexUvs[0] = []; - - for (let face of geometry.faces) { + let addX = 1, + addY = 1; + range.x / range.y < 1 + ? (addX = range.x / range.y) + : (addY = range.y / range.x); + geometry.faceVertexUvs[0] = []; + + for (let face of geometry.faces) { let v1 = geometry.vertices[face.a], - v2 = geometry.vertices[face.b], - v3 = geometry.vertices[face.c]; - if(face.normal.z == 0){ //侧面 - if(range.x/range.y >= 1){ - let repY = range.y/256 >= 2 ? 256:range.y; + v2 = geometry.vertices[face.b], + v3 = geometry.vertices[face.c]; + if (face.normal.z == 0) { + //侧面 + if (range.x / range.y >= 1) { + let repY = range.y / 256 >= 2 ? 256 : range.y; face.materialIndex = Math.abs(face.normal.x) < 0.7 ? 2 : 1; - geometry.faceVertexUvs[0].push(face.materialIndex == 1 ? [ - new THREE.Vector2((v1.y + offset.y) / repY, v1.z / 512), - new THREE.Vector2((v2.y + offset.y) / repY, v2.z / 512), - new THREE.Vector2((v3.y + offset.y) / repY, v3.z / 512) - ] : [ - new THREE.Vector2((v1.x + offset.x) / range.x, v1.z / 64), - new THREE.Vector2((v2.x + offset.x) / range.x, v2.z / 64), - new THREE.Vector2((v3.x + offset.x) / range.x, v3.z / 64) - ]); - }else{ + geometry.faceVertexUvs[0].push( + face.materialIndex == 1 + ? [ + new THREE.Vector2((v1.y + offset.y) / repY, v1.z / 512), + new THREE.Vector2((v2.y + offset.y) / repY, v2.z / 512), + new THREE.Vector2((v3.y + offset.y) / repY, v3.z / 512), + ] + : [ + new THREE.Vector2((v1.x + offset.x) / range.x, v1.z / 64), + new THREE.Vector2((v2.x + offset.x) / range.x, v2.z / 64), + new THREE.Vector2((v3.x + offset.x) / range.x, v3.z / 64), + ] + ); + } else { face.materialIndex = Math.abs(face.normal.x) < 0.7 ? 1 : 2; - geometry.faceVertexUvs[0].push(face.materialIndex == 1 ? [ - new THREE.Vector2((v1.x + offset.x) / range.x, v1.z / 512), - new THREE.Vector2((v2.x + offset.x) / range.x, v2.z / 512), - new THREE.Vector2((v3.x + offset.x) / range.x, v3.z / 512) - ] : [ - new THREE.Vector2((v1.y + offset.y) / range.y, v1.z / 64), - new THREE.Vector2((v2.y + offset.y) / range.y, v2.z / 64), - new THREE.Vector2((v3.y + offset.y) / range.y, v3.z / 64) - ]); + geometry.faceVertexUvs[0].push( + face.materialIndex == 1 + ? [ + new THREE.Vector2((v1.x + offset.x) / range.x, v1.z / 512), + new THREE.Vector2((v2.x + offset.x) / range.x, v2.z / 512), + new THREE.Vector2((v3.x + offset.x) / range.x, v3.z / 512), + ] + : [ + new THREE.Vector2((v1.y + offset.y) / range.y, v1.z / 64), + new THREE.Vector2((v2.y + offset.y) / range.y, v2.z / 64), + new THREE.Vector2((v3.y + offset.y) / range.y, v3.z / 64), + ] + ); } - }else{ //顶面和底面 + } else { + //顶面和底面 face.materialIndex = 0; geometry.faceVertexUvs[0].push([ - new THREE.Vector2((v1.x + offset.x) / range.x*addX, (v1.y + offset.y) / range.y*addY), - new THREE.Vector2((v2.x + offset.x) / range.x*addX, (v2.y + offset.y) / range.y*addY), - new THREE.Vector2((v3.x + offset.x) / range.x*addX, (v3.y + offset.y) / range.y*addY) + new THREE.Vector2( + ((v1.x + offset.x) / range.x) * addX, + ((v1.y + offset.y) / range.y) * addY + ), + new THREE.Vector2( + ((v2.x + offset.x) / range.x) * addX, + ((v2.y + offset.y) / range.y) * addY + ), + new THREE.Vector2( + ((v3.x + offset.x) / range.x) * addX, + ((v3.y + offset.y) / range.y) * addY + ), ]); } } geometry.uvsNeedUpdate = true; - } - this.packUv = function (geometry){ - geometry.computeBoundingBox(); + }; + this.packUv = function (geometry) { + geometry.computeBoundingBox(); let max = geometry.boundingBox.max, - min = geometry.boundingBox.min; + min = geometry.boundingBox.min; let offset = new THREE.Vector2(0 - min.x, 0 - min.y); let range = new THREE.Vector2(max.x - min.x, max.y - min.y); - geometry.faceVertexUvs[0] = []; + geometry.faceVertexUvs[0] = []; let allReag = 0; - for(let i=0; i< geometry.faces.length; i+=2){ + for (let i = 0; i < geometry.faces.length; i += 2) { let v1 = geometry.vertices[geometry.faces[i].a], - v2 = geometry.vertices[geometry.faces[i].b]; - if(geometry.faces[i].normal.z == 0){ //侧面 - if(Math.abs(geometry.faces[i].normal.x) < 0.7){ //左右 - allReag+=Math.abs(v2.x-v1.x); - }else{ - allReag+=Math.abs(v2.y-v1.y); + v2 = geometry.vertices[geometry.faces[i].b]; + if (geometry.faces[i].normal.z == 0) { + //侧面 + if (Math.abs(geometry.faces[i].normal.x) < 0.7) { + //左右 + allReag += Math.abs(v2.x - v1.x); + } else { + allReag += Math.abs(v2.y - v1.y); } } } - for (let face of geometry.faces) { + for (let face of geometry.faces) { let v1 = geometry.vertices[face.a], - v2 = geometry.vertices[face.b], - v3 = geometry.vertices[face.c]; - if(face.normal.z == 0){ //侧面 + v2 = geometry.vertices[face.b], + v3 = geometry.vertices[face.c]; + if (face.normal.z == 0) { + //侧面 face.materialIndex = 1; - if(Math.abs(face.normal.x) < 0.7){ //前后 + if (Math.abs(face.normal.x) < 0.7) { + //前后 geometry.faceVertexUvs[0].push([ new THREE.Vector2((v1.x + offset.x) / allReag, v1.z / 512), new THREE.Vector2((v2.x + offset.x) / allReag, v2.z / 512), - new THREE.Vector2((v3.x + offset.x) / allReag, v3.z / 512) - ]) - }else{ + new THREE.Vector2((v3.x + offset.x) / allReag, v3.z / 512), + ]); + } else { geometry.faceVertexUvs[0].push([ new THREE.Vector2((v1.y + offset.y) / allReag, v1.z / 512), new THREE.Vector2((v2.y + offset.y) / allReag, v2.z / 512), - new THREE.Vector2((v3.y + offset.y) / allReag, v3.z / 512) - ]) - + new THREE.Vector2((v3.y + offset.y) / allReag, v3.z / 512), + ]); } - }else{ //顶面和底面 + } else { + //顶面和底面 face.materialIndex = 0; 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) + 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 + ), ]); } } - - } + }; /** * 检测点是否在多边形区域内 */ this.checkBoundary = function (p, ptPolygon) { // 判断边界方法 - let nCount = ptPolygon.length - let nCross = 0 + let nCount = ptPolygon.length; + let nCross = 0; for (let i = 0; i < nCount; i++) { - let p1 = ptPolygon[i] //当前节点 - let p2 = ptPolygon[(i + 1) % nCount] //下一个节点 + let p1 = ptPolygon[i]; //当前节点 + let p2 = ptPolygon[(i + 1) % nCount]; //下一个节点 // 求解 y=p.y 与 p1p2 的交点 if (p1.y == p2.y) // p1p2 与 y=p0.y平行 - continue + continue; if (p.y < Math.min(p1.y, p2.y)) // 交点在p1p2延长线上 - continue + continue; if (p.y >= Math.max(p1.y, p2.y)) // 交点在p1p2延长线上 - continue + continue; // 从P发射一条水平射线 求交点的 X 坐标 ------原理: ((p2.y-p1.y)/(p2.x-p1.x))=((y-p1.y)/(x-p1.x)) //直线k值相等 交点y=p.y - let x = (p.y - p1.y) * (p2.x - p1.x) / (p2.y - p1.y) + p1.x - if (x > p.x) nCross++ // 只统计单边交点 + let x = ((p.y - p1.y) * (p2.x - p1.x)) / (p2.y - p1.y) + p1.x; + if (x > p.x) nCross++; // 只统计单边交点 } // 单边交点为偶数,点在多边形之外 --- - return nCross % 2 == 1 - } + return nCross % 2 == 1; + }; this.requestNoJM = function (params) { - params.method = params.method || 'GET' - let xmlhttp = new XMLHttpRequest() + params.method = params.method || "GET"; + let xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState === 4 && xmlhttp.status === 200) { - let jsonObject + let jsonObject; try { - jsonObject = JSON.parse(xmlhttp.responseText) + jsonObject = JSON.parse(xmlhttp.responseText); } catch (e) { - params.fail() - return + window.captureException && window.captureException(e); + params.fail(); + return; } - params.success(jsonObject) + params.success(jsonObject); } - if (xmlhttp.readyState === 4 && (xmlhttp.status === 404 || xmlhttp.status === 405)) { - params.fail() + if ( + xmlhttp.readyState === 4 && + (xmlhttp.status === 404 || xmlhttp.status === 405) + ) { + params.fail(); } - } - xmlhttp.onerror = function (e) { - params.fail() - } - xmlhttp.open(params.method, params.url, true) - //xmlhttp.setRequestHeader('Access-Control-Allow-Origin', '*') - xmlhttp.setRequestHeader('Content-type', 'application/json') - //xmlhttp.setRequestHeader('Access-Control-Allow-Method', 'POST,GET') - xmlhttp.send(params.data) - } - + }; + xmlhttp.onerror = function () { + params.fail(); + }; + xmlhttp.open(params.method, params.url, true); + //xmlhttp.setRequestHeader("Access-Control-Allow-Origin", "*"); + xmlhttp.setRequestHeader("Content-type", "application/json"); + xmlhttp.send(params.data); + }; + //解密 + this.decrypt = function (word, keyStr) { + keyStr = keyStr ? keyStr : "cqmyg#hdhxt!saas"; + var key = CryptoJS.enc.Utf8.parse(keyStr); //Latin1 w8m31+Yy/Nw6thPsMpO5fg== + var decrypt = CryptoJS.AES.decrypt(word, key, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7, + }); + return CryptoJS.enc.Utf8.stringify(decrypt).toString(); + }; this.timeStamp = function () { - return parseInt(new Date().getTime() / 1000) - } + return parseInt(new Date().getTime() / 1000); + }; this.readTextFile = function (file, callback) { - let rawFile = new XMLHttpRequest() - rawFile.overrideMimeType('application/json') - rawFile.open('GET', file, true) + let rawFile = new XMLHttpRequest(); + rawFile.overrideMimeType("application/json"); + rawFile.open("GET", file, true); rawFile.onreadystatechange = function () { if (rawFile.readyState === 4 && rawFile.status == 200) { try { - let jsonObject = JSON.parse(rawFile.response) - callback(jsonObject) + let jsonObject = JSON.parse(rawFile.response); + callback(jsonObject); } catch (e) { - //console.log(e); + window.captureException && window.captureException(e); } } - } + }; rawFile.onerror = function () { - callBack(null) - } - rawFile.send(null) - } - - this.blocked = (dom, checkList, cfloor, topAd = 0, leftAd = 0) => { - const { top, left, right, bottom } = dom.getBoundingClientRect() - let corners = [ - [left + leftAd, top + topAd], - [right - leftAd, top + topAd], - [left + leftAd, bottom - topAd], - [right - leftAd, bottom - topAd] - ] - - for (let i = 0; i < corners.length; i++) { - const [x, y] = corners[i] - const raycaster = new THREE.Raycaster() - const p = new THREE.Vector2() - let ele = document.getElementById(options.containerId || 'mapContainer') - p.x = (x / parseInt(ele.clientWidth)) * 2 - 1 - p.y = -(y / parseInt(ele.clientHeight)) * 2 + 1 - - raycaster.setFromCamera(p, Map_QM.camera) - let intersects = raycaster.intersectObjects(checkList) - for (let t = 0; t < intersects.length; t++) { - if (intersects[t].object.userData.order > cfloor) { - return true - } - } - } - return false - } + callback(null); + }; + rawFile.send(null); + }; /**碰撞检测 * 传入A中心点和A的宽、高 * B的中心点和B的宽、高 */ 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 - } + 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 = [] + let areaArr = []; for (let i = 0; i < area.hasLines.length; i++) { - let line = area.hasLines[i] - let array = [] - array.push(line.startPoint.x, line.startPoint.y, line.endPoint.x, line.endPoint.y) - areaArr.push(array) + let line = area.hasLines[i]; + let array = []; + array.push( + line.startPoint.x, + line.startPoint.y, + line.endPoint.x, + line.endPoint.y + ); + areaArr.push(array); } - return areaArr - } + return areaArr; + }; this.changeAreaToString = function (area) { - let areaArr = [] + let areaArr = []; for (let i = 0; i < area.hasLines.length; i++) { - let line = area.hasLines[i] - let array = [] + let line = area.hasLines[i]; + let array = []; if (line.isStrLine) { - array.push(line.startPoint.x, line.startPoint.y, line.endPoint.x, line.endPoint.y) + array.push( + line.startPoint.x, + line.startPoint.y, + line.endPoint.x, + line.endPoint.y + ); } else { - array.push(line.startPoint.x, line.startPoint.y, line.ctrlPoint1.x, line.ctrlPoint1.y, line.ctrlPoint2.x, line.ctrlPoint2.y, line.endPoint.x, line.endPoint.y) + array.push( + line.startPoint.x, + line.startPoint.y, + line.ctrlPoint1.x, + line.ctrlPoint1.y, + line.ctrlPoint2.x, + line.ctrlPoint2.y, + line.endPoint.x, + line.endPoint.y + ); } - areaArr.push(array) + areaArr.push(array); } - return areaArr - } + return areaArr; + }; this.changeWallToString = function (area) { - let areaArr = [] - let points = Map_QM.util.getWallPoints(area.pathPoints, area.thick) + let areaArr = []; + let points = Map_QM.util.getWallPoints(area.pathPoints, area.thick); for (let i = 0; i < points.length; i++) { - let array = [] - let pend = i == points.length - 1 ? points[0] : points[i + 1] - array.push(points[i].x, points[i].y, pend.x, pend.y) - areaArr.push(array) + let array = []; + let pend = i == points.length - 1 ? points[0] : points[i + 1]; + array.push(points[i].x, points[i].y, pend.x, pend.y); + areaArr.push(array); } - return areaArr - } - - this.QM_Line_Father = function (sPoint, ePoint, ctrlPoint1, ctrlPoint2, isStrLine) { - this.startPoint = sPoint //起始点 - this.endPoint = ePoint //结束点 - this.ctrlPoint1 = ctrlPoint1 - this.ctrlPoint2 = ctrlPoint2 - this.isStrLine = isStrLine //是否是直线 - } + return areaArr; + }; + + this.QM_Line_Father = function ( + sPoint, + ePoint, + ctrlPoint1, + ctrlPoint2, + isStrLine + ) { + this.startPoint = sPoint; //起始点 + this.endPoint = ePoint; //结束点 + this.ctrlPoint1 = ctrlPoint1; + this.ctrlPoint2 = ctrlPoint2; + this.isStrLine = isStrLine; //是否是直线 + }; //根据配置参数转换店铺圆角 this.changeShopLinesToString = function (area) { - let areaStr = [] - let lines = [] + let areaStr = []; + let lines = []; for (let m = 0; m < area.hasLines.length; m++) { - let sPoint, ePoint, cPoint1, cPoint2 - sPoint = new Map_QM.util.Point(area.hasLines[m].startPoint.x, area.hasLines[m].startPoint.y) - ePoint = new Map_QM.util.Point(area.hasLines[m].endPoint.x, area.hasLines[m].endPoint.y) + let sPoint, ePoint, cPoint1, cPoint2; + sPoint = new Map_QM.util.Point( + area.hasLines[m].startPoint.x, + area.hasLines[m].startPoint.y + ); + ePoint = new Map_QM.util.Point( + area.hasLines[m].endPoint.x, + area.hasLines[m].endPoint.y + ); if (area.hasLines[m].isStrLine) { - cPoint1 = null - cPoint2 = null + cPoint1 = null; + cPoint2 = null; } else { - cPoint1 = new Map_QM.util.Point(area.hasLines[m].ctrlPoint1.x, area.hasLines[m].ctrlPoint1.y) - cPoint2 = new Map_QM.util.Point(area.hasLines[m].ctrlPoint2.x, area.hasLines[m].ctrlPoint2.y) + cPoint1 = new Map_QM.util.Point( + area.hasLines[m].ctrlPoint1.x, + area.hasLines[m].ctrlPoint1.y + ); + cPoint2 = new Map_QM.util.Point( + area.hasLines[m].ctrlPoint2.x, + area.hasLines[m].ctrlPoint2.y + ); } - let line = new Map_QM.util.QM_Line_Father(sPoint, ePoint, cPoint1, cPoint2, area.hasLines[m].isStrLine) - lines.push(line) + let line = new Map_QM.util.QM_Line_Father( + sPoint, + ePoint, + cPoint1, + cPoint2, + area.hasLines[m].isStrLine + ); + lines.push(line); } for (let i = 0; i < lines.length; i++) { - let line0 = lines[i] - let line1 = i < lines.length - 1 ? lines[i + 1] : lines[0] + let line0 = lines[i]; + let line1 = i < lines.length - 1 ? lines[i + 1] : lines[0]; if (Map_QM.util.options.aRadius > 2) { - if ( - line0.isStrLine && - line1.isStrLine && - Math.abs(line0.endPoint.x - line0.startPoint.x) + Math.abs(line0.endPoint.y - line0.startPoint.y) > parseInt(Map_QM.util.options.aRadius) * 2 - ) { - let x1 = line0.endPoint.x - let y1 = line0.endPoint.y - let x2 = line0.startPoint.x - let y2 = line0.startPoint.y - let x3 = line1.endPoint.x - let y3 = line1.endPoint.y + if (line0.isStrLine &&line1.isStrLine &&Math.abs(line0.endPoint.x - line0.startPoint.x) + Math.abs(line0.endPoint.y - line0.startPoint.y) > parseInt(Map_QM.util.options.aRadius) * 2) { + let x1 = line0.endPoint.x; + let y1 = line0.endPoint.y; + let x2 = line0.startPoint.x; + let y2 = line0.startPoint.y; + let x3 = line1.endPoint.x; + let y3 = line1.endPoint.y; if (Math.abs((x3 - x1) / (x2 - x1) - (y3 - y1) / (y2 - y1)) < 0.1) { - let yArr = [] - yArr.push(line0.startPoint.x, line0.startPoint.y, line0.endPoint.x, line0.endPoint.y) - areaStr.push(yArr) - continue + let yArr = []; + yArr.push(line0.startPoint.x,line0.startPoint.y, line0.endPoint.x, line0.endPoint.y); + areaStr.push(yArr); + continue; } - let result = Map_QM.util.getIncircleByLines(x1, y1, x2, y2, x3, y3, Map_QM.util.options.aRadius) - let bezierResult = Map_QM.util.getBezier( - result.center.x, - result.center.y, - result.tangencyPoints[0].x, - result.tangencyPoints[0].y, - result.tangencyPoints[1].x, - result.tangencyPoints[1].y, - x1, - y1, - Map_QM.util.options.aRadius - ) + let result = Map_QM.util.getIncircleByLines(x1,y1,x2,y2,x3,y3,Map_QM.util.options.aRadius); + let bezierResult = Map_QM.util.getBezier(result.center.x,result.center.y, result.tangencyPoints[0].x, result.tangencyPoints[0].y, result.tangencyPoints[1].x, result.tangencyPoints[1].y, x1, y1, Map_QM.util.options.aRadius); if (i > 0) { let ctrlPoint1, ctrlPoint2, - array = [] - ctrlPoint1 = ctrlPoint2 = new Map_QM.util.Point( - ((bezierResult[0].x - line0.startPoint.x) / 2 + line0.startPoint.x) >> 0, - ((bezierResult[0].y - line0.startPoint.y) / 2 + line0.startPoint.y) >> 0 - ) //控制点 - array.push(line0.startPoint.x, line0.startPoint.y, ctrlPoint1.x, ctrlPoint1.y, ctrlPoint2.x, ctrlPoint2.y, bezierResult[0].x, bezierResult[0].y) - areaStr.push(array) + array = []; + ctrlPoint1 = ctrlPoint2 = new Map_QM.util.Point(((bezierResult[0].x - line0.startPoint.x) / 2 + line0.startPoint.x) >>0, ((bezierResult[0].y - line0.startPoint.y) / 2 +line0.startPoint.y) >> 0); //控制点 + array.push( + line0.startPoint.x, + line0.startPoint.y, + ctrlPoint1.x, + ctrlPoint1.y, + ctrlPoint2.x, + ctrlPoint2.y, + bezierResult[0].x, + bezierResult[0].y + ); + areaStr.push(array); } else { - lines[0].endPoint.x = bezierResult[0].x - lines[0].endPoint.y = bezierResult[0].y + lines[0].endPoint.x = bezierResult[0].x; + lines[0].endPoint.y = bezierResult[0].y; } - let arr = [] - arr.push(bezierResult[0].x, bezierResult[0].y, bezierResult[1].x, bezierResult[1].y, bezierResult[2].x, bezierResult[2].y, bezierResult[3].x, bezierResult[3].y) - areaStr.push(arr) - line1.startPoint.x = bezierResult[3].x - line1.startPoint.y = bezierResult[3].y + let arr = []; + arr.push( + bezierResult[0].x, + bezierResult[0].y, + bezierResult[1].x, + bezierResult[1].y, + bezierResult[2].x, + bezierResult[2].y, + bezierResult[3].x, + bezierResult[3].y + ); + areaStr.push(arr); + line1.startPoint.x = bezierResult[3].x; + line1.startPoint.y = bezierResult[3].y; } else { ///////////////////////////// if (i != 0) { - let pArr = [] + let pArr = []; if (line0.isStrLine) { - pArr.push(line0.startPoint.x, line0.startPoint.y, line0.endPoint.x, line0.endPoint.y) + pArr.push( + line0.startPoint.x, + line0.startPoint.y, + line0.endPoint.x, + line0.endPoint.y + ); } else { pArr.push( line0.startPoint.x, @@ -673,420 +753,476 @@ QMUtil = function () { line0.ctrlPoint2.y, line0.endPoint.x, line0.endPoint.y - ) + ); } - areaStr.push(pArr) + areaStr.push(pArr); } } if (i == lines.length - 1) { let ocPoint1, ocPoint2, - oArr = [] + oArr = []; if (line1.isStrLine) { - oArr.push(line1.startPoint.x, line1.startPoint.y, line1.endPoint.x, line1.endPoint.y) + oArr.push( + line1.startPoint.x, + line1.startPoint.y, + line1.endPoint.x, + line1.endPoint.y + ); } else { - ocPoint1 = new Map_QM.util.Point(line1.ctrlPoint1.x, line1.ctrlPoint1.y) - ocPoint2 = new Map_QM.util.Point(line1.ctrlPoint2.x, line1.ctrlPoint2.y) - oArr.push(line1.startPoint.x, line1.startPoint.y, ocPoint1.x, ocPoint1.y, ocPoint2.x, ocPoint2.y, line1.endPoint.x, line1.endPoint.y) + ocPoint1 = new Map_QM.util.Point(line1.ctrlPoint1.x,line1.ctrlPoint1.y); + ocPoint2 = new Map_QM.util.Point(line1.ctrlPoint2.x,line1.ctrlPoint2.y); + oArr.push( + line1.startPoint.x, + line1.startPoint.y, + ocPoint1.x, + ocPoint1.y, + ocPoint2.x, + ocPoint2.y, + line1.endPoint.x, + line1.endPoint.y + ); } - areaStr.push(oArr) + areaStr.push(oArr); } } else { - let yArr = [] + let yArr = []; if (line0.isStrLine) { - yArr.push(line0.startPoint.x, line0.startPoint.y, line0.endPoint.x, line0.endPoint.y) + yArr.push(line0.startPoint.x, line0.startPoint.y, line0.endPoint.x,line0.endPoint.y); } else { yArr.push( - line0.startPoint.x, - line0.startPoint.y, - line0.ctrlPoint1.x, - line0.ctrlPoint1.y, - line0.ctrlPoint2.x, - line0.ctrlPoint2.y, - line0.endPoint.x, - line0.endPoint.y - ) + line0.startPoint.x,line0.startPoint.y, + line0.ctrlPoint1.x,line0.ctrlPoint1.y, + line0.ctrlPoint2.x, line0.ctrlPoint2.y, + line0.endPoint.x, line0.endPoint.y + ); } - areaStr.push(yArr) + areaStr.push(yArr); } } - return areaStr - } + return areaStr; + }; //根据圆心、两个切点、切点相交线顶点和半径 计算三次贝塞尔曲线的控制点 this.getBezier = function (x1, y1, x2, y2, x3, y3, x4, y4, radius) { //切线向量A - var vectorAx = x2 - x1 - var vectorAy = y2 - y1 + var vectorAx = x2 - x1; + var vectorAy = y2 - y1; //切线向量B - var vectorBx = x3 - x1 - var vectorBy = y3 - y1 + var vectorBx = x3 - x1; + var vectorBy = y3 - y1; //计算切点和圆形组成相交线的夹角 var angle = Math.acos( - (vectorAx * vectorBx + vectorAy * vectorBy) / (Math.sqrt(vectorAx * vectorAx + vectorAy * vectorAy) * Math.sqrt(vectorBx * vectorBx + vectorBy * vectorBy)) - ) + (vectorAx * vectorBx + vectorAy * vectorBy) / + (Math.sqrt(vectorAx * vectorAx + vectorAy * vectorAy) * + Math.sqrt(vectorBx * vectorBx + vectorBy * vectorBy)) + ); //计算切点到控制点的距离 - var tempDistence = (4 / 3) * radius * Math.tan(angle / 4) + var tempDistence = (4 / 3) * radius * Math.tan(angle / 4); return [ { x: x2, - y: y2 + y: y2, }, Map_QM.util.getPointFromLine(x2, y2, x4, y4, tempDistence), Map_QM.util.getPointFromLine(x3, y3, x4, y4, tempDistence), { x: x3, - y: y3 - } - ] - } + y: y3, + }, + ]; + }; //根据半径计算两条线段相切圆的圆心和切点坐标 this.getIncircleByLines = function (x1, y1, x2, y2, x3, y3, radius) { //向量夹角 - let angle = Map_QM.util.getVectorAngle(x2 - x1, y2 - y1, x3 - x1, y3 - y1) - angle = (angle > 180 ? 360 - angle : angle) / 2 + let angle = Map_QM.util.getVectorAngle(x2 - x1, y2 - y1, x3 - x1, y3 - y1); + angle = (angle > 180 ? 360 - angle : angle) / 2; //根据夹角计算侧边切点相对于顶点距离 - let distance = radius / Math.tan((Math.PI * angle) / 180) + let distance = radius / Math.tan((Math.PI * angle) / 180); //计算侧边相切点具体坐标 - let tangencyPoints = [Map_QM.util.getPointFromLine(x1, y1, x2, y2, distance), Map_QM.util.getPointFromLine(x1, y1, x3, y3, distance)] + let tangencyPoints = [ + Map_QM.util.getPointFromLine(x1, y1, x2, y2, distance), + Map_QM.util.getPointFromLine(x1, y1, x3, y3, distance), + ]; - let centerX, centerY - let areaSize = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1) + let centerX, centerY; + let areaSize = (x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1); //计算圆心坐标 if (areaSize < 0) { - centerX = (tangencyPoints[0].x * (1 / Math.tan((Math.PI * angle) / 180)) + tangencyPoints[0].y - y1) / (1 / Math.tan((Math.PI * angle) / 180)) - centerY = (tangencyPoints[0].y * (1 / Math.tan((Math.PI * angle) / 180)) + x1 - tangencyPoints[0].x) / (1 / Math.tan((Math.PI * angle) / 180)) + centerX = + (tangencyPoints[0].x * (1 / Math.tan((Math.PI * angle) / 180)) + + tangencyPoints[0].y -y1) /(1 / Math.tan((Math.PI * angle) / 180)); + centerY = (tangencyPoints[0].y * (1 / Math.tan((Math.PI * angle) / 180)) + x1 - tangencyPoints[0].x) /(1 / Math.tan((Math.PI * angle) / 180)); } else { - centerX = (tangencyPoints[1].x * (1 / Math.tan((Math.PI * angle) / 180)) + tangencyPoints[1].y - y1) / (1 / Math.tan((Math.PI * angle) / 180)) - centerY = (tangencyPoints[1].y * (1 / Math.tan((Math.PI * angle) / 180)) + x1 - tangencyPoints[1].x) / (1 / Math.tan((Math.PI * angle) / 180)) + centerX = (tangencyPoints[1].x * (1 / Math.tan((Math.PI * angle) / 180)) +tangencyPoints[1].y -y1) / (1 / Math.tan((Math.PI * angle) / 180)); + centerY = (tangencyPoints[1].y * (1 / Math.tan((Math.PI * angle) / 180)) + x1 -tangencyPoints[1].x) /(1 / Math.tan((Math.PI * angle) / 180)); } return { center: { x: centerX, - y: centerY + y: centerY, }, tangencyPoints: tangencyPoints, - angle: (Math.PI * angle) / 90 - } - } + angle: (Math.PI * angle) / 90, + }; + }; //根据距离计算线段上某一点的具体坐标 this.getPointFromLine = function (startX, startY, endX, endY, distance) { if (startX == endX) return { x: startX, - y: startY < endY ? startY + distance : startY - distance - } - - let k = ((startY - endY) * 1.0) / (startX - endX) - let b = startY - k * startX - let A = Math.pow(k, 2) + 1 - let B = 2 * ((b - startY) * k - startX) - let C = Math.pow(b - startY, 2) + Math.pow(startX, 2) - Math.pow(distance, 2) - 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) - let x = 0 - - if (x1 == x2) x = x1 - else if ((startX <= x1 && x1 <= endX) || (endX <= x1 && x1 <= startX)) x = x1 - else if ((startX <= x2 && x2 <= endX) || (endX <= x2 && x2 <= startX)) x = x2 - - let y = k * x + b + y: startY < endY ? startY + distance : startY - distance, + }; + + let k = ((startY - endY) * 1.0) / (startX - endX); + let b = startY - k * startX; + let A = Math.pow(k, 2) + 1; + let B = 2 * ((b - startY) * k - startX); + let C = + Math.pow(b - startY, 2) + Math.pow(startX, 2) - Math.pow(distance, 2); + 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); + let x = 0; + + if (x1 == x2) x = x1; + else if ((startX <= x1 && x1 <= endX) || (endX <= x1 && x1 <= startX)) + x = x1; + else if ((startX <= x2 && x2 <= endX) || (endX <= x2 && x2 <= startX)) + x = x2; + + let y = k * x + b; return { x: x, - y: y - } - } + y: y, + }; + }; //计算两个向量之间的夹角 this.getVectorAngle = function (x1, y1, x2, y2) { - let epsilon = 1.0e-6 - let dist, dot, degree, angle - dist = Math.sqrt(x1 * x1 + y1 * y1) - x1 /= dist - y1 /= dist - dist = Math.sqrt(x2 * x2 + y2 * y2) - x2 /= dist - y2 /= dist - dot = x1 * x2 + y1 * y2 - if (Math.abs(dot - 1.0) <= epsilon) angle = 0 - else if (Math.abs(dot + 1.0) <= epsilon) angle = Math.PI + let epsilon = 1.0e-6; + let dist, dot, degree, angle; + dist = Math.sqrt(x1 * x1 + y1 * y1); + x1 /= dist; + y1 /= dist; + dist = Math.sqrt(x2 * x2 + y2 * y2); + x2 /= dist; + y2 /= dist; + dot = x1 * x2 + y1 * y2; + if (Math.abs(dot - 1.0) <= epsilon) angle = 0; + else if (Math.abs(dot + 1.0) <= epsilon) angle = Math.PI; else { - angle = Math.acos(dot) - let cross = x1 * y2 - x2 * y1 - if (cross < 0) angle = 2 * Math.PI - angle + angle = Math.acos(dot); + let cross = x1 * y2 - x2 * y1; + if (cross < 0) angle = 2 * Math.PI - angle; } - degree = (angle * 180) / Math.PI - return degree - } + degree = (angle * 180) / Math.PI; + return degree; + }; //检测区域是否在区域内 true (area2包含area) this.checkAreaInArea = function (area, area2) { - let ptPolygon = [] + if (!area2.hasLines || !area.hasLines) { + return false; + } + let ptPolygon = []; for (let i = 0; i < area2.hasLines.length; i++) { - let line = area2.hasLines[i] - let pArr + let line = area2.hasLines[i]; + let pArr; if (line.isStrLine) { - pArr = Map_QM.util.getPointArrOnLine(line.startPoint, line.endPoint) + pArr = Map_QM.util.getPointArrOnLine(line.startPoint, line.endPoint); } else { - pArr = Map_QM.util.getPointArr(line.startPoint, line.ctrlPoint1, line.ctrlPoint2, line.endPoint, 0.1) + pArr = Map_QM.util.getPointArr(line.startPoint, line.ctrlPoint1,line.ctrlPoint2,line.endPoint,0.1); } - ptPolygon.push(...pArr) + ptPolygon.push(...pArr); } for (let f = 0; f < area.hasLines.length; f++) { - let line2 = area.hasLines[f] - let sPoint = Map_QM.util.checkBoundary(new Map_QM.util.Point(line2.startPoint.x, line2.startPoint.y), ptPolygon) - let ePoint = Map_QM.util.checkBoundary(new Map_QM.util.Point(line2.endPoint.x, line2.endPoint.y), ptPolygon) + let line2 = area.hasLines[f]; + let sPoint = Map_QM.util.checkBoundary(new Map_QM.util.Point(line2.startPoint.x, line2.startPoint.y),ptPolygon); + let ePoint = Map_QM.util.checkBoundary(new Map_QM.util.Point(line2.endPoint.x, line2.endPoint.y),ptPolygon); if (!sPoint || !ePoint) { - return false + return false; } } - return true - } + return true; + }; /** * 返回取得点的数组 * s1--起点 s2 --终点 s3,s4 --控制点 */ this.getPointArr = function (s1, s3, s4, s2, sp = 0.01) { - let pArr = [] - let sz = [s1, s3, s4, s2] - let p + let pArr = []; + let sz = [s1, s3, s4, s2]; + let p; for (let j = 0; j < 1; j += sp) { - p = Map_QM.util.P_BEZ(j, sz) - pArr.push(p) + p = Map_QM.util.P_BEZ(j, sz); + pArr.push(p); } - return pArr - } + return pArr; + }; this.P_BEZ = function (t, sz) { //n次 - let x_p = 0 - let y_p = 0 - let n = sz.length + let x_p = 0; + let y_p = 0; + let n = sz.length; for (let i = 0; i < sz.length; i++) { - let son = Map_QM.util.jie_cheng(n - 1) - let mother = Map_QM.util.jie_cheng(i) * Map_QM.util.jie_cheng(n - 1 - i) - let b = (son / mother) * Math.pow(t, i) * Math.pow(1 - t, n - 1 - i) - x_p += sz[i].x * b - y_p += sz[i].y * b + let son = Map_QM.util.jie_cheng(n - 1); + let mother = Map_QM.util.jie_cheng(i) * Map_QM.util.jie_cheng(n - 1 - i); + let b = (son / mother) * Math.pow(t, i) * Math.pow(1 - t, n - 1 - i); + x_p += sz[i].x * b; + y_p += sz[i].y * b; } - x_p = Number(x_p * 1000) / 1000 - y_p = Number(y_p * 1000) / 1000 - return new Map_QM.util.Point(x_p, y_p) - } + x_p = Number(x_p * 1000) / 1000; + y_p = Number(y_p * 1000) / 1000; + return new Map_QM.util.Point(x_p, y_p); + }; this.jie_cheng = function (i) { //阶乘 - let n = 1 + let n = 1; for (let j = 1; j <= i; j++) { - n *= j + n *= j; } - return n - } + return n; + }; /** * 获取线段上的所有点 */ this.getPointArrOnLine = function (s1, s2) { - let points = [] + let points = []; if (s1.x == s2.x) { - let vy = s1.y < s2.y ? 1 : -1 + let vy = s1.y < s2.y ? 1 : -1; for (let m = 1; m < Math.abs(s1.y - s2.y); m++) { - let y0 = s1.y + m * vy - let x0 = s1.x - points.push(new Map_QM.util.Point(x0, y0)) + let y0 = s1.y + m * vy; + let x0 = s1.x; + points.push(new Map_QM.util.Point(x0, y0)); } - return points + return points; } - let k = (s1.y - s2.y) / (s1.x - s2.x) // 坐标直线斜率k - let b = s1.y - k * s1.x // 坐标直线b + let k = (s1.y - s2.y) / (s1.x - s2.x); // 坐标直线斜率k + let b = s1.y - k * s1.x; // 坐标直线b if (Math.abs(s1.x - s2.x) > Math.abs(s1.y - s2.y)) { - let vx = s1.x < s2.x ? 1 : -1 + let vx = s1.x < s2.x ? 1 : -1; for (let i = 1; i < Math.abs(s1.x - s2.x); i++) { - let x0 = s1.x + i * vx - let y0 = k * x0 + b - points.push(new Map_QM.util.Point(x0, y0)) + let x0 = s1.x + i * vx; + let y0 = k * x0 + b; + points.push(new Map_QM.util.Point(x0, y0)); } } else { - let vy = s1.y < s2.y ? 1 : -1 + let vy = s1.y < s2.y ? 1 : -1; for (let n = 1; n < Math.abs(s1.y - s2.y); n++) { - let y0 = s1.y + n * vy - let x0 = (y0 - b) / k - points.push(new Map_QM.util.Point(x0, y0)) + let y0 = s1.y + n * vy; + let x0 = (y0 - b) / k; + points.push(new Map_QM.util.Point(x0, y0)); } } - return points - } + return points; + }; //转换公共设施type值 this.getFacType = function (str) { for (let i = 0; i < typeObj.length; i++) { if (typeObj[i].code && typeObj[i].code == str) { - return typeObj[i].type + return typeObj[i].type; } } - } + }; this.getFacName = function (str) { for (let i = 0; i < typeObj.length; i++) { if (typeObj[i].code && typeObj[i].code == str) { - return typeObj[i].name + return typeObj[i].name; } } - } + }; //店铺排序 this.sortShopByFloor = function (a, b) { - return a.floorOrder < b.floorOrder ? -1 : 1 - } + return a.floorOrder < b.floorOrder ? -1 : 1; + }; this.sortNode = function (a, b) { - return a.id - b.id - } + return a.id - b.id; + }; //////////////////////////////////////////////////////////////////////////////////////////// this.getWallPoints = function (points, wallWidth) { if (points.length < 2) { - return new Array() + return new Array(); } //构建线段列表 - let lines = new Array() + let lines = new Array(); for (let index = 0; index < points.length - 1; index++) { - let startPoint = points[index] - let endPoint = points[index + 1] - let line = Map_QM.util.getParallelLine(startPoint, endPoint, wallWidth) - lines.push(line) + let startPoint = points[index]; + let endPoint = points[index + 1]; + let line = Map_QM.util.getParallelLine(startPoint, endPoint, wallWidth); + lines.push(line); } //生成线段对应的左右两侧平行线 for (let index = 0; index < lines.length - 1; index++) { - let start = lines[index] - let end = lines[index + 1] - if (start.leftParLine != null && start.rightParLine != null && end.leftParLine != null && end.rightParLine != null) { - start.leftPoint = Map_QM.util.getIntersectionByLines(start.leftParLine, end.leftParLine) - start.rightPoint = Map_QM.util.getIntersectionByLines(start.rightParLine, end.rightParLine) + let start = lines[index]; + let end = lines[index + 1]; + if ( + start.leftParLine != null && + start.rightParLine != null && + end.leftParLine != null && + end.rightParLine != null + ) { + start.leftPoint = Map_QM.util.getIntersectionByLines( + start.leftParLine, + end.leftParLine + ); + start.rightPoint = Map_QM.util.getIntersectionByLines( + start.rightParLine, + end.rightParLine + ); } } //循环线段列表 获取墙体所有点位 顺序为 左侧起始点->左侧所有交点->左侧结束点->右侧结束点->右侧所有交点->右侧起始点 - let leftPointList = new Array() - let rightPointList = new Array() + let leftPointList = new Array(); + let rightPointList = new Array(); for (let index = 0; index < lines.length; index++) { //第一条线段 记录左右两侧平行线的起点坐标 if (index == 0) { - leftPointList.push(lines[index].leftParLine.start) - rightPointList.push(lines[index].rightParLine.start) + leftPointList.push(lines[index].leftParLine.start); + rightPointList.push(lines[index].rightParLine.start); } //最后一条线段 记录左右两侧平行线的终点坐标 if (index == lines.length - 1) { - leftPointList.push(lines[index].leftParLine.end) - rightPointList.push(lines[index].rightParLine.end) + leftPointList.push(lines[index].leftParLine.end); + rightPointList.push(lines[index].rightParLine.end); } else { //记录线段左右平行线交点坐标 - if (!isNaN(lines[index].leftPoint.x) || !isNaN(lines[index].leftPoint.y) || !isNaN(lines[index].rightPoint.x) || !isNaN(lines[index].rightPoint.y)) { - leftPointList.push(lines[index].leftPoint) - rightPointList.push(lines[index].rightPoint) + if ( + !isNaN(lines[index].leftPoint.x) || + !isNaN(lines[index].leftPoint.y) || + !isNaN(lines[index].rightPoint.x) || + !isNaN(lines[index].rightPoint.y) + ) { + leftPointList.push(lines[index].leftPoint); + rightPointList.push(lines[index].rightPoint); } } } - rightPointList.reverse() - return leftPointList.concat(rightPointList) - } + rightPointList.reverse(); + return leftPointList.concat(rightPointList); + }; //生成线段左右两侧的平行线 this.getParallelLine = function (start, end, wallWidth) { - let line = new Map_QM.util.WallLine(start, end) + let line = new Map_QM.util.WallLine(start, end); //计算当前线段的斜率 - let gradient = (start.y - end.y) / (start.x - end.x) + let gradient = (start.y - end.y) / (start.x - end.x); //计算垂直线的斜率 - let perGradient = -1 / gradient + let perGradient = -1 / gradient; //获取垂直线上左右两侧 与当前点位相距一定距离的两个定点 - let startResult = Map_QM.util.getParallelPoints(perGradient, start, wallWidth) - let endResult = Map_QM.util.getParallelPoints(perGradient, end, wallWidth) - let x1 = startResult[0].x - let y1 = startResult[0].y - let x2 = endResult[0].x - let y2 = endResult[0].y - let x3 = end.x - let y3 = end.y - let x4 = startResult[1].x - let y4 = startResult[1].y - let x5 = endResult[1].x - let y5 = endResult[1].y - let s = (x1 - x3) * (y2 - y3) - (y1 - y3) * (x2 - x3) + let startResult = Map_QM.util.getParallelPoints( perGradient, start, wallWidth); + let endResult = Map_QM.util.getParallelPoints(perGradient, end, wallWidth); + let x1 = startResult[0].x; + let y1 = startResult[0].y; + let x2 = endResult[0].x; + let y2 = endResult[0].y; + let x3 = end.x; + let y3 = end.y; + let x4 = startResult[1].x; + let y4 = startResult[1].y; + let x5 = endResult[1].x; + let y5 = endResult[1].y; + let s = (x1 - x3) * (y2 - y3) - (y1 - y3) * (x2 - x3); //判断点位位于线段的左侧还是右侧 if (s >= 0) { - line.leftParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x1, y1), new Map_QM.util.Point(x2, y2)) - line.rightParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x4, y4), new Map_QM.util.Point(x5, y5)) + line.leftParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x1, y1), new Map_QM.util.Point(x2, y2)); + line.rightParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x4, y4), new Map_QM.util.Point(x5, y5)); } else { - line.leftParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x4, y4), new Map_QM.util.Point(x5, y5)) - line.rightParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x1, y1), new Map_QM.util.Point(x2, y2)) + line.leftParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x4, y4), new Map_QM.util.Point(x5, y5)); + line.rightParLine = new Map_QM.util.WallLine(new Map_QM.util.Point(x1, y1), new Map_QM.util.Point(x2, y2)); } - return line - } + return line; + }; // 生成线段起始 和 结束 点位 对应的 两条 与线段垂直的直线 并记录坐标 this.getParallelPoints = function (gradient, point, wallWidth) { - let x, y + let x, y; //斜率为无穷大时 计算不了垂直线 指定点位 if (gradient == Number.NEGATIVE_INFINITY || gradient == Number.POSITIVE_INFINITY) { - x = point.x - y = point.y + 5 + x = point.x; + y = point.y + 5; } else { //不是横线时 根据斜率计算点位 - x = point.x + 5 - y = gradient * (x - point.x) + point.y + x = point.x + 5; + y = gradient * (x - point.x) + point.y; } - return Map_QM.util.pointXY(point, new Map_QM.util.Point(x, y), wallWidth / 2) - } + return Map_QM.util.pointXY( + point, + new Map_QM.util.Point(x, y), + wallWidth / 2 + ); + }; // 获取点位在直线上的坐标 this.pointXY = function (curPoint, nextPoint, length) { - let result = new Array() + let result = new Array(); //x值相等 说明是竖线 只需增减y轴坐标 if (curPoint.x == nextPoint.x) { - result.push(new Map_QM.util.Point(curPoint.x, curPoint.y + length)) - result.push(new Map_QM.util.Point(curPoint.x, curPoint.y - length)) - return result + result.push(new Map_QM.util.Point(curPoint.x, curPoint.y + length)); + result.push(new Map_QM.util.Point(curPoint.x, curPoint.y - length)); + return result; } //根据 斜率 和 距离 计算出对应的两个点位 - let k = (curPoint.y - nextPoint.y) / (curPoint.x - nextPoint.x) - let b = curPoint.y - k * curPoint.x - let A = Math.pow(k, 2) + 1 - let B = 2 * ((b - curPoint.y) * k - curPoint.x) - let C = Math.pow(b - curPoint.y, 2) + Math.pow(curPoint.x, 2) - Math.pow(length, 2) - 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(x1, k * x1 + b)) - result.push(new Map_QM.util.Point(x2, k * x2 + b)) - return result - } + let k = (curPoint.y - nextPoint.y) / (curPoint.x - nextPoint.x); + let b = curPoint.y - k * curPoint.x; + let A = Math.pow(k, 2) + 1; + let B = 2 * ((b - curPoint.y) * k - curPoint.x); + let C = + Math.pow(b - curPoint.y, 2) + + Math.pow(curPoint.x, 2) - + Math.pow(length, 2); + 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(x1, k * x1 + b)); + result.push(new Map_QM.util.Point(x2, k * x2 + b)); + return result; + }; //计算两条直线的相交点 this.getIntersectionByLines = function (line1, line2) { //直线斜率 - let gradient1 = (line1.end.y - line1.start.y) / (line1.end.x - line1.start.x) - let gradient2 = (line2.end.y - line2.start.y) / (line2.end.x - line2.start.x) + let gradient1 = + (line1.end.y - line1.start.y) / (line1.end.x - line1.start.x); + let gradient2 = + (line2.end.y - line2.start.y) / (line2.end.x - line2.start.x); //斜率差值小于一定范围 表示两条线近似平行 因为交点太远 可能超出屏幕 直接取线段中点为交点 - if (Math.abs(gradient1 - gradient2) < 0.1) return new Map_QM.util.Point(line1.end.x, line1.end.y) - let x1 = line1.start.x - let y1 = line1.start.y - let x2 = line1.end.x - let y2 = line1.end.y - let x3 = line2.start.x - let y3 = line2.start.y - let x4 = line2.end.x - let y4 = line2.end.y + if (Math.abs(gradient1 - gradient2) < 0.1) + return new Map_QM.util.Point(line1.end.x, line1.end.y); + let x1 = line1.start.x; + let y1 = line1.start.y; + let x2 = line1.end.x; + let y2 = line1.end.y; + let x3 = line2.start.x; + let y3 = line2.start.y; + let x4 = line2.end.x; + let y4 = line2.end.y; //计算交点坐标 - let x = ((x1 - x2) * (x3 * y4 - x4 * y3) - (x3 - x4) * (x1 * y2 - x2 * y1)) / ((x3 - x4) * (y1 - y2) - (x1 - x2) * (y3 - y4)) - let y = ((y1 - y2) * (x3 * y4 - x4 * y3) - (x1 * y2 - x2 * y1) * (y3 - y4)) / ((y1 - y2) * (x3 - x4) - (x1 - x2) * (y3 - y4)) - return new Map_QM.util.Point(x, y) - } - + let x = + ((x1 - x2) * (x3 * y4 - x4 * y3) - (x3 - x4) * (x1 * y2 - x2 * y1)) / + ((x3 - x4) * (y1 - y2) - (x1 - x2) * (y3 - y4)); + let y = + ((y1 - y2) * (x3 * y4 - x4 * y3) - (x1 * y2 - x2 * y1) * (y3 - y4)) / + ((y1 - y2) * (x3 - x4) - (x1 - x2) * (y3 - y4)); + return new Map_QM.util.Point(x, y); + }; /** * 根据色值获取材质 */ this.getMeshMaterial = function (color, alphaModle = 0.9) { - let meshMaterial + let meshMaterial; for (let k = 0; k < Map_QM.util.meshMaterialArr.length; k++) { - let color2 = new THREE.Color(color) - if (Map_QM.util.meshMaterialArr[k].color && Map_QM.util.meshMaterialArr[k].color.equals(color2) && Map_QM.util.meshMaterialArr[k].opacity == alphaModle) { - meshMaterial = Map_QM.util.meshMaterialArr[k] + let color2 = new THREE.Color(color); + if ( + Map_QM.util.meshMaterialArr[k].color && + Map_QM.util.meshMaterialArr[k].color.equals(color2) && + Map_QM.util.meshMaterialArr[k].opacity == alphaModle + ) { + meshMaterial = Map_QM.util.meshMaterialArr[k]; } } if (!meshMaterial) { @@ -1096,967 +1232,1126 @@ QMUtil = function () { specular: 0x000000, transparent: true, side: THREE.DoubleSide, - opacity: alphaModle - }) - Map_QM.util.meshMaterialArr.push(meshMaterial) + opacity: alphaModle, + }); + Map_QM.util.meshMaterialArr.push(meshMaterial); } - return meshMaterial - } + return meshMaterial; + }; this.rotateYZ = function (geometry, ry, rz) { - let center = new THREE.Vector3() - geometry.computeBoundingBox() - geometry.boundingBox.getCenter(center) - let x = center.x - let y = center.y - let z = center.z - geometry.center() - geometry.rotateY(ry) - geometry.rotateX(rz) - geometry.translate(x, y, z) - } -} + let center = new THREE.Vector3(); + geometry.computeBoundingBox(); + geometry.boundingBox.getCenter(center); + let x = center.x; + let y = center.y; + let z = center.z; + geometry.center(); + geometry.rotateY(ry); + geometry.rotateX(rz); + geometry.translate(x, y, z); + }; + //用于生成uuid + this.guid = function () { + function S4() { + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); + } + return S4() + S4() + S4(); + }; + + this.getTextMesh = function (text, position) { + const sprite = new SpriteText(text, 32, "#000000"); + sprite.padding = 2; + sprite.fontSize = 32; + sprite.strokeWidth = 2; + sprite.renderOrder = 100; + sprite.fontWeight = "500"; + sprite.material.transparent = true; + sprite.material.alphaTest = 0.1; + sprite.material.sizeAttenuation = false; + sprite.position.set(position.x, position.y, position.z + 24); + return sprite; + }; +}; //////////////////////////////-------------------------------------------配置 UtilFun /** * 地图主类,入口 初始化设备点位 */ -MainMap_QM = function (callBack, options) { - this.util = new QMUtil() - this.callBackLoadOver = callBack - this.ele = document.getElementById(options.containerId || 'mapContainer') - this.w = parseInt(this.ele.clientWidth) || parseInt(window.getComputedStyle(this.ele, null).getPropertyValue('width')) - this.h = parseInt(this.ele.clientHeight) || parseInt(window.getComputedStyle(this.ele, null).getPropertyValue('height')) - this.backObj = { code: 200, msg: '加载成功', data: [] } - this.scene = new THREE.Scene() - this.scene.name = 'scene' - this.aspect = this.w / this.h - this.cameraPerspective = new THREE.PerspectiveCamera(45, this.aspect, 10, 10000) - this.cameraPerspective.position.set(this.util.sceneGap.cameraX, this.util.sceneGap.cameraY, this.util.sceneGap.cameraZ) //x 水平 y 垂直旋转 z 展示大小 - this.cameraPerspective.lookAt(new THREE.Vector3(0, 0, 0)) - +var MainMap_QM = function (callBack, options) { + this.util = new QMUtil(); + this.callBackLoadOver = callBack; + this.ele = document.getElementById(options.containerId || "mapContainer"); + this.w = parseInt(this.ele.clientWidth) || parseInt(window.getComputedStyle(this.ele, null).getPropertyValue("width")); + this.h = parseInt(this.ele.clientHeight) ||parseInt(window.getComputedStyle(this.ele, null).getPropertyValue("height")); + this.backObj = { code: 200, msg: "加载成功", data: [] }; + this.scene = new THREE.Scene(); + this.scene.name = "scene"; + //this.scene.fog = new THREE.Fog(0xe5e5e5,this.util.options.maxDis,this.util.options.maxDis + 500); + this.aspect = this.w / this.h; + this.cameraPerspective = new THREE.PerspectiveCamera(45,this.aspect,10,10000); + this.cameraPerspective.position.set(this.util.sceneGap.cameraX,this.util.sceneGap.cameraY,this.util.sceneGap.cameraZ); //x 水平 y 垂直旋转 z 展示大小 + this.cameraPerspective.lookAt(new THREE.Vector3(0, 0, 0)); this.cameraOrtho = new THREE.OrthographicCamera(-150 * this.aspect, 150 * this.aspect, 150, -150, 10, 10000) this.cameraOrtho.position.set(this.util.sceneGap.cameraX, this.util.sceneGap.cameraY, this.util.sceneGap.cameraZ) - this.cameraOrtho.lookAt(new THREE.Vector3(0, 0, 0)) - this.camera = this.cameraPerspective + this.cameraOrtho.lookAt(new THREE.Vector3(0, 0, 0)); + this.camera = this.cameraPerspective; // - this.renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true, preserveDrawingBuffer: true }) // preserveDrawingBuffer 是否可以截图 + this.renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true }); // preserveDrawingBuffer 是否可以截图 //this.renderer.outputEncoding = THREE.sRGBEncoding; - this.renderer.setSize(this.w, this.h) - this.renderer.setPixelRatio(window.devicePixelRatio) - this.renderer.shadowMap.enabled = false - this.ele.appendChild(this.renderer.domElement) - - this.labelRenderer = new THREE.CSS2DRenderer() + this.renderer.setSize(this.w, this.h); + this.renderer.setPixelRatio(window.devicePixelRatio); + this.renderer.shadowMap.enabled = false; + // 阴影类型 + this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; + this.ele.appendChild(this.renderer.domElement); + + this.labelRenderer = new THREE.CSS2DRenderer(); //弹窗的偏移百分比 或者像素 - this.labelRenderer.setSize(this.w, this.h, options.perc_H || '-50%') - this.labelRenderer.domElement.style.position = 'absolute' - this.labelRenderer.domElement.style.top = 0 - this.ele.appendChild(this.labelRenderer.domElement) - - let light = new THREE.AmbientLight(0xffffff, 0.4) - light.name = 'light' - this.scene.add(light) - - this.hemiLight = new THREE.HemisphereLight(this.util.lightOptions.s_col, this.util.lightOptions.g_col, this.util.lightOptions.a_int) - this.hemiLight.name = 'light' - this.hemiLight.position.set(0, 1, 1) - this.scene.add(this.hemiLight) - - this.shawLight = new THREE.DirectionalLight(this.util.lightOptions.d_col, this.util.lightOptions.d_int) - this.shawLight.name = 'light' - this.shawLight.position.set(280, 400, -300) - this.scene.add(this.shawLight) - - this.mixers = [] - this.controls = new THREE.OrbitControls(this.camera, this.ele) - //鼠标控制 - //this.controls.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT }; - //this.controls.enabled = true; - this.controls.minZoom = 0.8 - this.controls.maxZoom = this.util.options.camZoom + this.labelRenderer.setSize(this.w, this.h, options.perc_H || "-50%"); + this.labelRenderer.domElement.style.position = "absolute"; + this.labelRenderer.domElement.style.top = 0; + this.ele.appendChild(this.labelRenderer.domElement); + + let light = new THREE.AmbientLight(0xffffff, 0.4); + light.name = "light"; + this.scene.add(light); + this.hemiLight = new THREE.HemisphereLight(this.util.lightOptions.s_col,this.util.lightOptions.g_col,this.util.lightOptions.a_int); + this.hemiLight.name = "light"; + this.hemiLight.position.set(0, 1, 0); + this.scene.add(this.hemiLight); + + this.shawLight = new THREE.DirectionalLight(this.util.lightOptions.d_col,this.util.lightOptions.d_int); + this.shawLight.name = "light"; + this.shawLight.position.set(280, 400, -300); + this.scene.add(this.shawLight); + + this.controls = new THREE.OrbitControls(this.camera, this.ele); + this.controls.minZoom = 0.8; + this.controls.maxZoom = 2; //设置相机距离原点的最远距离 - this.controls.minDistance = this.util.options.minDis + this.controls.minDistance = this.util.options.minDis; //设置相机距离原点的最远距离 - this.controls.maxDistance = this.util.options.maxDis - this.controls.minPolarAngle = 0 // 0是为了兼容2D模式 - this.controls.maxPolarAngle = Math.PI / 2 - 0.2 // radians - - if (debug) { - stats = new Stats() - stats.setMode(1) // 0: fps, 1: ms - stats.domElement.style.position = 'absolute' //绝对坐标 - stats.domElement.style.left = '10px' // (0,0)px,左上角 - stats.domElement.style.top = '60px' - this.ele.appendChild(stats.domElement) - } - this.ele.addEventListener("wheel", this.disPlayEvent); - this.ele.addEventListener("mouseup", this.disPlayEvent); - this.ele.addEventListener("touchmove", this.mouseMove); - this.ele.addEventListener('touchend',this.mouseUp); - this.ele.addEventListener('click', this.onMouseClickBox) //地图点击 - document.addEventListener('resize', this.changeDocmentResize) //窗口变化 - this.mapArr = [] - this.selectShop - this.selectEle = null //当前使用的电梯 - this.overShop //终点店铺 - this.shape = new THREE.Shape() - this.shape.moveTo(-10, -10) - this.shape.lineTo(10, -10) - this.shape.lineTo(10, 10) - this.shape.lineTo(-10, 10) - this.dtLineGroup = new THREE.Group() - this.dtLineGroup.name = 'dtLine' - - if (document.getElementById('moveFloorBG')) { - document.getElementById('moveFloorBG').style.zIndex = 500; - this.moveFloorbg = new THREE.CSS2DObject(document.getElementById('moveFloorBG')) + this.controls.maxDistance = this.util.options.maxDis; + this.controls.minPolarAngle = 0; // 0是为了兼容2D模式 + this.controls.maxPolarAngle = Math.PI / 2 - 0.2; // radians + + this.ele.addEventListener("click", this.onMouseClickBox); //地图点击 + document.addEventListener("resize", this.changeDocmentResize); //窗口变化 + this.mapArr = []; + this.selectShop; + this.selectEle = null; //当前使用的电梯 + this.overShop; //终点店铺 + this.shape = new THREE.Shape(); + this.shape.moveTo(-10, -10); + this.shape.lineTo(10, -10); + this.shape.lineTo(10, 10); + this.shape.lineTo(-10, 10); + this.dtLineGroup = new THREE.Group(); + this.dtLineGroup.name = "dtLine"; + + if (document.getElementById("moveFloorBG")) { + document.getElementById("moveFloorBG").style.zIndex = 500; + this.moveFloorbg = new THREE.CSS2DObject( + document.getElementById("moveFloorBG") + ); this.moveFloorbg.userData.isShow = false; } - this.mixers = [] - this.man_3d=null - this.man_2d=null - this.guide=null - this.sceneGap = new THREE.Group() - this.outModelGap = new THREE.Group() //全局外立面模型 - this.scene.add(this.outModelGap) - this.peripheryGap = new THREE.Group() //周边模型 - this.scene.add(this.peripheryGap) - this.outObject = new THREE.Object3D() - this.outObject.userData.type = "moveFloor" - this.perObject = new THREE.Object3D() - this.perObject.userData.type = "moveFloor" - this.buildObj = new THREE.Group() - this.qiModel=null //起点 - this.qiIcon=null //起点Icon - this.dirIcon=null //我的方向Icon - this.endIcon=null //终点Icon - this.endModel=null - this.forShopArr = [] //途径数据 - this.getInstance(options) -} + this.mixers = []; + this.man_3d = null; + this.man_2d = null; + this.guide = null; + this.devModel = null; + this.sceneGap = new THREE.Group(); + this.outModelGap = new THREE.Group(); //全局外立面模型 + this.scene.add(this.outModelGap); + this.peripheryGap = new THREE.Group(); //周边模型 + this.scene.add(this.peripheryGap); + this.outObject = new THREE.Object3D(); + this.outObject.userData.type = "moveFloor"; + this.perObject = new THREE.Object3D(); + this.perObject.userData.type = "moveFloor"; + this.buildObj = new THREE.Group(); + this.qiModel = null; //起点 + this.qiIcon = null; //起点Icon + this.endIcon = null; //终点Icon + this.endModel = null; + this.forShopArr = []; //途径数据 + this.getInstance(options); + if (this.util.options.northShow) { + this.util.img = document.createElement("img"); + this.util.img.src = "./static/img/noth.png"; + this.util.img.classList.add("north"); + this.ele.appendChild(this.util.img); + } +}; MainMap_QM.prototype = { - mouseMove:function(){ - Map_QM.disPlayEvent() + resetModel: function () { + if (mapState == "mall") { + Map_QM.buildObj.visible = true; + Map_QM.controls.reset(); + startRotate = false; + Map_QM.controls.setDistance(Map_QM.util.changeDist.inner - 25); + } else if (mapState == "out") { + Map_QM.controls.reset(); + Map_QM.controls.setDistance(Map_QM.util.changeDist.inner + 30); + Map_QM.outModelGap.rotateY(-1 * Map_QM.outModelGap.rotation.y); + startRotate = true; + } else { + Map_QM.controls.reset(); + Map_QM.controls.setDistance(Map_QM.util.changeDist.outner + 25); + startRotate = false; + } + Map_QM.controls.update(); + renderCount = 0; }, - mouseUp:function(){ - Map_QM.disPlayEvent() + + /** + * @api {方法} getPointByNode() 获取导航点位的坐标 + * @apiGroup 地图交互 + * @apiDescription 获取导航点位的坐标 + * @apiVersion 4.0.0 + * @apiParam {String} str 导航点位 + * + * @apiSampleRequest off + * @apiParamExample {String} 请求示例 + * + * Map_QM.getPointByNode("0_0_1"); + */ + getPointByNode: function (str) { + let nodes = str.split("_"); + if (nodes.length > 2 && !isNaN(parseInt(nodes[2])) && parseInt(nodes[2])>=0) { + Map_QM.util.allMap[nodes[0]].buildArr[nodes[1]].mapData.path.nodes.sort(Map_QM.util.sortNode); + return Map_QM.util.allMap[nodes[0]].buildArr[nodes[1]].mapData.path.nodes[nodes[2]]; + }else{ + return {x:-5000,y:-5000,msg:"未打点"}; + } }, getInstance: function (options) { - this.util.startObj.build = this.util.deviceObj.build = parseInt(options.build) || 0 - this.util.startObj.node = this.util.deviceObj.node = parseInt(options.navPoint) || 1 - this.util.deviceObj.angle = parseInt(options.angle) || 0 - this.util.selectBuild = this.util.deviceObj.build - let _space = this + this.util.startObj.build = this.util.deviceObj.build = parseInt(options.build) || 0; + this.util.startObj.node = this.util.deviceObj.node = parseInt(options.navPoint) || 1; + this.util.deviceObj.angle = parseInt(options.angle) || 0; + this.util.selectBuild = this.util.deviceObj.build; + let _space = this; if (options.mallCode) { - let tim = this.util.timeStamp() - this.util.requestNoJM({ - method: "GET", - url: options.url + "/api/info/v1/web/getUploadUrl", - success: (res)=>{ - _space.tomUrl = res.data; - this.util.requestNoJM({ - method: "GET", - url: _space.tomUrl + "/ar/"+options.mallCode+"/config.json?a="+tim, - success: (res)=>{ - _space.util.shopServerInfo = res.shopUrl - _space.util.mapServerInfo = res.mapUrl - _space.initLoadMapFile(options) - }, - fail:()=>{ - _space.backObj.code = 404 - _space.backObj.msg = "地图数据获取失败" - _space.callBackLoadOver(_space.backObj) - _space.callBackLoadOver = null - } - }) - }, - fail:()=>{ - this.util.requestNoJM({ - method: "GET", - url: _space.tomUrl + "/ar/"+options.mallCode+"/config.json?a="+tim, - success: (res)=>{ - _space.util.shopServerInfo = res.shopUrl - _space.util.mapServerInfo = res.mapUrl - _space.initLoadMapFile(options) - }, - fail:()=>{ - _space.backObj.code = 404 - _space.backObj.msg = "地图数据获取失败" - _space.callBackLoadOver(_space.backObj) - _space.callBackLoadOver = null - } - }) - } - }) - } else { + let tim = this.util.timeStamp(); + this.util.requestNoJM({ + method: "GET", + url: options.url + "/api/info/v1/web/getUploadUrl", + success: (res) => { + let resText = res.data; + if (typeof resText === "string" &&resText.search("https://") === -1) { + resText = JSON.parse(_space.util.decrypt(res.data)); + } + _space.tomUrl = resText; + this.util.requestNoJM({ + method: "GET", + url: _space.tomUrl + "/ar/" + options.mallCode +"/config.json?a=" +tim, + success: (res) => { + _space.util.shopServerInfo = res.shopUrl; + _space.util.mapServerInfo = res.mapUrl; + _space.initLoadMapFile(options); + }, + fail: () => { + _space.backObj.code = 404; + _space.backObj.msg = "地图数据获取失败"; + _space.callBackLoadOver(_space.backObj); + _space.callBackLoadOver = null; + }, + }); + }, + fail: () => { + this.util.requestNoJM({ + method: "GET", + url: _space.tomUrl +"/ar/" +options.mallCode +"/config.json?a=" +tim, + success: (res) => { + _space.util.shopServerInfo = res.shopUrl; + _space.util.mapServerInfo = res.mapUrl; + _space.initLoadMapFile(options); + }, + fail: () => { + _space.backObj.code = 404; + _space.backObj.msg = "地图数据获取失败"; + _space.callBackLoadOver(_space.backObj); + _space.callBackLoadOver = null; + }, + }); + }, + }); + } else { if (options.mapData) { - try { - if (options.mapData.mallKey != 'Zeditor') { - _space.util.allMap = JSON.parse(options.mapData.mapData) - } else { - _space.util.allMap = JSON.parse(LZString.decompressFromBase64(options.mapData.mapData)) - } - console.log("地图数据更新时间: " + options.mapData.updateTime); - } catch (e) { - console.log(e) - backObj.code = 404 - backObj.msg = '地图数据JSON格式错误' - callBack(backObj) - callBack = null - return; - } - _space.util.shopData = options.shopData; - _space.initOptions(options); - } else { - _space.initLoadMapFile(options); - } - } - }, - initLoadMapFile:function(options){ - _space = this - _space.util.readTextFile(_space.util.mapServerInfo, function (res) { - console.log(res) - if(res){ - try { - if(Array.isArray(res.data)){ - for(let map of res.data){ - if (map.mapKey == "Aeditor") { - _space.util.allMap = JSON.parse(map.mapData); - break; - } - } - }else{ - if (res.data.mallKey != "Zeditor") { - _space.util.allMap = JSON.parse(res.data.mapData); - } else { - _space.util.allMap = JSON.parse(LZString.decompressFromBase64(res.data.mapData)); - } - } - console.log("地图数据更新时间: " + res.data.updateTime); - } catch (e) { - console.log(e); - _space.backObj.code = 404; - _space.backObj.msg = "地图数据JSON格式错误"; - _space.callBackLoadOver(_space.backObj); - _space.callBackLoadOver = null; - return; - } - _space.util.readTextFile(_space.util.shopServerInfo, function (res) { - _space.util.shopData = []; - if(res){ - if(res.data.length>4){ //不是楼栋 - _space.util.shopData = res.data; - }else{ - res.data.forEach((item)=>{ - for(let shop of item){ - _space.util.shopData.push(...shop.shopList); - } - }) - } - } - _space.initOptions(options); - }); - }else{ - console.log(e); - _space.backObj.code = 404; - _space.backObj.msg = "地图数据JSON格式错误"; - _space.callBackLoadOver(_space.backObj); - _space.callBackLoadOver = null; - return; - } - }); - }, + try { + _space.util.allMap = JSON.parse(options.mapData.mapData); + console.log("地图数据更新时间: " + options.mapData.updateTime); + } catch (e) { + window.captureException && window.captureException(e); + console.log(e); + _space.backObj.code = 404; + _space.backObj.msg = "地图数据JSON格式错误"; + _space.callBackLoadOver(_space.backObj); + return; + } + _space.util.shopData = options.shopData; + _space.initOptions(options); + } else { + _space.initLoadMapFile(options); + } + } + }, + + initLoadMapFile: function (options) { + let _space = this; + _space.util.readTextFile(_space.util.mapServerInfo, function (res) { + if (res) { + try { + if (Array.isArray(res.data)) { + for (let map of res.data) { + _space.util.allMap = JSON.parse(map.mapData); + } + } else { + _space.util.allMap = JSON.parse(res.data.mapData); + console.log("地图数据更新时间: " + res.data.updateTime); + } + } catch (e) { + window.captureException && window.captureException(e); + console.log(e); + _space.backObj.code = 404; + _space.backObj.msg = "地图数据JSON格式错误"; + _space.callBackLoadOver(_space.backObj); + _space.callBackLoadOver = null; + return; + } + _space.util.readTextFile(_space.util.shopServerInfo, function (res) { + _space.util.shopData = []; + if (res) { + console.log("shopData: ",res.data); + res.data.forEach((item) => { + for (let shop of item) { + _space.util.shopData.push(...shop.shopList); + } + }); + } + _space.initOptions(options); + }); + } else { + _space.backObj.code = 404; + _space.backObj.msg = "地图数据JSON格式错误"; + _space.callBackLoadOver(_space.backObj); + _space.callBackLoadOver = null; + return; + } + }); + }, + initOptions: function (options) { //初始化参数 if (this.util.allMap[this.util.selectBuild].playSpeed) { - this.util.allMap[this.util.selectBuild].hasOwnProperty('scale') && (this.util.options.mapScale = parseInt(this.util.allMap[this.util.selectBuild].scale)) - this.util.allMap[this.util.selectBuild].hasOwnProperty('playSpeed') && (this.util.options.playSpeed = parseInt(this.util.allMap[this.util.selectBuild].playSpeed)) - this.util.allMap[this.util.selectBuild].hasOwnProperty('collision') && (this.util.options.collision = this.util.allMap[this.util.selectBuild].collision) - this.util.allMap[this.util.selectBuild].hasOwnProperty('navColor') && (this.util.options.navColor = this.util.allMap[this.util.selectBuild].navColor) - this.util.allMap[this.util.selectBuild].hasOwnProperty('aRadius') && (this.util.options.aRadius = parseInt(this.util.allMap[this.util.selectBuild].aRadius)) - this.util.allMap[this.util.selectBuild].hasOwnProperty('boxShop') && (this.util.options.boxShop = this.util.allMap[this.util.selectBuild].boxShop.split(',')) - this.util.allMap[this.util.selectBuild].hasOwnProperty('shopStyle') && (this.util.options.shopStyle = this.util.allMap[this.util.selectBuild].shopStyle) - this.util.allMap[this.util.selectBuild].hasOwnProperty('modelIcon') && (this.util.options.modelIcon = this.util.allMap[this.util.selectBuild].modelIcon) - this.util.allMap[this.util.selectBuild].hasOwnProperty('facSize') && (this.util.options.facSize = this.util.allMap[this.util.selectBuild].facSize) - this.util.allMap[this.util.selectBuild].hasOwnProperty('m_scale') && (this.util.sceneGap.scale = this.util.allMap[this.util.selectBuild].m_scale) - - this.hemiLight.color = new THREE.Color(this.util.allMap[this.util.selectBuild].s_col || '#fffff0') - this.hemiLight.groundColor = new THREE.Color(this.util.allMap[this.util.selectBuild].g_col || '#ffffff') - this.hemiLight.intensity = this.util.allMap[this.util.selectBuild].a_int || 0.5 - this.shawLight.color = new THREE.Color(this.util.allMap[this.util.selectBuild].d_col || '#ffffff') - this.shawLight.intensity = this.util.allMap[this.util.selectBuild].d_int || 0.1 - - if (this.util.allMap[this.util.selectBuild].c_site && this.util.allMap[this.util.selectBuild].c_site.split(',')) { - this.util.sceneGap.cameraX = parseInt(this.util.allMap[this.util.selectBuild].c_site.split(',')[0]) || this.util.sceneGap.cameraX - this.util.sceneGap.cameraY = parseInt(this.util.allMap[this.util.selectBuild].c_site.split(',')[1]) || this.util.sceneGap.cameraY - this.util.sceneGap.cameraZ = parseInt(this.util.allMap[this.util.selectBuild].c_site.split(',')[2]) || this.util.sceneGap.cameraZ - } - if (this.util.allMap[this.util.selectBuild].m_site && this.util.allMap[this.util.selectBuild].m_site.split(',')) { - this.util.sceneGap.x = parseInt(this.util.allMap[this.util.selectBuild].m_site.split(',')[0]) || this.util.sceneGap.x - this.util.sceneGap.y = parseInt(this.util.allMap[this.util.selectBuild].m_site.split(',')[1]) || this.util.sceneGap.y - this.util.sceneGap.z = parseInt(this.util.allMap[this.util.selectBuild].m_site.split(',')[2]) || this.util.sceneGap.z + this.util.allMap[this.util.selectBuild].hasOwnProperty("scale") && (this.util.options.mapScale = parseInt(this.util.allMap[this.util.selectBuild].scale)); + this.util.allMap[this.util.selectBuild].hasOwnProperty("playSpeed") && (this.util.options.playSpeed = parseInt( this.util.allMap[this.util.selectBuild].playSpeed)); + this.util.allMap[this.util.selectBuild].hasOwnProperty("collision") && (this.util.options.collision = this.util.allMap[this.util.selectBuild].collision); + this.util.allMap[this.util.selectBuild].hasOwnProperty("navColor") && (this.util.options.navColor = this.util.allMap[this.util.selectBuild].navColor); + this.util.allMap[this.util.selectBuild].hasOwnProperty("aRadius") && (this.util.options.aRadius = parseInt( this.util.allMap[this.util.selectBuild].aRadius)); + this.util.allMap[this.util.selectBuild].hasOwnProperty("boxShop") && (this.util.options.boxShop = this.util.allMap[this.util.selectBuild].boxShop.split(",")); + this.util.allMap[this.util.selectBuild].hasOwnProperty("shopStyle") && (this.util.options.shopStyle = this.util.allMap[this.util.selectBuild].shopStyle); + this.util.allMap[this.util.selectBuild].hasOwnProperty("modelIcon") && (this.util.options.modelIcon = this.util.allMap[this.util.selectBuild].modelIcon); + this.util.allMap[this.util.selectBuild].hasOwnProperty("facSize") && (this.util.options.facSize = this.util.allMap[this.util.selectBuild].facSize); + this.util.allMap[this.util.selectBuild].hasOwnProperty("m_scale") && (this.util.sceneGap.scale = this.util.allMap[this.util.selectBuild].m_scale); + this.hemiLight.color = new THREE.Color(this.util.allMap[this.util.selectBuild].s_col || "#fffff0"); + this.hemiLight.groundColor = new THREE.Color(this.util.allMap[this.util.selectBuild].g_col || "#ffffff"); + this.hemiLight.intensity = this.util.allMap[this.util.selectBuild].a_int || 0.6; + this.shawLight.color = new THREE.Color( this.util.allMap[this.util.selectBuild].d_col || "#ffffff"); + this.shawLight.intensity = this.util.allMap[this.util.selectBuild].d_int || 0.3; + + if (this.util.allMap[this.util.selectBuild].c_site && this.util.allMap[this.util.selectBuild].c_site.split(",")) { + this.util.sceneGap.cameraX = parseInt(this.util.allMap[this.util.selectBuild].c_site.split(",")[0]) || this.util.sceneGap.cameraX; + this.util.sceneGap.cameraY = parseInt(this.util.allMap[this.util.selectBuild].c_site.split(",")[1]) || this.util.sceneGap.cameraY; + this.util.sceneGap.cameraZ = parseInt(this.util.allMap[this.util.selectBuild].c_site.split(",")[2]) || this.util.sceneGap.cameraZ; + } + if (this.util.allMap[this.util.selectBuild].m_site && this.util.allMap[this.util.selectBuild].m_site.split(",")) { + this.util.sceneGap.x = parseInt(this.util.allMap[this.util.selectBuild].m_site.split(",")[0]) || this.util.sceneGap.x; + this.util.sceneGap.y = parseInt(this.util.allMap[this.util.selectBuild].m_site.split(",")[1]) || this.util.sceneGap.y; + this.util.sceneGap.z = parseInt(this.util.allMap[this.util.selectBuild].m_site.split(",")[2]) || this.util.sceneGap.z; } if (this.util.allMap[this.util.selectBuild].m_zoom) { - this.util.m_zoom = this.util.allMap[this.util.selectBuild].m_zoom - } - } - let { playSpeed, collision, modelIcon, shopStyle, shadow, otherPath, navColor, iconUrl, iconName, camZoom, inArea, pathColor, pathStyle } = options; - this.util.options.playSpeed = playSpeed != undefined ? playSpeed : this.util.options.playSpeed - this.util.options.collision = collision != undefined ? collision : this.util.options.collision - this.util.options.modelIcon = modelIcon != undefined ? modelIcon : this.util.options.modelIcon - this.util.options.shadow = shadow!= undefined ? shadow : this.util.options.shadow - this.util.options.shopStyle = shopStyle != undefined ? shopStyle : this.util.options.shopStyle - this.util.options.otherPath = otherPath != undefined ? otherPath : this.util.options.otherPath - this.util.options.navColor = navColor != undefined ? navColor : this.util.options.navColor - this.util.options.iconName = iconName != undefined ? iconName : this.util.options.iconName - this.util.options.camZoom = camZoom != undefined ? camZoom : this.util.options.camZoom - this.util.options.inArea = inArea!= undefined ? inArea : this.util.options.inArea - this.util.options.pathColor = pathColor != undefined ? pathColor : this.util.options.pathColor - this.util.options.pathStyle = pathStyle != undefined ? pathStyle : this.util.options.pathStyle - this.util.iconUrl = iconUrl != undefined ? iconUrl : [] + this.util.m_zoom = this.util.allMap[this.util.selectBuild].m_zoom; + } + } + let { playSpeed, collision, modelIcon, shopStyle, shadow, otherPath, navColor, iconUrl, iconName, inArea, pathColor, pathStyle} = options; + + this.util.options.playSpeed = playSpeed != undefined ? playSpeed : this.util.options.playSpeed; + this.util.options.collision = collision != undefined ? collision : this.util.options.collision; + this.util.options.modelIcon = modelIcon != undefined ? modelIcon : this.util.options.modelIcon; + this.util.options.shopStyle = shopStyle != undefined ? shopStyle : this.util.options.shopStyle; + this.util.options.otherPath = otherPath != undefined ? otherPath : this.util.options.otherPath; + this.util.options.navColor = navColor != undefined ? navColor : this.util.options.navColor; + this.util.options.iconName = iconName != undefined ? iconName : this.util.options.iconName; + this.util.options.inArea = inArea != undefined ? inArea : this.util.options.inArea; + this.util.options.pathColor = pathColor != undefined ? pathColor : this.util.options.pathColor; + this.util.options.pathStyle = pathStyle != undefined ? pathStyle : this.util.options.pathStyle; + this.util.iconUrl = iconUrl != undefined ? iconUrl : []; + if (!isNaN(Number(options.floor))) { - this.util.startObj.floor = this.util.deviceObj.floor = parseInt(options.floor) || 0 + this.util.startObj.floor = this.util.deviceObj.floor = parseInt(options.floor) || 0; } else { if (Array.isArray(this.util.allMap)) { for (var iii = 0; iii < this.util.allMap[this.util.startObj.build].buildArr.length; iii++) { if (this.util.allMap[this.util.startObj.build].buildArr[iii].name == options.floor) { - this.util.startObj.floor = this.util.deviceObj.floor = this.util.allMap[this.util.startObj.build].buildArr[iii].order - break + this.util.startObj.floor = this.util.deviceObj.floor = this.util.allMap[this.util.startObj.build].buildArr[iii].order; + break; } } } } - for(let k=0; k 0) { 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) { - 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 - ) - collada.scene.userData.type = _this.util.initModelArr[i].type - for (let k = 0; k < collada.animations.length; k++) { - let mixer = new THREE.AnimationMixer(collada.scene) - mixer.clipAction(collada.animations[k]).play() - _this.mixers.push(mixer) - } - ////////////////////////////////////////////// - collada.scene.traverse(function (child) { - if (child.type === 'Mesh') { - child.castShadow = false - child.receiveShadow = false - child.userData.opacity = child.material.opacity - + let loader = new THREE.GLTFLoader(); + loader.load( _this.util.beforPath + _this.util.initModelArr[i].url, + function (collada) { + 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); + collada.scene.userData.type = _this.util.initModelArr[i].type; + for (let k = 0; k < collada.animations.length; k++) { + let mixer = new THREE.AnimationMixer(collada.scene); + mixer.clipAction(collada.animations[k]).play(); + _this.mixers.push(mixer); + } + ////////////////////////////////////////////// + collada.scene.traverse(function (child) { + if (child.type === "Mesh") { + child.castShadow = false; + child.receiveShadow = false; + child.userData.opacity = child.material.opacity; if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding //贴图需要转换成 线性编码 + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 } + } + }); + collada.scene.name = "model"; //删除其它元素时过滤 + if (_this.util.initModelArr[i].type == "out") { + _this.outModelGap.add(collada.scene); + } else if (_this.util.initModelArr[i].type == "periphery") { + _this.peripheryGap.add(collada.scene); } - }) - collada.scene.name = 'model' //删除其它元素时过滤 - if (_this.util.initModelArr[i].type == 'out') { - _this.outModelGap.add(collada.scene) - } else if (_this.util.initModelArr[i].type == 'periphery') { - _this.peripheryGap.add(collada.scene) } - }) + ); if (i == _this.util.initModelArr.length - 1) { for (let u = 0; u < _this.util.tipArr.length; u++) { - let prite = document.createElement('div') - prite.style.zIndex = 20 - prite.innerHTML = _this.util.tipArr[u].htmlUrl + let prite = document.createElement("div"); + prite.style.zIndex = _this.util.tipArr[u].zIndex || 20; + prite.innerHTML = _this.util.tipArr[u].htmlUrl; if (!_this.util.tipArr[u].click) { - prite.style.pointerEvents = 'none' + prite.style.pointerEvents = "none"; + } + let pointLabel2 = new THREE.CSS2DObject(prite); + pointLabel2.position.set(_this.util.tipArr[u].x, _this.util.tipArr[u].z, _this.util.tipArr[u].y); + pointLabel2.userData.type = "2d_IP"; + pointLabel2.userData.show = _this.util.tipArr[u].show; + pointLabel2.userData.name = _this.util.tipArr[u].name || ""; + if (pointLabel2.userData.show == language) { + pointLabel2.element.style.visibility = "visible"; + } else { + pointLabel2.element.style.visibility = "hidden"; } - let pointLabel2 = new THREE.CSS2DObject(prite) - pointLabel2.position.set(_this.util.tipArr[u].x, _this.util.tipArr[u].z, _this.util.tipArr[u].y) - pointLabel2.userData.type = '2d_IP' - if (_this.util.tipArr[u].type == 'out') { - _this.outModelGap.add(pointLabel2) - } else if (_this.util.tipArr[u].type == 'periphery') { - _this.peripheryGap.add(pointLabel2) + if (_this.util.tipArr[u].type == "out") { + _this.outObject.add(pointLabel2); + } else if (_this.util.tipArr[u].type == "periphery") { + _this.perObject.add(pointLabel2); } } - _this.initBuild() + _this.initBuild(); } } } else { - _this.util.changeDist.inner = _this.util.options.maxDis - _this.initBuild() - } - }, - - initBuild: function (e) { - this.util.pathStateObj.elevator = null; - this.util.pathStateObj.straight = null; - this.util.pathStateObj.elevatorDown = null; - let loader2 = new THREE.GLTFLoader() - let _this = this; - loader2.load(this.util.beforPath + 'static/img/zhong.glb', function (collada2) { - collada2.scene.scale.x = collada2.scene.scale.y = collada2.scene.scale.z = 100 - collada2.scene.applyMatrix4(_this.sceneGap.matrix) - collada2.scene.renderOrder = 200 - collada2.scene.traverse(function (child) { - if (child.type === "Mesh") { - child.castShadow = _this.util.options.shadow; - child.receiveShadow = _this.util.options.shadow; - child.userData.opacity = child.material.opacity; - if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 - } - } - }); - collada2.scene.name = "Z-model"; - for (let k = 0; k < collada2.animations.length; k++) { - let mixer = new THREE.AnimationMixer(collada2.scene) - mixer.clipAction(collada2.animations[k]).play() - Map_QM.mixers.push(mixer) - } - _this.endModel = collada2.scene - _this.scene.add(collada2.scene) - _this.endModel.visible = false - }) - - let spriteMap = new THREE.TextureLoader().load(_this.util.beforPath + 'static/img/Z.png') - let spriteMaterial = new THREE.SpriteMaterial({ - //sizeAttenuation: false 禁止跟随鼠标缩放 - map: spriteMap, - depthTest: true, - transparent: true, - alphaTest: 0.5 - }) - _this.endIcon = new MySprite_QM(spriteMaterial) - _this.endIcon.scale.set(100, 120, 1) - _this.endIcon.center = new THREE.Vector2(0.5, 0) - _this.endIcon.position.set(0, 55, 0) - _this.endIcon.applyMatrix4(_this.sceneGap.matrix) - _this.endIcon.renderOrder = 300 - _this.endIcon.visible = false - _this.endIcon.name = "Z-model"; - _this.scene.add(_this.endIcon) - if (_this.util.options.modelIcon) { - let loader = new THREE.GLTFLoader(); - loader.load(_this.util.beforPath + "static/img/elevator.gltf", function (collada) { - collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = _this.util.options.facSize || 20; - collada.scene.rotation.x = -90 * Math.PI / -180; - collada.scene.renderOrder = 300; - _this.util.pathStateObj.elevator = collada.scene; - - new THREE.GLTFLoader().load(_this.util.beforPath + "static/img/elevatorDown.gltf", function (collada) { - collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = _this.util.options.facSize || 20; - collada.scene.rotation.x = -90 * Math.PI / -180; - collada.scene.renderOrder = 300; - _this.util.pathStateObj.elevatorDown = collada.scene; - - new THREE.GLTFLoader().load(_this.util.beforPath + "static/img/dt.gltf", function (collada) { - collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = _this.util.options.facSize || 20; - collada.scene.rotation.x = -90 * Math.PI / -180; - collada.scene.renderOrder = 300; - _this.util.pathStateObj.straight = collada.scene; - _this.index = 0; - _this.initTreeModel(); - }); - }); - }); - } else { - _this.index = 0; - _this.initTreeModel(); - } - }, - loaderOver: function (e) { - this.sceneGap = new THREE.Group(); - this.sceneGap.scale.set(this.util.sceneGap.scale, this.util.sceneGap.scale, this.util.sceneGap.scale); - - this.scene.add(this.sceneGap); - this.buildObj = new THREE.Group(); - this.sceneGap.add(this.buildObj); - this.CSSObject = new THREE.Object3D(); - if(this.moveFloorbg){ - this.moveFloorbg.userData.type = "moveFloor"; - this.CSSObject.add(this.moveFloorbg); - } - this.CSSObject.add(this.outObject); - this.CSSObject.add(this.perObject); - this.buildObj.add(this.CSSObject); - this.buildObj.add(this.dtLineGroup); - this.initGuide(); - if(!this.util.options.deviceAng){ - this.cameraPerspective.position.set(this.util.sceneGap.cameraX, this.util.sceneGap.cameraY, this.util.sceneGap.cameraZ); - this.cameraPerspective.updateProjectionMatrix(); //必须update - this.cameraOrtho.position.set(this.util.sceneGap.cameraX, this.util.sceneGap.cameraY, this.util.sceneGap.cameraZ); - this.cameraOrtho.updateProjectionMatrix(); - this.controls.target.set(this.util.sceneGap.x, this.util.sceneGap.y, this.util.sceneGap.z); - } - let pathData = this.util.allMap[parseInt(this.util.deviceObj.build)].buildArr[parseInt(this.util.deviceObj.floor)].mapData.path; - 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; - this.util.deviceObj.yaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].y; - } - } - this.util.pathStateObj.facAllArr = []; - this.mapArr.length = 0; - this.util.pathStateObj.basePath = "{"; - for (let bd = 0; bd < this.util.allMap.length; bd++) { - for (let i = 0; i < this.util.allMap[bd].buildArr.length; i++) { - this.convertPath(bd, i); - } - } - if (this.util.pathStateObj.basePath.length > 1) { - this.util.pathStateObj.basePath = this.util.pathStateObj.basePath.substr(0, this.util.pathStateObj.basePath.length - 1); - } - this.util.pathStateObj.basePath += "}"; - let bjP = JSON.parse(this.util.pathStateObj.basePath); - if (this.util.options.otherPath) { //如果多楼栋需要配置楼栋之间通行路径 - for (let item of this.util.options.otherPath) { - bjP[item.f][item.s] = item.d; - bjP[item.s][item.f] = item.d; - } - } - //初始化基础路径; - let jcStr = JSON.stringify(bjP); - let graphPathObj = JSON.parse(jcStr); - let ftPathObj = JSON.parse(jcStr); - let dtPathObj = JSON.parse(jcStr); - try { - 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] = 6000 + 3000 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder));; - if (this.util.pathStateObj.seldtFacNo.type == "dt" && this.util.pathStateObj.facAllArr[j][k].no == this.util.pathStateObj.seldtFacNo.no) { - graphPathObj[facP][nP] = 1000 + 400 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - } else { - graphPathObj[facP][nP] = 4000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - } - dtPathObj[facP][nP] = 4000 + 800 * 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] = 4000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - ftPathObj[facP][nP] = 4000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - dtPathObj[facP][nP] = 4000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - } else { - dtPathObj[facP][nP] = 6000 + 3000 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - if (this.util.pathStateObj.seldtFacNo.type == "ft" && this.util.pathStateObj.seldtFacNo.no.search(this.util.pathStateObj.facAllArr[j][k].no+",") != -1) { - graphPathObj[facP][nP] = 1000 + 400 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - } else { - graphPathObj[facP][nP] = 4000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - } - ftPathObj[facP][nP] = 4000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); - } - } - } - } - } - } catch (e) { - console.log("交通设施点位问题: " + e); - } - - 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(() => { - if (!Map_QM.util.allMap[bIndex].buildArr[fIndex]) { - clearInterval(intTimer); - this.initFloor(); - return; - } - let floor = new FloorMap_QM(bIndex, fIndex, Map_QM.util.allMap[bIndex].buildArr[fIndex].name); - floor.floorName = Map_QM.util.allMap[bIndex].buildArr[fIndex].name; - floor.initDraw(); - floor.allObj.position.set(bIndex * Map_QM.util.options.bSpace, 0, 0); - if (fIndex != parseInt(Map_QM.util.deviceObj.floor)) { - floor.allObj.visible = false; - } - this.buildObj.add(floor.allObj); - this.mapArr[bIndex].push(floor); - fIndex++; - if (fIndex >= Map_QM.util.allMap[bIndex].buildArr.length) { - if (bIndex == Map_QM.util.allMap.length - 1) { - clearInterval(intTimer); - let pathData = Map_QM.util.allMap[parseInt(Map_QM.util.deviceObj.build)].buildArr[parseInt(Map_QM.util.deviceObj.floor)].mapData.path; - if (Map_QM.util.deviceObj.xaxis) { - 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)+20); - } else { - if (parseInt(Map_QM.util.deviceObj.node) != -1) { - pathData && pathData.nodes.sort(Map_QM.util.sortNode); - if (pathData && !Map_QM.util.deviceObj.xaxis && pathData.nodes.length > parseInt(Map_QM.util.deviceObj.node) && parseInt(Map_QM.util.deviceObj.node)>=0) { - 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; - } else { - console.warn("初始化点位失败"); - } - 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)+20); - } - } - this.initFloor(); - } else { - bIndex++; - fIndex = 0; - this.mapArr[bIndex] = []; - } - } - }, 0); - }, - beforeDestroy:function() { - if (this.scene) { - this.renderer.dispose() - this.util.pathStateObj.basePath = null; - this.ele.removeEventListener("wheel", this.mouseWheel); - this.ele.removeEventListener("touchmove", this.mouseMove); - this.ele.removeEventListener('click', this.onMouseClickBox); //地图点击 - this.ele.removeEventListener('touchend',this.mouseUp); - this.controls.removeEventListener('change', this.controlsChock); - document.removeEventListener('resize', this.changeDocmentResize); //窗口变化 - this.remove_child(this.sceneGap); - this.scene.remove(this.sceneGap); - while ((elem = this.ele.firstChild)) { - elem.remove(); - } - this.renderer.domElement = null - this.renderer = null - this.scene.clear() - this.scene = null - this.camera = null - this.controls = null - this.util.spriteMaterialArr = []; - this.util.lineBasicMaterialArr = []; - this.util.meshMaterialArr = []; - this.util.parkMaterialArr = []; - this.util.shopData = []; //店铺数据 - this.util.iconUrl = []; - this.util.allMap = []; - this.util = null; - Map_QM = null; - } - }, - initTreeModel: function () { - - if(this.index < this.util.modelStr.length - 1 ){ - if(this.util.modelStr[this.index].load){ - this.gltfLoad(this.util.beforPath + this.util.modelStr[this.index].url); - }else{ - this.index++; - this.initTreeModel(); - } - }else{ - if (this.util.allMap && this.util.allMap.length > 0) { - this.loaderOver(); - } - } - }, - gltfLoad: function (url) { - let sopce = this; - new THREE.GLTFLoader().load(url, function (object) {//加载路径fbx文件 - object.scene.traverse(function (child) { - if (child.type === "Mesh") { - child.castShadow = sopce.util.options.shadow; - child.receiveShadow = sopce.util.options.shadow; - if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 - } - if (sopce.util.modelStr[sopce.index].colorModel === 'gama') { - child.material.color.convertGammaToLinear(0.6); - } - } - }); - object.scene.children[0].scale.set(sopce.util.modelStr[sopce.index].size.x, sopce.util.modelStr[sopce.index].size.y, sopce.util.modelStr[sopce.index].size.z); - sopce.util.fbxModels.push({ 'key': sopce.util.modelStr[sopce.index].key, 'obj': object, 'operation': sopce.util.modelStr[sopce.index] }); - if (sopce.index < sopce.util.modelStr.length - 1) { - sopce.index++; - sopce.initTreeModel(); - } else { - if (sopce.util.allMap && sopce.util.allMap.length > 0) { - sopce.loaderOver(); - } - } - }); - }, - initGuide: function () { - let _this = this - new THREE.GLTFLoader().load(_this.util.beforPath + 'static/img/runman.gltf', function (obj) { - obj.scene.scale.x = obj.scene.scale.y = obj.scene.scale.z = _this.util.options.facSize || 20 - obj.scene.children[0].children[1].children[0].material.color = new THREE.Color(0xfe9219) - _this.sceneGap.add(obj.scene) - obj.scene.visible = false - obj.scene.children[0].rotation.x = Math.PI / 2 - obj.scene.children[0].rotation.y = Math.PI - // obj作为参数创建一个混合器,解析播放obj及其子对象包含的动画数据 - let mixer = new THREE.AnimationMixer(obj.scene) - let AnimationAction = mixer.clipAction(obj.animations[0]) - AnimationAction.timeScale = 2 - AnimationAction.play() - _this.mixers.push(mixer) - _this.man_3d = obj.scene - _this.guide = _this.man_3d - }) - - new THREE.GLTFLoader().load(this.util.beforPath + "static/img/guide.glb", function (obj) { - obj.scene.scale.x = obj.scene.scale.y = obj.scene.scale.z = _this.util.options.facSize*5 || 100; - obj.scene.visible = false; - obj.scene.children[0].rotation.x = Math.PI / 2; - obj.scene.traverse(function (child) { - if (child.type === "Mesh") { - child.castShadow = _this.util.options.shadow; - child.receiveShadow = _this.util.options.shadow; - child.userData.opacity = child.material.opacity; - if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 - } - } - }); - for (let k = 0; k < obj.animations.length; k++) { - let mixer = new THREE.AnimationMixer(obj.scene) - mixer.clipAction(obj.animations[k]).play() - _this.mixers.push(mixer) - } - _this.man_2d = obj.scene; - _this.man_2d.renderOrder = 160; - _this.sceneGap.add(_this.man_2d); - }); + _this.util.changeDist.inner = _this.util.options.maxDis; + _this.initBuild(); + } }, - initFloor: function () { - this.controls.saveState(); - this.changeBuild(this.util.deviceObj.build, this.util.deviceObj.floor); - //初始化方向为第一人称方向 - this.util.options.deviceAng && this.rotationAngle(this.util.deviceObj.angle) - this.startRender(); - - setTimeout(() => { - Map_QM.controls.addEventListener('change', Map_QM.controlsChock); //控制器变化 - let boundBox = new THREE.Box3(); - boundBox.setFromObject(Map_QM.sceneGap); - if (isNaN(boundBox.min.x) || isNaN(boundBox.min.y) ){ - Map_QM.controls.minPan = new THREE.Vector3(Map_QM.w / -8, 0, Map_QM.h / -8); - Map_QM.controls.maxPan = new THREE.Vector3(Map_QM.w / 8, 0, Map_QM.h / 8); - } else{ - boundBox.min.x<-400 && (boundBox.min.x=boundBox.min.z) - boundBox.max.x>400 && (boundBox.max.x=boundBox.max.z) - boundBox.min.z<-400 && (boundBox.min.z=boundBox.min.x) - boundBox.max.z>400 && (boundBox.max.z=boundBox.max.x) - Map_QM.controls.minPan = boundBox.min; - Map_QM.controls.maxPan = boundBox.max; - } - }, 150) - }, - calcFov:function (d, w, r) { - let f; - let vertical = w; - if (r < 1) { - vertical = vertical/r; - } - f = Math.atan(vertical/d/2)* 2 * (180 / Math.PI); - return f; - }, - /** - * 解析路径 - */ - convertPath: function (buildOrder, floorOrder) { - let mapDataA = this.util.allMap[buildOrder].buildArr[floorOrder].mapData; - let pathData = mapDataA.path; - if (!pathData) { - return; - } - if (pathData.nodes.length > 0) { - pathData.nodes.sort(this.util.sortNode); - for (let i = 0; i < pathData.nodes.length; i++) { - let a = pathData.nodes[i].id; - this.util.pathStateObj.basePath += "\"" + buildOrder + "_" + floorOrder + "_" + a + "\":{"; - for (let n = 0; n < pathData.nodes[i]["list"].length; n++) { - let b; - if (pathData.nodes[i]["list"][n].id || pathData.nodes[i]["list"][n].id == "0") { - b = pathData.nodes[i]["list"][n].id; - } else { - b = a == pathData.nodes[i]["list"][n].selfNode.id ? pathData.nodes[i]["list"][n].nextNode.id : pathData.nodes[i]["list"][n].selfNode.id; - } - this.util.pathStateObj.basePath += "\"" + buildOrder + "_" + floorOrder + "_" + b + "\":" + pathData.nodes[i]["list"][n].cost + ","; - } - if (pathData.nodes[i]["list"].length > 0) { - this.util.pathStateObj.basePath = this.util.pathStateObj.basePath.substr(0, this.util.pathStateObj.basePath.length - 1); - } - this.util.pathStateObj.basePath += "},"; - } - } - let mindt = 10000, - minupft = -1, - mindownft = -1, - seldtNo,seldownftNo,selupftNo; - - if (buildOrder == this.util.deviceObj.build && floorOrder == this.util.deviceObj.floor && parseInt(this.util.deviceObj.node)>=0) { - if (pathData && !this.util.deviceObj.xaxis && pathData.nodes.length > parseInt(this.util.deviceObj.node) && parseInt(this.util.deviceObj.node)>0) { - this.util.deviceObj.xaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].x - this.util.deviceObj.yaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].y - } - //获取本楼层最近的电梯 - for (let n = 0; n < mapDataA.stairs.length; n++) { - if (mapDataA.stairs[n].state && mapDataA.stairs[n].no != '' && parseInt(mapDataA.stairs[n].navCode) > 0) { - let ms = Math.abs(parseInt(mapDataA.stairs[n].x) - parseInt(this.util.deviceObj.xaxis)) + Math.abs(parseInt(mapDataA.stairs[n].y) - parseInt(this.util.deviceObj.yaxis)) - if (mindt > ms && (mapDataA.stairs[n].facCode == "ft" || mapDataA.stairs[n].facCode=="upft" || mapDataA.stairs[n].facCode=="downft" || mapDataA.stairs[n].facCode=="dt")) { - mindt = ms - let fac = mapDataA.stairs[n].facCode == "dt" ? "dt":"ft"; - this.util.pathStateObj.seldtFacNo.type = fac; - if (mapDataA.stairs[n].facCode == 'dt') { - seldtNo = mapDataA.stairs[n].no - } - } + changePerTag: function (str) { + if (mapState == "periphery") { + Map_QM.perObject.traverse(function (child) { + if (child.userData && child.userData.show) { + if (child.userData.show.includes(str)) { + child.element.style.visibility = "visible"; + } else { + child.element.style.visibility = "hidden"; + } + } + }); + } + }, + initBuild: function () { + this.util.pathStateObj.elevator = null; + this.util.pathStateObj.straight = null; + this.util.pathStateObj.elevatorDown = null; + let loader2 = new THREE.GLTFLoader(); + let _this = this; + loader2.load(this.util.beforPath + "static/img/zhong.glb", + function (collada2) { + collada2.scene.scale.x = collada2.scene.scale.y = collada2.scene.scale.z = 100; + collada2.scene.applyMatrix4(_this.sceneGap.matrix); + collada2.scene.renderOrder = 200; + collada2.scene.traverse(function (child) { + if (child.type === "Mesh") { + child.castShadow = false; + child.receiveShadow = false; + child.userData.opacity = child.material.opacity; + if (child.material.map) { + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 + } + } + }); + collada2.scene.name = "Z-model"; + for (let k = 0; k < collada2.animations.length; k++) { + let mixer = new THREE.AnimationMixer(collada2.scene); + mixer.clipAction(collada2.animations[k]).play(); + Map_QM.mixers.push(mixer); } + _this.endModel = collada2.scene; + _this.scene.add(collada2.scene); + _this.endModel.visible = false; } - if(this.util.pathStateObj.seldtFacNo.type == "dt"){ - this.util.pathStateObj.seldtFacNo.no = seldtNo; - }else{ - for(let t=0; t 0) { - let ms = Math.abs(parseInt(mapData.stairs[h].x) - parseInt(this.util.deviceObj.xaxis)) + Math.abs(parseInt(mapData.stairs[h].y) - parseInt(this.util.deviceObj.yaxis)) - if (mapData.stairs[h].facCode == 'upft' || mapData.stairs[h].downState) { - //上扶 - if (minupft > ms) { - minupft = ms - selupftNo = mapData.stairs[h].no - } - } else if (mapData.stairs[h].facCode == 'downft' || mapData.stairs[h].upState) { - if (mindownft > ms) { - mindownft = ms - seldownftNo = mapData.stairs[h].no; - } - } - } - } - //扶梯距离最小 - selupftNo != "" && (this.util.pathStateObj.seldtFacNo.no += (selupftNo+",")); - seldownftNo != "" && (this.util.pathStateObj.seldtFacNo.no += (seldownftNo+",")); - } - } - //console.log(this.util.pathStateObj.seldtFacNo); - } + ); + + let spriteMap = new THREE.TextureLoader().load( + _this.util.beforPath + "static/img/Z.png" + ); + let spriteMaterial = new THREE.SpriteMaterial({ + //sizeAttenuation: false 禁止跟随鼠标缩放 + map: spriteMap, + depthTest: true, + transparent: true, + alphaTest: 0.5, + }); + _this.endIcon = new MySprite_QM(spriteMaterial); + _this.endIcon.scale.set(100, 120, 1); + _this.endIcon.center = new THREE.Vector2(0.5, 0); + _this.endIcon.position.set(0, 55, 0); + _this.endIcon.applyMatrix4(_this.sceneGap.matrix); + _this.endIcon.renderOrder = 300; + _this.endIcon.visible = false; + _this.endIcon.name = "Z-model"; + _this.scene.add(_this.endIcon); + if (_this.util.options.modelIcon) { + let loader = new THREE.GLTFLoader(); + loader.load(_this.util.beforPath + "static/img/elevator.gltf", + function (collada) { + collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = _this.util.options.facSize || 20; + collada.scene.rotation.x = (-90 * Math.PI) / -180; + collada.scene.renderOrder = 300; + _this.util.pathStateObj.elevator = collada.scene; + + new THREE.GLTFLoader().load(_this.util.beforPath + "static/img/elevatorDown.gltf", + function (collada) { + collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = _this.util.options.facSize || 20; + collada.scene.rotation.x = (-90 * Math.PI) / -180; + collada.scene.renderOrder = 300; + _this.util.pathStateObj.elevatorDown = collada.scene; + + new THREE.GLTFLoader().load(_this.util.beforPath + "static/img/dt.gltf", + function (collada) { + collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = _this.util.options.facSize || 20; + collada.scene.rotation.x = (-90 * Math.PI) / -180; + collada.scene.renderOrder = 300; + _this.util.pathStateObj.straight = collada.scene; + _this.index = 0; + _this.initTreeModel(); + } + ); + } + ); + } + ); + } else { + _this.index = 0; + _this.initTreeModel(); + } + }, + loaderOver: function () { + this.sceneGap = new THREE.Group(); + this.sceneGap.scale.set(this.util.sceneGap.scale, this.util.sceneGap.scale, this.util.sceneGap.scale); + this.scene.add(this.sceneGap); + this.buildObj = new THREE.Group(); + this.sceneGap.add(this.buildObj); + this.CSSObject = new THREE.Object3D(); + if (this.moveFloorbg) { + this.moveFloorbg.userData.type = "moveFloor"; + this.CSSObject.add(this.moveFloorbg); + } + this.CSSObject.add(this.outObject); + this.CSSObject.add(this.perObject); + this.buildObj.add(this.CSSObject); + this.buildObj.add(this.dtLineGroup); + this.initGuide(); + if (!this.util.options.deviceAng) { + this.cameraPerspective.position.set(this.util.sceneGap.cameraX, this.util.sceneGap.cameraY, this.util.sceneGap.cameraZ ); + this.cameraPerspective.updateProjectionMatrix(); //必须update + this.cameraOrtho.position.set(this.util.sceneGap.cameraX, this.util.sceneGap.cameraY, this.util.sceneGap.cameraZ); + this.cameraOrtho.updateProjectionMatrix(); + this.controls.target.set(this.util.sceneGap.x, this.util.sceneGap.y, this.util.sceneGap.z); + } + let pathData = this.util.allMap[parseInt(this.util.deviceObj.build)].buildArr[parseInt(this.util.deviceObj.floor)].mapData.path; + 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; + this.util.deviceObj.yaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].y; + } + } + this.util.pathStateObj.facAllArr = []; + this.mapArr.length = 0; + this.util.pathStateObj.basePath = "{"; + for (let bd = 0; bd < this.util.allMap.length; bd++) { + for (let i = 0; i < this.util.allMap[bd].buildArr.length; i++) { + this.convertPath(bd, i); + } + } + if (this.util.pathStateObj.basePath.length > 1) { + this.util.pathStateObj.basePath = this.util.pathStateObj.basePath.substr(0,this.util.pathStateObj.basePath.length - 1); + } + this.util.pathStateObj.basePath += "}"; + let bjP = JSON.parse(this.util.pathStateObj.basePath); + if (this.util.options.otherPath) { + //如果多楼栋需要配置楼栋之间通行路径 + for (let item of this.util.options.otherPath) { + bjP[item.f][item.s] = item.d; + bjP[item.s][item.f] = item.d; + } + } + //初始化基础路径; + let jcStr = JSON.stringify(bjP); + let graphPathObj = JSON.parse(jcStr); + let ftPathObj = JSON.parse(jcStr); + let dtPathObj = JSON.parse(jcStr); + let basePathObj = JSON.parse(jcStr); + try { + 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] =200000 +2000 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder)-parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + if (this.util.pathStateObj.seldtFacNo.type == "dt" &&this.util.pathStateObj.facAllArr[j][k].no == this.util.pathStateObj.seldtFacNo.no) { + graphPathObj[facP][nP] =2000 +300 *Math.abs(parseInt( this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + } else { + graphPathObj[facP][nP] =5000 +600 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) -parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + } + dtPathObj[facP][nP] = 5000 +800 *Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder)-parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + basePathObj[facP][nP] = 600 +200 * 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] =4000 +800 * Math.abs( parseInt( this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + ftPathObj[facP][nP] = 4000 +800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) -parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder )); + dtPathObj[facP][nP] = 4000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + basePathObj[facP][nP] = 800 *Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) -parseInt( this.util.pathStateObj.facAllArr[j][k].floorOrder )); + } else { + dtPathObj[facP][nP] =200000 +2000 * Math.abs(parseInt( this.util.pathStateObj.facAllArr[j][h].floorOrder) - parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder) ); + if (this.util.pathStateObj.seldtFacNo.type == "ft" &&this.util.pathStateObj.seldtFacNo.no.search(this.util.pathStateObj.facAllArr[j][k].no + ",") != -1) { + graphPathObj[facP][nP] = 2000 + 300 *Math.abs( parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) -parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + } else { + graphPathObj[facP][nP] = 5000 +600 * Math.abs( parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) -parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder) ); + } + ftPathObj[facP][nP] = 5000 + 800 * Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder) -parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + basePathObj[facP][nP] = 100 + 400 *Math.abs(parseInt(this.util.pathStateObj.facAllArr[j][h].floorOrder)-parseInt(this.util.pathStateObj.facAllArr[j][k].floorOrder)); + } + } + } + } + } + } catch (e) { + window.captureException && window.captureException(e); + console.log("交通设施点位问题: " + e); + } - let noHas; - for (let j = 0; j < mapDataA.stairs.length; j++) { - if (parseInt(mapDataA.stairs[j].navCode) > 0 && mapDataA.stairs[j].state) { //排除禁用的设施 - noHas = true; - for (let k = 0; k < this.util.pathStateObj.facAllArr.length; k++) { //Map_QM.util.pathStateObj.facAllArr 记录遍历结果 - if (this.util.pathStateObj.facAllArr[k][0].no != "" && this.util.pathStateObj.facAllArr[k][0].navCode != "" && parseInt(this.util.pathStateObj.facAllArr[k][0].navCode) >0 && this.util.pathStateObj.facAllArr[k][0].no == mapDataA.stairs[j].no) { - if (this.util.pathStateObj.facAllArr[k][0].facCode == mapDataA.stairs[j].facCode || (this.util.pathStateObj.facAllArr[k][0].facCode.search("ft") != -1 && mapDataA.stairs[j].facCode.search("ft") != -1)) { - noHas = false; - mapDataA.stairs[j].floorOrder = floorOrder; - mapDataA.stairs[j].buildOrder = buildOrder; - this.util.pathStateObj.facAllArr[k].push(mapDataA.stairs[j]); - } - } - } - if (noHas) { - mapDataA.stairs[j].buildOrder = buildOrder; - mapDataA.stairs[j].floorOrder = floorOrder; - let array = [mapDataA.stairs[j]]; - this.util.pathStateObj.facAllArr.push(array); - } - } - } - }, + this.util.pathStateObj.graphPath = graphPathObj; + this.util.pathStateObj.ftPath = ftPathObj; + this.util.pathStateObj.dtPath = dtPathObj; + this.util.pathStateObj.basePath = basePathObj; + var fIndex = 0, bIndex = 0; + this.mapArr[bIndex] = []; + intTimer = setInterval(() => { + if (!Map_QM.util.allMap[bIndex].buildArr[fIndex]) { + clearInterval(intTimer); + this.initFloor(); + return; + } + let floor = new FloorMap_QM(bIndex, fIndex, Map_QM.util.allMap[bIndex].buildArr[fIndex].name ); + floor.floorName = Map_QM.util.allMap[bIndex].buildArr[fIndex].name; + floor.initDraw(); + floor.allObj.position.set(bIndex * Map_QM.util.options.bSpace, 0, 0); + if (fIndex != parseInt(Map_QM.util.deviceObj.floor)) { + floor.allObj.visible = false; + } + this.buildObj.add(floor.allObj); + this.mapArr[bIndex].push(floor); + fIndex++; + if (fIndex >= Map_QM.util.allMap[bIndex].buildArr.length) { + if (bIndex == Map_QM.util.allMap.length - 1) { + clearInterval(intTimer); + let pathData = Map_QM.util.allMap[parseInt(Map_QM.util.deviceObj.build)].buildArr[parseInt(Map_QM.util.deviceObj.floor)].mapData.path; + if (Map_QM.util.deviceObj.xaxis) { + 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) + 20); + } else { + if (parseInt(Map_QM.util.deviceObj.node) != -1) { + pathData && pathData.nodes.sort(Map_QM.util.sortNode); + if (pathData &&!Map_QM.util.deviceObj.xaxis && pathData.nodes.length > parseInt(Map_QM.util.deviceObj.node) && parseInt(Map_QM.util.deviceObj.node) >= 0) { + 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; + } else { + console.warn("初始化点位失败"); + } + 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) + 20); + } + } + this.initFloor(); + } else { + bIndex++; + fIndex = 0; + this.mapArr[bIndex] = []; + } + } + }, 0); + }, + beforeDestroy: function () { + if (this.scene) { + this.controls && this.controls.dispose(); + this.renderer.renderLists && this.renderer.renderLists.dispose(); + this.renderer.dispose && this.renderer.dispose(); + this.renderer.forceContextLoss(); + let gl = this.renderer.domElement.getContext('webgl'); + gl && gl.getExtension('WEBGL_lose_context').loseContext(); + this.util.pathStateObj.basePath = null; + this.ele.removeEventListener("click", this.onMouseClickBox); //地图点击 + this.controls.removeEventListener("change", this.controlsChock); + document.removeEventListener("resize", this.changeDocmentResize); //窗口变化 + this.remove_child(this.sceneGap); + this.scene.remove(this.sceneGap); + while (this.ele.firstChild) { + this.ele.firstChild.remove(); + } + this.renderer.domElement = null; + this.renderer.content = null; + this.renderer = null; + this.scene.clear(); + this.scene = null; + this.camera = null; + this.controls = null; + this.util.spriteMaterialArr = []; + this.util.lineBasicMaterialArr = []; + this.util.meshMaterialArr = []; + this.util.parkMaterialArr = []; + this.util.shopData = []; //店铺数据 + this.util.iconUrl = []; + this.util.allMap = []; + this.util = null; + Map_QM = null; + } + }, /** - * @api {方法} changeMapState("3d") 地图状态切换 - * @apiGroup 地图显示 - * @apiDescription 地图展示状态切换 - * @apiVersion 2.0.0 - * @apiParam {string} state 地图状态 + * @api {方法} changeLanguage() 切换中英文 + * @apiGroup 地图交互 + * @apiDescription 切换中英文 zh en + * @apiVersion 1.0.0 + * @apiParam {String} str 显示语言 * * @apiSampleRequest off * * @apiParamExample {String} 请求示例 * - * Map_QM.changeMapState("2d"); + * Map_QM.changeLanguage("en"); * */ - changeMapState: function (state) { - Map_QM.controls.reset() - Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle) - if (state === '3d') { - Map_QM.camera = Map_QM.cameraPerspective; - Map_QM.controls.object = Map_QM.camera; - Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; - Map_QM.controls.maxPolarAngle = Math.PI / 2 - 0.2; - Map_QM.controls.setZoom(1); - Map_QM.changeIconState(state); - } else { - Map_QM.camera = Map_QM.cameraOrtho; - Map_QM.controls.object = Map_QM.camera; - Map_QM.shawLight.castShadow = false; - Map_QM.controls.setZoom(Map_QM.util.m_zoom); - Map_QM.controls.maxPolarAngle = 0; - Map_QM.changeIconState(state); + changeLanguage: function (lang = "zh") { + language = lang; + for (let t = 0; t < Map_QM.mapArr.length; t++) { + for (let i = 0; i < Map_QM.mapArr[t].length; i++) { + Map_QM.mapArr[t][i].labelObj.traverse((obj) => { + if (obj.element) { + obj.element.innerText = lang == "en"? obj.element.dataset.nameEn : obj.element.dataset.name; + } + }); + Map_QM.mapArr[t][i].showTagObj.traverse((obj) => { + if (obj.element) { + obj.element.style.opacity = obj.userData.show != lang ? 0 : 1; + } + }); + } } + Map_QM.outObject.traverse((obj) => { + if (obj.element && mapState == "out") { + obj.element.style.visibility = obj.userData.show == lang ? "visible" : "hidden"; + } + }); + Map_QM.perObject.traverse((obj) => { + if (obj.element && mapState == "periphery") { + obj.element.style.visibility = obj.userData.show == lang ? "visible" : "hidden"; + } + }); + Map_QM.controlsChock(); }, - - changeIconState: function (state,fIndex=-1) { - iconState = state; - fIndex = fIndex === -1 ? Map_QM.util.selectFloor : fIndex; - for (let i = 0; i < Map_QM.mapArr[Map_QM.util.selectBuild].length; i++) { - if(i == fIndex){ - Map_QM.mapArr[Map_QM.util.selectBuild][i].serObj.traverse((obj) => { - if (obj.userData && obj.userData.use) { - if (obj.userData.use != "all" && obj.userData.use != state) { - obj.visible = false; - obj.element && (obj.element.style.display = "none"); - } else { - obj.visible = true; - obj.element && (obj.element.style.display = ""); - } - } - }); - } - } - if (Map_QM.devModel) { - Map_QM.devModel.visible = !Map_QM.util.pathStateObj.isPathState ? true : false; - } - if (Map_QM.qiModel) { - Map_QM.qiModel.visible = (state == "3d" && Map_QM.util.pathStateObj.isPathState) ? true : false; - } - if (Map_QM.qiIcon) { - Map_QM.qiIcon.visible = (state == "2d" && Map_QM.util.pathStateObj.isPathState) ? true : false; + initTreeModel: function () { + if (this.index < this.util.modelStr.length - 1) { + if (this.util.modelStr[this.index].load) { + this.gltfLoad(this.util.beforPath + this.util.modelStr[this.index].url); + } else { + this.index++; + this.initTreeModel(); + } + } else { + if (this.util.allMap && this.util.allMap.length > 0) { + this.loaderOver(); + } + } + }, + gltfLoad: function (url) { + let sopce = this; + new THREE.GLTFLoader().load(url, function (object) { + //加载路径fbx文件 + object.scene.traverse(function (child) { + if (child.type === "Mesh") { + child.castShadow = false; + child.receiveShadow = false; + if (child.material.map) { + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 + } + if (sopce.util.modelStr[sopce.index].colorModel === "gama") { + child.material.color.convertGammaToLinear(0.6); + } + } + }); + object.scene.children[0].scale.set( + sopce.util.modelStr[sopce.index].size.x, + sopce.util.modelStr[sopce.index].size.y, + sopce.util.modelStr[sopce.index].size.z + ); + sopce.util.fbxModels.push({key: sopce.util.modelStr[sopce.index].key,obj: object, operation: sopce.util.modelStr[sopce.index],}); + if (sopce.index < sopce.util.modelStr.length - 1) { + sopce.index++; + sopce.initTreeModel(); + } else { + if (sopce.util.allMap && sopce.util.allMap.length > 0) { + sopce.loaderOver(); + } + } + }); + }, + initGuide: function () { + let _this = this; + new THREE.GLTFLoader().load( + this.util.beforPath + "static/img/runman.gltf", + function (obj) { + obj.scene.scale.x = obj.scene.scale.y =obj.scene.scale.z = _this.util.options.facSize || 20; + obj.scene.children[0].children[1].children[0].material.color = new THREE.Color(0xfe9219); + _this.sceneGap.add(obj.scene); + obj.scene.traverse(function (child) { + if (child.type === "SkinnedMesh") { + child.material.map && (child.material.map.encoding = THREE.LinearEncoding); //贴图需要转换成 线性编码 + } + }); + obj.scene.visible = false; + obj.scene.children[0].rotation.x = Math.PI / 2; + obj.scene.children[0].rotation.y = Math.PI; + // obj作为参数创建一个混合器,解析播放obj及其子对象包含的动画数据 + let mixer = new THREE.AnimationMixer(obj.scene); + let AnimationAction = mixer.clipAction(obj.animations[0]); + AnimationAction.timeScale = 2; + AnimationAction.play(); + _this.mixers.push(mixer); + _this.man_3d = obj.scene; + _this.guide = _this.man_3d; + } + ); + + new THREE.GLTFLoader().load( + this.util.beforPath + "static/img/guide.glb", + function (obj) { + obj.scene.scale.x =obj.scene.scale.y = obj.scene.scale.z = _this.util.options.facSize * 5 || 100; + obj.scene.visible = false; + obj.scene.children[0].rotation.x = Math.PI / 2; + obj.scene.traverse(function (child) { + if (child.type === "Mesh") { + child.castShadow = _this.util.options.shadow; + child.receiveShadow = _this.util.options.shadow; + child.userData.opacity = child.material.opacity; + if (child.material.map) { + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 + } + } + }); + for (let k = 0; k < obj.animations.length; k++) { + let mixer = new THREE.AnimationMixer(obj.scene); + mixer.clipAction(obj.animations[k]).play(); + _this.mixers.push(mixer); + } + _this.man_2d = obj.scene; + _this.man_2d.renderOrder = 160; + _this.sceneGap.add(_this.man_2d); + } + ); + }, + initFloor: function () { + this.controls.saveState(); + this.changeBuild(this.util.deviceObj.build, this.util.deviceObj.floor); + //初始化方向为第一人称方向 + this.util.options.deviceAng && this.rotationAngle(this.util.deviceObj.angle); + this.startRender(); + + setTimeout(() => { + Map_QM.controls.addEventListener("change", Map_QM.controlsChock); //控制器变化 + Map_QM.util.fbxModels = []; + let boundBox = new THREE.Box3(); + boundBox.setFromObject(Map_QM.sceneGap); + if (isNaN(boundBox.min.x) || isNaN(boundBox.min.y)) { + Map_QM.controls.minPan = new THREE.Vector3(Map_QM.w / -8,0,Map_QM.h / -8); + Map_QM.controls.maxPan = new THREE.Vector3(Map_QM.w / 8, 0,Map_QM.h / 8); + } else { + boundBox.min.x < -400 && (boundBox.min.x = boundBox.min.z); + boundBox.max.x > 400 && (boundBox.max.x = boundBox.max.z); + boundBox.min.z < -400 && (boundBox.min.z = boundBox.min.x); + boundBox.max.z > 400 && (boundBox.max.z = boundBox.max.x); + Map_QM.controls.minPan = boundBox.min; + Map_QM.controls.maxPan = boundBox.max; + } + console.log("Number of Triangles :", Map_QM.renderer.info.render.triangles); + if (Map_QM.util.initModelArr.length > 0) { + Map_QM.toOutModel(); + setTimeout(() => { + Map_QM.toOutModelInner(); + }, 1000); + } + }, 200); + }, + calcFov: function (d, w, r) { + let f; + let vertical = w; + if (r < 1) { + vertical = vertical / r; + } + f = Math.atan(vertical / d / 2) * 2 * (180 / Math.PI); + return f; + }, + /** + * 解析路径 + */ + convertPath: function (buildOrder, floorOrder) { + let mapDataA = this.util.allMap[buildOrder].buildArr[floorOrder].mapData; + let pathData = mapDataA.path; + if (!pathData) { + return; + } + if (pathData.nodes.length > 0) { + pathData.nodes.sort(this.util.sortNode); + for (let i = 0; i < pathData.nodes.length; i++) { + let a = pathData.nodes[i].id; + this.util.pathStateObj.basePath += '"' + buildOrder + "_" + floorOrder + "_" + a + '":{'; + for (let n = 0; n < pathData.nodes[i]["list"].length; n++) { + let b; + if (pathData.nodes[i]["list"][n].id ||pathData.nodes[i]["list"][n].id == "0") { + b = pathData.nodes[i]["list"][n].id; + } else { + b = a == pathData.nodes[i]["list"][n].selfNode.id ? pathData.nodes[i]["list"][n].nextNode.id : pathData.nodes[i]["list"][n].selfNode.id; + } + this.util.pathStateObj.basePath +='"'+buildOrder+"_" +floorOrder +"_" +b +'":'+pathData.nodes[i]["list"][n].cost +","; + } + if (pathData.nodes[i]["list"].length > 0) { + this.util.pathStateObj.basePath = this.util.pathStateObj.basePath.substr(0,this.util.pathStateObj.basePath.length - 1); + } + this.util.pathStateObj.basePath += "},"; + } + } + let mindt = 10000, minupft = -1, mindownft = -1, seldtNo, seldownftNo, selupftNo; + + if (buildOrder == this.util.deviceObj.build &&floorOrder == this.util.deviceObj.floor &&parseInt(this.util.deviceObj.node) >= 0) { + if (pathData &&!this.util.deviceObj.xaxis &&pathData.nodes.length > parseInt(this.util.deviceObj.node) && parseInt(this.util.deviceObj.node) > 0 ) { + this.util.deviceObj.xaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].x; + this.util.deviceObj.yaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].y; + } + //获取本楼层最近的电梯 + for (let n = 0; n < mapDataA.stairs.length; n++) { + if ( mapDataA.stairs[n].state && mapDataA.stairs[n].no != "" && parseInt(mapDataA.stairs[n].navCode) > 0 ) { + let ms = Math.abs( parseInt(mapDataA.stairs[n].x) - parseInt(this.util.deviceObj.xaxis) ) + Math.abs( parseInt(mapDataA.stairs[n].y) - parseInt(this.util.deviceObj.yaxis) ); + if ( mindt > ms && (mapDataA.stairs[n].facCode == "ft" || + mapDataA.stairs[n].facCode == "upft" || + mapDataA.stairs[n].facCode == "downft" || + mapDataA.stairs[n].facCode == "dt") + ) { + mindt = ms; + let fac = mapDataA.stairs[n].facCode == "dt" ? "dt" : "ft"; + this.util.pathStateObj.seldtFacNo.type = fac; + if (mapDataA.stairs[n].facCode == "dt") { + seldtNo = mapDataA.stairs[n].no; + } + } + } + } + if (this.util.pathStateObj.seldtFacNo.type == "dt") { + this.util.pathStateObj.seldtFacNo.no = seldtNo; + } else { + for (let t = 0; t < this.util.allMap[buildOrder].buildArr.length; t++) { + let mapData = this.util.allMap[buildOrder].buildArr[t].mapData; + minupft = 100000; + mindownft = 100000; + selupftNo = ""; + seldownftNo = ""; + for (let h = 0; h < mapData.stairs.length; h++) { + if (mapData.stairs[h].state && mapData.stairs[h].no != "" && parseInt(mapData.stairs[h].navCode) > 0) { + let ms = Math.abs(parseInt(mapData.stairs[h].x) - parseInt(this.util.deviceObj.xaxis)) + + Math.abs(parseInt(mapData.stairs[h].y) - parseInt(this.util.deviceObj.yaxis)); + if (mapData.stairs[h].facCode == "upft" || mapData.stairs[h].downState) { + //上扶 + if (minupft > ms) { + minupft = ms; + selupftNo = mapData.stairs[h].no; + } + } else if (mapData.stairs[h].facCode == "downft" || mapData.stairs[h].upState) { + if (mindownft > ms) { + mindownft = ms; + seldownftNo = mapData.stairs[h].no; + } + } + } + } + //扶梯距离最小 + selupftNo != "" && (this.util.pathStateObj.seldtFacNo.no += selupftNo + ","); + seldownftNo != "" && (this.util.pathStateObj.seldtFacNo.no += seldownftNo + ","); + } + } + //console.log(this.util.pathStateObj.seldtFacNo); + } + + let noHas; + for (let j = 0; j < mapDataA.stairs.length; j++) { + if ( parseInt(mapDataA.stairs[j].navCode) > 0 && mapDataA.stairs[j].state) { + //排除禁用的设施 + noHas = true; + for (let k = 0; k < this.util.pathStateObj.facAllArr.length; k++) { + //Map_QM.util.pathStateObj.facAllArr 记录遍历结果 + if (this.util.pathStateObj.facAllArr[k][0].no != "" && + this.util.pathStateObj.facAllArr[k][0].navCode != "" && + parseInt(this.util.pathStateObj.facAllArr[k][0].navCode) > 0 && + this.util.pathStateObj.facAllArr[k][0].no == mapDataA.stairs[j].no + ) { + if (this.util.pathStateObj.facAllArr[k][0].facCode == mapDataA.stairs[j].facCode || + (this.util.pathStateObj.facAllArr[k][0].facCode.search("ft") != -1 && mapDataA.stairs[j].facCode.search("ft") != -1) + ) { + noHas = false; + mapDataA.stairs[j].floorOrder = floorOrder; + mapDataA.stairs[j].buildOrder = buildOrder; + this.util.pathStateObj.facAllArr[k].push(mapDataA.stairs[j]); + } + } + } + if (noHas) { + mapDataA.stairs[j].buildOrder = buildOrder; + mapDataA.stairs[j].floorOrder = floorOrder; + let array = [mapDataA.stairs[j]]; + this.util.pathStateObj.facAllArr.push(array); + } + } + } + }, + /** + * @api {方法} changeMapState("3d") 地图状态切换 + * @apiGroup 地图显示 + * @apiDescription 地图展示状态切换 + * @apiVersion 4.0.0 + * @apiParam {string} state 地图状态 + * + * @apiSampleRequest off + * + * @apiParamExample {String} 请求示例 + * + * Map_QM.changeMapState("2d"); + * + */ + changeMapState: function (state) { + Map_QM.controls.reset(); + if (state === "3d") { + Map_QM.camera = Map_QM.cameraPerspective; + Map_QM.controls.object = Map_QM.camera; + Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; + Map_QM.controls.maxPolarAngle = Math.PI / 2 - 0.2; + Map_QM.controls.setZoom(1); + Map_QM.changeIconState(state); + Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle); + } else { + Map_QM.camera = Map_QM.cameraOrtho; + Map_QM.controls.object = Map_QM.camera; + Map_QM.shawLight.castShadow = false; + Map_QM.controls.setZoom(Map_QM.util.m_zoom); + Map_QM.controls.maxPolarAngle = 0; + Map_QM.changeIconState(state); } }, + changeIconState: function (state, fIndex = -1) { + iconState = state; + fIndex = fIndex === -1 ? Map_QM.util.selectFloor : fIndex; + try{ + for (let i = 0; i < Map_QM.mapArr[Map_QM.util.selectBuild].length; i++) { + if (i == fIndex && Map_QM.buildObj.visible) { + Map_QM.mapArr[Map_QM.util.selectBuild][i].serObj.traverse((obj) => { + if (obj.userData && obj.userData.use) { + if (obj.userData.use != "all" && obj.userData.use != state) { + obj.visible = false; + obj.element && (obj.element.style.display = "none"); + } else { + obj.visible = true; + obj.element && (obj.element.style.display = ""); + } + } + }); + } + } + }catch(e){ + window.captureException && window.captureException(e); + console.log(e); + } + if (Map_QM.qiModel) { + Map_QM.qiModel.visible = state == "3d" ? true : false; + } + if (Map_QM.devModel) { + Map_QM.devModel.visible = state == "2d" && !Map_QM.util.pathStateObj.isPathState ? true : false; + } + if (Map_QM.qiIcon) { + Map_QM.qiIcon.visible = state == "2d" && Map_QM.util.pathStateObj.isPathState ? true : false; + } + }, + /** * @api {方法} changeBuild(buildOrder,floorOrder) 楼栋切换 * @apiGroup 地图交互 * @apiDescription 楼栋切换 传入楼栋编号,楼层编号 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {int} buildOrder 传入楼栋编号(默认 0) * @apiParam {int} floorOrder 传入楼栋编号(默认 0) * @@ -2069,47 +2364,44 @@ MainMap_QM.prototype = { */ changeBuild: function (buildOrder = 0, floorOrder = 0) { Map_QM.changeMapModel("3D"); - Map_QM.resetFloorState() + Map_QM.resetFloorState(); Map_QM.controls.reset(); - Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle) - Map_QM.clearFloor(Map_QM.util.selectFloor) - this.changeBuildInner(buildOrder, floorOrder) + Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle); + Map_QM.clearFloor(Map_QM.util.selectFloor); + this.changeBuildInner(buildOrder, floorOrder); }, changeBuildInner: function (build = -1, fIndex = -1) { - fIndex = fIndex == -1 ? parseInt(Map_QM.util.deviceObj.floor) : fIndex - build = build == -1 ? parseInt(Map_QM.util.deviceObj.build) : build - Map_QM.util.selectBuild = build - TweenMax.to(Map_QM.buildObj.position, 0.5, { - x: build * Map_QM.util.options.bSpace * -1, - onComplete: function () { - Map_QM.changeFloorInner(build, fIndex) //结束后切换楼层 - renderCount=0 - } - }) + fIndex = fIndex == -1 ? parseInt(Map_QM.util.deviceObj.floor) : fIndex; + build = build == -1 ? parseInt(Map_QM.util.deviceObj.build) : build; + Map_QM.util.selectBuild = build; + Map_QM.buildObj.position.x = -1 * build * Map_QM.util.options.bSpace; + Map_QM.changeFloorInner(build, fIndex); //结束后切换楼层 + renderCount = 0; }, + resetFloorState: function () { TweenMax.killAll(true); - Map_QM.util.pathStateObj.isPathState = false - Map_QM.controls.maxDistance = Map_QM.util.options.maxDis - clearTimeout(Map_QM.util.timeObj.collTime) - Map_QM.controls.enabled = true - Map_QM.controls.enableRotate = true - Map_QM.controls.minAzimuthAngle = -Infinity - Map_QM.controls.maxAzimuthAngle = Infinity - Map_QM.util.pathStateObj.forShopArr = { direction: '', wayList: [] } + Map_QM.util.pathStateObj.isPathState = false; + Map_QM.controls.maxDistance = Map_QM.util.options.maxDis; + clearTimeout(Map_QM.util.timeObj.collTime); + Map_QM.controls.enabled = true; + Map_QM.controls.enableRotate = true; + Map_QM.controls.minAzimuthAngle = -Infinity; + Map_QM.controls.maxAzimuthAngle = Infinity; + Map_QM.util.pathStateObj.forShopArr = { direction: "", wayList: [] }; if (Map_QM.guide && Map_QM.guide.visible) { - Map_QM.guide.visible = false + Map_QM.guide.visible = false; } if (Map_QM.endModel && Map_QM.endModel.visible) { - Map_QM.endModel.visible = false + Map_QM.endModel.visible = false; } }, /** * @api {方法} showFloor(floorOrder) 通过楼层编号切换楼层 * @apiGroup 地图交互 * @apiDescription 楼层切换,传入楼层编号,编号从下到上排序,最下面是0 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {int} floorOrder 楼层编号 * @@ -2121,21 +2413,113 @@ MainMap_QM.prototype = { * */ showFloor: function (fIndex = -1, callBack = undefined) { - Map_QM.changeStartPoint(); - Map_QM.changeMapModel("3D"); - Map_QM.resetFloorState(); - Map_QM.controls.reset(); - Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle) - Map_QM.clearFloor(fIndex); - if (fIndex != -1) { - Map_QM.changeFloorInner(-1, fIndex, callBack); - } + if (!Map_QM.buildObj.visible) { + return; + } + Map_QM.util.isMorePath = false; + Map_QM.util.pathStateObj.isPathState = false; + Map_QM.changeStartPoint(); + isShowElement = true; + allJU = true; + Map_QM.changeMapModel("3D"); + Map_QM.resetFloorState(); + Map_QM.controls.reset(); + if (Map_QM.util.initModelArr.length > 0) { + Map_QM.controls.setDistance(Map_QM.util.changeDist.inner - 25); + Map_QM.controls.update(); + } + Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle); + Map_QM.clearFloor(fIndex); + Map_QM.elementDestroy("all"); + if (fIndex != -1) { + Map_QM.changeFloorInner(-1, fIndex, callBack); + } + }, + + /** + * @api {方法} getAllIcon() 获取所有Icon + * @apiGroup 地图数据 + * @apiDescription 获取所有Icon + * @apiVersion 2.0.0 + * @apiParam {int} floorOrder 楼层编号(默认 所有) + * + * @apiSampleRequest off + * + */ + getAllIcon: function (floorOrder = -1, buildOrder = -1) { + let icons = [] + if (floorOrder != -1) { + let bd = buildOrder == -1 ? Map_QM.util.selectBuild : buildOrder + let sers = Map_QM.mapArr[bd][floorOrder].serObj.children //服务图标 + for (let n = 0; n < sers.length; n++) { + if (sers[n].type == 'Object3D') { + let title = sers[n].userData.title || Map_QM.util.getFacName(sers[n].facCode) + let titleEn = sers[n].userData.titleEn || title; + let type = sers[n].userData.facCode; + let imgUrl = sers[n].userData.src; + if (sers[n].facCode == 'upft' || sers[n].facCode == 'downft' || sers[n].facCode == 'ft') { + if (title == '上扶梯' || title == '下扶梯') { + title = '扶梯' + } + type = 'ft' + } + let icon = { type: type, floor: floorOrder, imgUrl: imgUrl, title: title, titleEn: titleEn } + icons.push(icon) + } + } + return icons + } + + for (let j = 0; j < Map_QM.mapArr.length; j++) { + let iconBuild = [] + for (let i = 0; i < Map_QM.mapArr[j].length; i++) { + let iconArr = [] + if (Map_QM.mapArr[j][i].serObj) { + let sers = Map_QM.mapArr[j][i].serObj.children //服务图标 + for (let n = 0; n < sers.length; n++) { + if (sers[n].type == 'Object3D') { + let title = sers[n].userData.title || Map_QM.util.getFacName(sers[n].facCode) + let titleEn = sers[n].userData.titleEn || title; + let type = sers[n].userData.facCode; + let imgUrl = sers[n].userData.src; + if (sers[n].facCode == 'upft' || sers[n].facCode == 'downft' || sers[n].facCode == 'ft') { + title = '扶梯' + type = 'ft' + } + let icon = { type: type, floor: i, imgUrl: imgUrl, title: title, titleEn: titleEn } + iconArr.push(icon) + } + } + } + iconBuild.push(iconArr) + } + icons.push(iconBuild) + } + return icons + }, + /** + * @api {方法} queryAllMapData() 获取地图原始数据 + * @apiGroup 地图数据 + * @apiDescription 获取地图接口数据 + * @apiVersion 4.0.1 + * + * @apiSampleRequest off + * @apiParamExample {String} 请求示例 + * + * Map_QM.queryAllMapData(); + */ + queryAllMapData: function () { + return JSON.stringify({ + mallCode: Map_QM.util.mallCode, + MapInfo: Map_QM.util.allMap, + key: "Aeditor", + }); }, /** * @api {方法} changeFloorByName(floorOrder) 通过楼层名称切换楼层 * @apiGroup 地图交互 * @apiDescription 楼层切换,传入楼层名称, - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {String} floorName 楼层名称 * @@ -2145,67 +2529,82 @@ MainMap_QM.prototype = { * Map_QM.changeFloorByName("L1"); */ changeFloorByName: function (floorName) { - let floors = Map_QM.mapArr[Map_QM.util.selectBuild] + let floors = Map_QM.mapArr[Map_QM.util.selectBuild]; for (let i = 0; i < floors.length; i++) { if (floors[i].floorName == floorName) { - Map_QM.showFloor(floors[i].floorOrder) - return + Map_QM.showFloor(floors[i].floorOrder); + return; } } }, - changeFloorInner: function (build = -1, fIndex = -1, callBack = undefined, endIndex = -1, midIndex = -1) { + /** + * @api {方法} changeFloorByCode(floorCode) 通过楼层code切换楼层 + * @apiGroup 地图交互 + * @apiDescription 楼层切换,传入楼层code, + * @apiVersion 4.0.0 + * + * @apiParam {String} floorCode 楼层code + * + * @apiSampleRequest off + * @apiParamExample {String} 请求示例 + * + * Map_QM.changeFloorByCode("Ek_MaiuKLPjakB1uB0uQV"); + */ + changeFloorByCode: function (floorCode) { + for (let kk = 0; kk < Map_QM.util.allMap.length; kk++) { + for (var iii = 0; iii < Map_QM.util.allMap[kk].buildArr.length; iii++) { + if (Map_QM.util.allMap[kk].buildArr[iii].code == floorCode) { + Map_QM.changeBuild(kk, iii); + return; + } + } + } + }, + changeFloorInner: function (build = -1,fIndex = -1,callBack = undefined) { fIndex = fIndex != -1 ? fIndex : Map_QM.util.deviceObj.floor; - build = build != -1 ? build : Map_QM.util.deviceObj.build; - for (let t = 0; t < Map_QM.mapArr.length; t++) { - 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].CSSObj.traverse((obj) => { - obj.element && (obj.element.style.display = "none"); - }); - } - } - if (Map_QM.mapArr[build] && Map_QM.mapArr[build][fIndex]) { - Map_QM.mapArr[build][fIndex].allObj.visible = true; - } else { - return; - } - for (let i = 0; i < Map_QM.mapArr[build].length; i++) { - if (i == fIndex) { - Map_QM.mapArr[build][i].allObj.visible = true; - Map_QM.mapArr[build][i].CSSObj.traverse((obj) => { - obj.element && obj.userData.isShow && obj.userData.type== "icon" && (obj.element.style.display = ""); - }); - Map_QM.changeIconState(iconState,fIndex); - } else { - Map_QM.mapArr[build][i].allObj.visible = false; - } - if (i == Map_QM.mapArr[build].length - 1) { - if (build == Map_QM.util.selectBuild && fIndex == Map_QM.util.selectFloor) { - if (callBack) callBack(); - Map_QM.timeOutInit(); - } else { - Map_QM.util.selectBuild = build; - Map_QM.util.selectFloor = fIndex; - if (Map_QM.util.options.shadow) { - TweenMax.fromTo(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.position, 0.2, { z: Map_QM.util.options.fSpace }, { - z: 0, ease: Cubic.easeIn, onComplete: function () { - Map_QM.timeOutInit(); - if (callBack) callBack(); - } - }); - } else { - Map_QM.timeOutInit() - if (callBack) callBack() - } - } - } - } + build = build != -1 ? build : Map_QM.util.deviceObj.build; + for (let t = 0; t < Map_QM.mapArr.length; t++) { + 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].CSSObj.traverse((obj) => { + obj.element && (obj.element.style.display = "none"); + }); + } + } + if (Map_QM.mapArr[build] && Map_QM.mapArr[build][fIndex]) { + Map_QM.mapArr[build][fIndex].allObj.visible = true; + } else { + return; + } + for (let i = 0; i < Map_QM.mapArr[build].length; i++) { + if (i == fIndex) { + Map_QM.mapArr[build][i].allObj.visible = true; + Map_QM.mapArr[build][i].CSSObj.traverse((obj) => { + obj.element && obj.userData.isShow && obj.userData.type == "icon" && (obj.element.style.display = ""); + }); + Map_QM.changeIconState(iconState, fIndex); + } else { + Map_QM.mapArr[build][i].allObj.visible = false; + } + if (i == Map_QM.mapArr[build].length - 1) { + if (build == Map_QM.util.selectBuild && fIndex == Map_QM.util.selectFloor ) { + if (callBack) callBack(); + Map_QM.timeOutInit(); + } else { + Map_QM.util.selectBuild = build; + Map_QM.util.selectFloor = fIndex; + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.position.z = 0; + Map_QM.timeOutInit(); + if (callBack) callBack(); + } + } + } }, /** * @api {方法} onShowMeDir() 我的方向 * @apiGroup 地图显示 * @apiDescription 我的方向 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * @@ -2218,51 +2617,274 @@ MainMap_QM.prototype = { if (Map_QM.util.pathStateObj.isPathState) { Map_QM.changePathDir("2D"); }else{ - this.onInnerMeDir() + this.onInnerMeDir(); } }, onInnerMeDir: function () { if (this.util.selectBuild != this.util.deviceObj.build || this.util.selectFloor != this.util.deviceObj.floor) { - this.changeFloorInner(this.util.deviceObj.build, this.util.deviceObj.floor) - } - TweenMax.killAll(true) - this.changeMapModel("2D") - Map_QM.controls.reset() - clearTimeout(shopTime) - isJUZ=false; - Map_QM.controls.minPolarAngle = 0 - if (Map_QM.util.deviceObj.xaxis || Map_QM.util.deviceObj.yaxis) { - Map_QM.mapToPoint(Map_QM.util.deviceObj.xaxis, Map_QM.util.deviceObj.yaxis, 0) - } else { - Map_QM.mapToPoint(0, 0, 0) - } - Map_QM.controls.setZoom(Map_QM.util.options.camZoom) - Map_QM.rotationAngle(Map_QM.util.deviceObj.angle) - Map_QM.controls.enableRotate = false + this.changeFloorInner(this.util.deviceObj.build, this.util.deviceObj.floor); + } + TweenMax.killAll(true); + this.changeMapModel("2D"); + Map_QM.controls.reset(); + clearTimeout(shopTime); + isJUZ = false; + Map_QM.controls.minPolarAngle = 0; + if (Map_QM.util.deviceObj.xaxis || Map_QM.util.deviceObj.yaxis) { + Map_QM.mapToPoint(Map_QM.util.deviceObj.xaxis, Map_QM.util.deviceObj.yaxis, 0 ); + } else { + Map_QM.mapToPoint(0, 0, 0); + } + Map_QM.rotationAngle(Map_QM.util.deviceObj.angle); + Map_QM.controls.enableRotate = false; + Map_QM.controls.setDistance(150); //放大 + Map_QM.updateRender(); + Map_QM.collLabel(); }, changeMapModel: function (model) { if (model == '2D') { - Map_QM.util.setModelState('2d') + Map_QM.changeIconState("2d"); Map_QM.controls.maxPolarAngle = 0 Map_QM.camera = Map_QM.cameraOrtho Map_QM.controls.object = Map_QM.camera Map_QM.camera.updateProjectionMatrix() + Map_QM.shawLight.castShadow = false; } else { - Map_QM.util.setModelState('3d') + Map_QM.changeIconState("3d"); Map_QM.camera = Map_QM.cameraPerspective Map_QM.controls.object = Map_QM.camera Map_QM.controls.maxPolarAngle = Math.PI / 2 - 0.02 Map_QM.camera.updateProjectionMatrix() + Map_QM.shawLight.castShadow = Map_QM.util.options.shadow; } Map_QM.updateRender(); }, + /** + * @api {方法} toOutModel() 显示外立面模型 + * @apiGroup 地图显示 + * @apiDescription 显示外立面模型 + * @apiVersion 4.0.0 + * + * @apiSampleRequest off + * @apiParamExample {String} 请求示例 + * + * Map_QM.toOutModel(); + */ + toOutModel: function () { + TweenMax.killAll(true); + Map_QM.controls.setDistance(Map_QM.util.changeDist.inner + 25); + Map_QM.controls.update(); + Map_QM.disPlayEvent(); + renderCount = 0; + Map_QM.resetModel(); + }, + toOutModelInner: function () { + TweenMax.killAll(true); + Map_QM.emitChangeMap("out"); + Map_QM.hideFloor(); + Map_QM.buildObj.visible = false; + TweenMax.to(Map_QM.peripheryGap.scale, 0.3, { + y: 0.01, + ease: Quad.easeIn, + onComplete: function () { + Map_QM.hideObjecrGap(Map_QM.peripheryGap, false); //隐藏外立面 + Map_QM.hideObjecrGap(Map_QM.perObject, false); + }, + }); + if (!Map_QM.outModelGap.visible) { + Map_QM.hideObjecrGap(Map_QM.outModelGap, true); + Map_QM.hideObjecrGap(Map_QM.outObject, true); + TweenMax.to(Map_QM.outModelGap.scale, 0.6, { + y: 1, + ease: Quad.easeIn, + onComplete: function () { }, + }); + } else { + mapState = "out"; + } + Map_QM.rotateAngle(70); + startRotate = true; + }, + hideFloor: function () { + Map_QM.changeMapModel("3D"); + Map_QM.resetFloorState(); + Map_QM.clearFloor(); + Map_QM.hideInnerFloorElement(); + }, + /** + * @api {方法} toPeriphery() 显示周边模型 + * @apiGroup 地图显示 + * @apiDescription 显示周边模型 + * @apiVersion 4.0.0 + * + * @apiSampleRequest off + * @apiParamExample {String} 请求示例 + * + * Map_QM.toPeriphery(); + */ + toPeriphery: function () { + TweenMax.killAll(true); + Map_QM.controls.setDistance(Map_QM.util.changeDist.outner + 25); + Map_QM.controls.update(); + Map_QM.disPlayEvent(); + renderCount = 0; + }, + toPeripheryInner: function () { + TweenMax.killAll(true); + Map_QM.emitChangeMap("periphery"); + startRotate = false; + Map_QM.outModelGap.rotateY(-1 * Map_QM.outModelGap.rotation.y); + Map_QM.hideFloor(); + TweenMax.to(Map_QM.outModelGap.scale, 0.3, { + y: 0.01, + ease: Quad.easeIn, + onComplete: function () { + Map_QM.buildObj.visible = false; + Map_QM.hideObjecrGap(Map_QM.outModelGap, false); //隐藏外立面 + Map_QM.hideObjecrGap(Map_QM.outObject, false); + }, + }); + if (!Map_QM.peripheryGap.visible) { + Map_QM.hideObjecrGap(Map_QM.peripheryGap, true); + TweenMax.to(Map_QM.peripheryGap.scale, 0.6, { + y: 1, + ease: Quad.easeIn, + onComplete: function () { + Map_QM.changePerTag("mark"); + }, + }); + } else { + mapState = "periphery"; + } + Map_QM.rotateAngle(45); + }, + /** + * @api {方法} hideInnerFloorElement() 隐藏室内楼层元素 + * @apiGroup 地图显示 + * @apiDescription 隐藏室内楼层元素 + * @apiVersion 4.0.0 + * + * @apiSampleRequest off + * @apiParamExample 请求示例 + * + * Map_QM.hideInnerFloorElement(); + */ + hideInnerFloorElement: function () { + isShowElement = false; + for (let t = 0; t < Map_QM.mapArr.length; t++) { + for (let i = 0; i < Map_QM.mapArr[t].length; i++) { + Map_QM.mapArr[t][i].CSSObj.traverse((obj) => { + obj.element && (obj.element.style.display = "none"); + if (obj.children && obj.children.length > 0) { + obj.traverse((item) => { + item.element && (item.element.style.display = "none"); + }); + } + }); + } + } + }, + + /** + * @api {方法} toMall() 显示室内模型 + * @apiGroup 地图显示 + * @apiDescription 显示室内模型 + * @apiVersion 4.0.0 + * + * @apiSampleRequest off + * @apiParamExample {String} 请求示例 + * + * Map_QM.toMall(); + */ + toMall: function () { + Map_QM.controls.setDistance(Map_QM.util.changeDist.inner - 25); + Map_QM.controls.update(); + Map_QM.disPlayEvent(); + renderCount = 0; + }, + toMallInner: function () { + isShowElement = true; + TweenMax.killAll(true); + Map_QM.emitChangeMap("mall"); + startRotate = false; + Map_QM.outModelGap.rotateY(-1 * Map_QM.outModelGap.rotation.y); + if (Map_QM.outModelGap.visible) { + TweenMax.to(Map_QM.outModelGap.scale, 0.5, { + y: 0.01, + ease: Quad.easeIn, + onComplete: function () { + Map_QM.buildObj.visible = true; + Map_QM.hideObjecrGap(Map_QM.outModelGap, false); //隐藏外立面 + Map_QM.hideObjecrGap(Map_QM.outObject, false); + Map_QM.onShowDeviceSite(); + }, + }); + } else { + if (Map_QM.peripheryGap.visible) { + TweenMax.to(Map_QM.peripheryGap.scale, 0.5, { + y: 0.01, + ease: Quad.easeIn, + onComplete: function () { + Map_QM.hideObjecrGap(Map_QM.peripheryGap, false); //隐藏外立面 + Map_QM.hideObjecrGap(Map_QM.perObject, false); + Map_QM.buildObj.visible = true; + Map_QM.onShowDeviceSite(); + }, + }); + } else { + Map_QM.buildObj.visible = true; + Map_QM.onShowDeviceSite(); + } + } + }, + //设置地图状态为室内状态 + setMall: function () { + isShowElement = true; + TweenMax.killAll(true); + Map_QM.emitChangeMap("mall"); + startRotate = false; + Map_QM.outModelGap.rotateY(-1 * Map_QM.outModelGap.rotation.y); + Map_QM.hideObjecrGap(Map_QM.outModelGap, false); //隐藏外立面 + Map_QM.hideObjecrGap(Map_QM.outObject, false); + Map_QM.hideObjecrGap(Map_QM.peripheryGap, false); //隐藏外立面 + Map_QM.hideObjecrGap(Map_QM.perObject, false); + Map_QM.buildObj.visible = true; + Map_QM.onShowDeviceSite(); + renderCount = 0; + }, + + emitChangeMap: function (state) { + if (mapState != state) { + mapState = state; + Map_QM.dispatchEvent({ + type: "mapShowChange", + data: mapState, + }); + } + }, + hideObjecrGap: function (gap, isShow) { + gap.visible = isShow; + gap.traverse((obj) => { + if (obj.userData && obj.userData.type == "2d_IP") { + if (obj.element) { + if (isShow) { + obj.element.style.visibility = + obj.userData.show == language ? "visible" : "hidden"; + } else { + obj.element.style.visibility = "hidden"; + } + } + } + }); + }, /** * @api {方法} onShowLocalSite(0) 局部显示放大 * @apiGroup 地图显示 * @apiDescription 局部显示放大 point 传入放大目标点,zoom放大级别 1-5 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {Object} point 放大的地图位置 + * @apiParam {int} zoom 放大倍数(默认 1) * * @apiSampleRequest off * @@ -2271,31 +2893,51 @@ MainMap_QM.prototype = { * Map_QM.onShowLocalSite({x:0,y:0},1); * */ - onShowLocalSite: function (centerPoint, juZ=true) { + onShowLocalSite: function (centerPoint, juZ = true) { Map_QM.controls.setZoom(1) - Map_QM.controls.reset() + Map_QM.controls.reset(); if (Map_QM.util.initModelArr.length > 0 && Map_QM.util.changeDist.inner > Map_QM.util.options.minDis) { - Map_QM.controls.maxDistance = Map_QM.util.changeDist.inner; - } - Map_QM.mapToPoint(centerPoint.x, centerPoint.y, 0); + Map_QM.controls.maxDistance = Map_QM.util.changeDist.inner; + } + Map_QM.mapToPoint(centerPoint.x, centerPoint.y, 0); + if (!juZ) { + allJU = false; + } isJUZ = juZ; + Map_QM.updateRender(); + Map_QM.collLabel(); }, - //底图二维坐标转 3D模型三维坐标 + /** + * @api {方法} mapToPoint() 镜头聚焦特定点 + * @apiGroup 地图显示 + * @apiDescription 镜头聚焦特定点 + * @apiVersion 4.0.0 + * @apiParam {int} x x坐标 + * @apiParam {int} y y坐标 + * @apiParam {int} z z坐标 + * + * @apiSampleRequest off + * + * @apiParamExample {Object} 请求示例 + * + * Map_QM.mapToPoint(0,0,1); + * + */ mapToPoint: function (mapX, mapY, mapZ) { - let tag0 = Map_QM.controls.target - let pos0 = Map_QM.controls.object.position - let vct = new THREE.Vector3(mapX, -1 * mapY, mapZ) - vct.applyMatrix4(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.matrix); - vct.applyMatrix4(Map_QM.sceneGap.matrix) - Map_QM.controls.target = new THREE.Vector3(vct.x, vct.y, vct.z ) - Map_QM.controls.object.position.set(pos0.x+(vct.x-tag0.x), pos0.y+(vct.y-tag0.y), pos0.z+(vct.z-tag0.z)) - return vct; - }, + let tag0 = Map_QM.controls.target; + let pos0 = Map_QM.controls.object.position; + let vct = new THREE.Vector3(mapX, -1 * mapY, mapZ); + vct.applyMatrix4(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.matrix); + vct.applyMatrix4(Map_QM.sceneGap.matrix); + Map_QM.controls.target = new THREE.Vector3(vct.x, vct.y, vct.z); + Map_QM.controls.object.position.set(pos0.x + (vct.x - tag0.x), pos0.y + (vct.y - tag0.y), pos0.z + (vct.z - tag0.z)); + return vct; + }, /** * @api {方法} onShowDeviceSite() 地图方向复位 * @apiGroup 地图显示 * @apiDescription 地图方向复位 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * @@ -2305,40 +2947,34 @@ MainMap_QM.prototype = { * */ onShowDeviceSite: function () { - this.showFloor(this.util.deviceObj.floor) + this.showFloor(this.util.deviceObj.floor); }, /** * 在2D 状态下平移镜头 */ moveCameraBy2D: function (obj) { if (pathCameraState == "2D" && Map_QM.camera == Map_QM.cameraOrtho) { - Map_QM.controls.minAzimuthAngle = Map_QM.util.deviceObj.angle * Math.PI / -180; - Map_QM.controls.maxAzimuthAngle = Map_QM.util.deviceObj.angle * Math.PI / -180; - - Map_QM.mapToPoint(obj.x, obj.y, 0); + Map_QM.controls.minAzimuthAngle = (Map_QM.util.deviceObj.angle * Math.PI) / -180; + Map_QM.controls.maxAzimuthAngle = (Map_QM.util.deviceObj.angle * Math.PI) / -180; + Map_QM.mapToPoint(obj.x, obj.y, 0); Map_QM.controls.update(); - } + } }, /** * 方向复位 */ resetMeDir: function () { - this.util.setModelState("3d"); - this.changeMapState("3d"); - this.controls.setZoom(1); - this.controls.minAzimuthAngle = -Infinity; - this.controls.maxAzimuthAngle = Infinity; - this.shawLight.castShadow = this.util.options.shadow; - this.controls.reset(); - setTimeout(()=>{ - this.util.options.deviceAng && this.rotationAngle(this.util.deviceObj.angle) - },500) + this.changeMapState("3d"); + this.controls.minAzimuthAngle = -Infinity; + this.controls.maxAzimuthAngle = Infinity; + this.controls.reset(); + this.util.options.deviceAng && this.rotationAngle(this.util.deviceObj.angle); }, /** * @api {方法} changePathDir(pathState) 切换导航方向 * @apiGroup 地图交互 * @apiDescription 切换导航方向 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {String} pathState 地图导航方向(默认 3D) * @@ -2349,48 +2985,50 @@ MainMap_QM.prototype = { * Map_QM.changePathDir("2D"); * */ - changePathDir: function (pathState = '3D') { - if (Map_QM.util.pathStateObj.isPathState) { //导航状态 - let initVis = false; - if (Map_QM.endModel && Map_QM.endIcon) { - initVis = pathCameraState == "2D" ? Map_QM.endIcon.visible : Map_QM.endModel.visible; - } - pathCameraState = pathState; - if (Map_QM.endModel && Map_QM.endIcon) { - Map_QM.endModel.visible = pathCameraState == "2D" ? false : initVis; - Map_QM.endIcon.visible = pathCameraState == "2D" ? initVis : false; - } - Map_QM.reSetGuide(); - Map_QM.pathRePlay(); - } + changePathDir: function (pathState = "3D") { + if (Map_QM.util.pathStateObj.isPathState) { + //导航状态 + let initVis = false; + if (Map_QM.endModel && Map_QM.endIcon) { + initVis = pathCameraState == "2D" ? Map_QM.endIcon.visible : Map_QM.endModel.visible; + } + pathCameraState = pathState; + if (Map_QM.endModel && Map_QM.endIcon) { + Map_QM.endModel.visible = pathCameraState == "2D" ? false : initVis; + Map_QM.endIcon.visible = pathCameraState == "2D" ? initVis : false; + } + Map_QM.reSetGuide(); + Map_QM.pathRePlay(); + } }, reSetGuide: function () { - if (pathCameraState == "2D") { //2D导航 - Map_QM.onInnerMeDir(); - Map_QM.guide.visible = false; - let pos = Map_QM.guide.position; - Map_QM.guide = Map_QM.man_2d; - Map_QM.guide.position.x = pos.x; - Map_QM.guide.position.y = pos.y; - Map_QM.guide.visible = true; - Map_QM.controls.enabled = false; - } else { - Map_QM.resetMeDir(); - Map_QM.controls.enabled = true; - Map_QM.controls.enableRotate = true; - Map_QM.guide.visible = false; - let pos = Map_QM.guide.position; - Map_QM.guide = Map_QM.man_3d; - Map_QM.guide.position.x = pos.x; - Map_QM.guide.position.y = pos.y; - Map_QM.guide.visible = true; - } - }, + if (pathCameraState == "2D") { + //2D导航 + Map_QM.onInnerMeDir(); + Map_QM.guide.visible = false; + let pos = Map_QM.guide.position; + Map_QM.guide = Map_QM.man_2d; + Map_QM.guide.position.x = pos.x; + Map_QM.guide.position.y = pos.y; + Map_QM.guide.visible = true; + Map_QM.controls.enabled = false; + } else { + Map_QM.resetMeDir(); + Map_QM.controls.enabled = true; + Map_QM.controls.enableRotate = true; + Map_QM.guide.visible = false; + let pos = Map_QM.guide.position; + Map_QM.guide = Map_QM.man_3d; + Map_QM.guide.position.x = pos.x; + Map_QM.guide.position.y = pos.y; + Map_QM.guide.visible = true; + } + }, /** * @api {方法} queryObject3DByShopNum(ipName) 获取3D对象 * @apiGroup 地图交互 * @apiDescription 获取3D对象 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {string} ipName POI名称 * * @apiSampleRequest off @@ -2403,21 +3041,21 @@ MainMap_QM.prototype = { queryObject3DByShopNum: function (ipName) { for (let b = 0; b < Map_QM.mapArr.length; b++) { for (let i = 0; i < Map_QM.mapArr[b].length; i++) { - let shopArr = Map_QM.mapArr[b][i].shopObj.children + let shopArr = Map_QM.mapArr[b][i].shopObj.children; for (let k = 0; k < shopArr.length; k++) { if (shopArr[k].name == ipName) { - return shopArr[k] + return shopArr[k]; } } } } - return null + return null; }, /** * @api {方法} parseSelectShop() 设置选中店铺弹跳 * @apiGroup 地图交互 * @apiDescription 设置选中店铺弹跳 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {object3D} selObject 传入3D对象 * @@ -2430,25 +3068,25 @@ MainMap_QM.prototype = { */ parseSelectShop: function (selObject) { if (selObject) { - Map_QM.selectShop = selObject - TweenMax.to(Map_QM.selectShop.scale, 0.5, { - z: 3, repeat: 4, yoyo: true, ease: Cubic.easeIn, - onComplete: function () { - if (Map_QM.selectShop) { - TweenMax.to(Map_QM.selectShop.scale, 0.5, { z: 1 }); - } - } - }); - if (Map_QM.util.options.inArea && Map_QM.camera != Map_QM.cameraOrtho) { - Map_QM.onShowLocalSite(new Map_QM.util.Point(Map_QM.selectShop.xaxis, Map_QM.selectShop.yaxis)); - } - } + Map_QM.selectShop = selObject; + TweenMax.to(Map_QM.selectShop.scale, 0.5, { + z: 3, repeat: 4, yoyo: true, ease: Cubic.easeIn, + onComplete: function () { + if (Map_QM.selectShop) { + TweenMax.to(Map_QM.selectShop.scale, 0.5, { z: 1 }); + } + }, + }); + if (Map_QM.util.options.inArea && Map_QM.camera != Map_QM.cameraOrtho) { + Map_QM.onShowLocalSite(new Map_QM.util.Point(Map_QM.selectShop.xaxis, Map_QM.selectShop.yaxis)); + } + } }, /** * @api {方法} cancelSelectShop() 取消店铺弹跳 * @apiGroup 地图交互 * @apiDescription 取消店铺弹跳效果 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * @@ -2458,16 +3096,16 @@ MainMap_QM.prototype = { * */ cancelSelectShop: function () { - TweenMax.killAll(true) + TweenMax.killAll(true); if (Map_QM.selectShop) { - Map_QM.selectShop.scale.z = 1 + Map_QM.selectShop.scale.z = 1; } }, /** * @api {方法} changeStateShopPro(isShow) 店铺促销标签 * @apiGroup 地图交互 * @apiDescription 店铺促销标签展示/隐藏 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {boolean} isShow 店铺促销标签是否显示(默认 false) * @@ -2479,17 +3117,17 @@ MainMap_QM.prototype = { * */ changeStateShopPro: function (isShow = false) { - if(Map_QM.mapArr[Map_QM.util.selectBuild]){ - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].tagObj.traverse((obj) => { - obj.element && (obj.element.style.visibility = isShow?"visible":"hidden") - }); - } + if (Map_QM.mapArr[Map_QM.util.selectBuild]) { + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].tagObj.traverse((obj) => { + obj.element && (obj.element.style.display = isShow ? "block" : "none"); + }); + } }, /** * @api {方法} changeShowTagObjState(isShow) 自定义标签 * @apiGroup 地图交互 * @apiDescription 自定义标签展示/隐藏 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {boolean} isShow 自定义标签是否显示(默认 false) * @@ -2501,16 +3139,16 @@ MainMap_QM.prototype = { * */ changeShowTagObjState: function (isShow = false) { - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].showTagObj.traverse(obj => { - obj.visible = isShow - }) + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].showTagObj.traverse((obj) => { + obj.visible = isShow; + }); }, /** * @api {方法} queryShopList() 获取店铺列表信息 * @apiGroup 地图数据 * @apiDescription 店铺列表 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * @@ -2520,14 +3158,14 @@ MainMap_QM.prototype = { * */ queryShopList: function () { - return JSON.parse(JSON.stringify(Map_QM.util.shopData)) + return JSON.parse(JSON.stringify(Map_QM.util.shopData)); }, - + /** * @api {方法} rotationAngle(angle) 改变水平角度 * @apiGroup 地图显示 - * @apiDescription 改变地图水平角度 angle>-180 && angle<180 - * @apiVersion 2.0.0 + * @apiDescription 改变地图水平角度 angle>-180 && angle<180 逆时针旋转 + * @apiVersion 4.0.0 * * @apiParam {int} angle 旋转角度 * @@ -2540,13 +3178,13 @@ MainMap_QM.prototype = { */ rotationAngle: function (angle) { Map_QM.controls.setRotateHorizontal(Map_QM.controls.getRotateHorizontal()); - Map_QM.controls.setRotateHorizontal(angle / 180 * Math.PI) + Map_QM.controls.setRotateHorizontal((angle / 180) * Math.PI); }, /** * @api {方法} rotateAngle(angle) 改变垂直角度 * @apiGroup 地图显示 * @apiDescription 改变地图垂直角度 angle>-90 && angle<90 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {int} angle 旋转角度 * @@ -2558,13 +3196,15 @@ MainMap_QM.prototype = { * */ rotateAngle: function (angle) { - Map_QM.controls.rotate(angle / 180 * Math.PI) + let r0 = Map_QM.controls.getRotate(); + Map_QM.controls.rotate(r0); + Map_QM.controls.rotate((angle / -180) * Math.PI); }, /** * @api {方法} setCameraDist(cDist) 调整地图大小 * @apiGroup 地图显示 * @apiDescription 调整地图大小(值越小地图越大) Map_QM.util.options.minDis ~ Map_QM.util.options.maxDis - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {int} cDist 摄像头距离 * @@ -2577,22 +3217,22 @@ MainMap_QM.prototype = { */ setCameraDist: function (cDist) { if (Map_QM.util.options.minDis < parseInt(cDist) && parseInt(cDist) < Map_QM.util.options.maxDis) { - let oldObj = { dis: Map_QM.controls.getDistance() } - TweenMax.killAll(true) + let oldObj = { dis: Map_QM.controls.getDistance() }; + TweenMax.killAll(true); TweenMax.to(oldObj, 0.5, { dis: cDist, onUpdate: function () { - Map_QM.controls.setDistance(oldObj.dis) - Map_QM.controlsChock() - } - }) + Map_QM.controls.setDistance(oldObj.dis); + Map_QM.controlsChock(); + }, + }); } }, /** * @api {方法} startRender() 启动地图渲染 * @apiGroup 地图显示 * @apiDescription 启动地图渲染 与 cancelRender 配合使用可节约资源 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * @apiParamExample 请求示例 @@ -2601,31 +3241,54 @@ MainMap_QM.prototype = { * */ startRender: function () { - Map_QM.cancelRender() - let T = Map_QM.util._clock.getDelta() + Map_QM.cancelRender(); + let T = Map_QM.util._clock.getDelta(); Map_QM.controls.update(); - Map_QM.renderer.render(Map_QM.scene, Map_QM.camera); - Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera); - if(renderCount<3){ - if(Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]){ - Map_QM.labelRenderer.renderObject( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].CSSObj, Map_QM.camera ); - } - renderCount++; - } - Map_QM.CSSObject && Map_QM.labelRenderer.renderObject( Map_QM.CSSObject, Map_QM.camera); - for (let item of Map_QM.mixers) { - item.update(T) - } - if (debug) { - stats.update() - } - renderFrame = requestAnimationFrame(Map_QM.startRender) + Map_QM.renderer.render(Map_QM.scene, Map_QM.camera); + Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera); + if (renderCount < 3) { + if (Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) { + Map_QM.labelRenderer.renderObject(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].CSSObj, Map_QM.scene, Map_QM.camera); + } + renderCount++; + } + Map_QM.CSSObject && Map_QM.labelRenderer.renderObject(Map_QM.CSSObject, Map_QM.scene, Map_QM.camera); + for (let item of Map_QM.mixers) { + item.update(T); + } + if (startRotate) { + let y0 = Map_QM.outModelGap.rotation.y; + Map_QM.outModelGap.rotateY(0.002); + let ay = Map_QM.outModelGap.rotation.y - y0; //>0 + + let ang = -1 * Map_QM.outModelGap.rotation.y; + if (ay > 0) { + if (Map_QM.outModelGap.rotation.y > 0) { + ang = Map_QM.outModelGap.rotation.y - Math.PI; + } else { + ang = Map_QM.outModelGap.rotation.y + Math.PI; + } + } + ang -= Map_QM.controls.getRotateHorizontal() - Math.PI; + ang = ang > Math.PI ? ang - 2 * Math.PI : ang; + ang = ang < -1 * Math.PI ? ang + 2 * Math.PI : ang; + if (Map_QM.util.options.northShow) { + Map_QM.util.img.style.transform = "rotate(" + ((Math.PI - ang) * 180) / Math.PI + "deg)"; + } + } else if (Map_QM.util.options.northShow) { + let a = Map_QM.controls.getRotateHorizontal(); + if (Map_QM.outModelGap.visible) { + Map_QM.util.img.style.transform = "rotate(" +((Math.PI - (Map_QM.outModelGap.rotation.y - a)) * 180) / Math.PI +"deg)"; + } else { + Map_QM.util.img.style.transform = "rotate(" + (a * 180) / Math.PI + "deg)"; + } + } + renderFrame = requestAnimationFrame(Map_QM.startRender); }, /** * @api {方法} cancelRender() 取消地图渲染 * @apiGroup 地图显示 * @apiDescription 取消地图渲染 与 startRender 配合使用可节约资源 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * @@ -2635,15 +3298,15 @@ MainMap_QM.prototype = { * */ cancelRender: function () { - window.cancelAnimationFrame(renderFrame) - renderFrame = -1 + window.cancelAnimationFrame(renderFrame); + renderFrame = -1; }, /** * @api {方法} addElementLabel() 地图html标签 * @apiGroup 地图交互 * @apiDescription 地图显示Html标签,返回3d标签对象 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {Element} divObj div对象 * @apiParam {int} x 显示X坐标 @@ -2655,24 +3318,26 @@ MainMap_QM.prototype = { * @apiParamExample {String} 请求示例 * Map_QM.addElementLabel(divObj,x,y); */ - addElementLabel: function (divObj, x, y, z = 50, type = 'shopInfo') { - divObj.style.opacity = 0 - Map_QM.elementDestroy(type) + addElementLabel: function (divObj, x, y, z = 50, type = "shopInfo") { + divObj.style.opacity = 0; let shopInfo = new THREE.CSS2DObject(divObj); - shopInfo.position.set(x, -1 * y, z); - shopInfo.applyMatrix4(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.matrix); - shopInfo.userData.type = type - shopInfo.userData.isShow = false - shopInfo.userData.floor = parseInt(Map_QM.util.selectFloor) - Map_QM.CSSObject.add(shopInfo) - TweenMax.to(divObj.style, 0.2, { opacity: 1, delay: 0.1 }) - return shopInfo + shopInfo.position.set(x, -1 * y, z); + shopInfo.applyMatrix4( + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.matrix + ); + shopInfo.userData.type = type; + shopInfo.userData.isShow = false; + shopInfo.userData.floor = parseInt(Map_QM.util.selectFloor); + Map_QM.CSSObject.add(shopInfo); + TweenMax.to(divObj.style, 0.2, { opacity: 1, delay: 0.1 }); + return shopInfo; }, + /** * @api {方法} updateElementPosition() 修改标签位置 * @apiGroup 地图交互 * @apiDescription 修改标签位置 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {Object} obj 对象 * @apiParam {int} x 新的X坐标 * @apiParam {int} y 新的Y坐标 @@ -2685,17 +3350,17 @@ MainMap_QM.prototype = { * */ updateElementPosition: function (obj, x, y) { - if (obj.hasOwnProperty('position')) { - let h = obj.position.z - obj.position.set(x, -1 * y, h) - obj.applyMatrix4(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.matrix) + if (obj.hasOwnProperty("position")) { + let h = obj.position.z; + obj.position.set(x, -1 * y, h); + obj.applyMatrix4(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.matrix); } }, /** * @api {方法} elementDestroy(type) 销毁地图标签 * @apiGroup 地图交互 * @apiDescription 销毁地图上的html标签 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {String} type docment元素自定义标识(默认 "shopInfo") * * @apiSampleRequest off @@ -2705,160 +3370,331 @@ MainMap_QM.prototype = { * Map_QM.elementDestroy(); * */ - elementDestroy: function (type = "shopInfo") { - if(!Map_QM.CSSObject){ - return; - } - for (let i = Map_QM.CSSObject.children.length - 1; i >= 0; i--) { - if(Map_QM.CSSObject.children[i].userData.type != "moveFloor"){ - if(type== "all"){ - Map_QM.CSSObject.children[i].element.style.visibility = "hidden"; - Map_QM.CSSObject.remove(Map_QM.CSSObject.children[i]); - }else{ - if (Map_QM.CSSObject.children[i].userData && Map_QM.CSSObject.children[i].userData.type == type) { - Map_QM.CSSObject.children[i].element.style.visibility = "hidden"; - Map_QM.CSSObject.remove(Map_QM.CSSObject.children[i]); - } - } - } - } - }, - + elementDestroy: function (type = "shopInfo", isRemove = false) { + if (!Map_QM.CSSObject) { + return; + } + for (let i = Map_QM.CSSObject.children.length - 1; i >= 0; i--) { + if (Map_QM.CSSObject.children[i].userData.type != "moveFloor") { + if (type == "all") { + Map_QM.CSSObject.children[i].element.style.visibility = "hidden"; + } else { + if ( + Map_QM.CSSObject.children[i].userData && + Map_QM.CSSObject.children[i].userData.type == type + ) { + let node = Map_QM.CSSObject.children[i]; + node.element.style.visibility = "hidden"; + if (isRemove && node.element.parentNode) { + node.element.parentNode.removeChild(node.element); + } + Map_QM.CSSObject.remove(node); + } + } + } + } + }, + /** + * @api {方法} addElementByNode() 显示地图活动标签 + * @apiGroup 地图交互 + * @apiDescription 地图显示活动标签,返回3d标签对象 + * @apiVersion 4.0.0 + * + * @apiParam {Element} divObj div对象 + * @apiParam {int} node 显示导航点位 + * @apiParam {String} type docment元素自定义标识(默认 "tip") + * @apiSampleRequest off + * + * @apiParamExample {String} 请求示例 + * Map_QM.addElementByNode(divObj,node,type); + */ + addElementByNode: function (divObj, node, type = "tip") { + let pathData = + Map_QM.util.allMap[Map_QM.util.selectBuild].buildArr[parseInt(Map_QM.util.selectFloor)].mapData.path; + if (!pathData || !divObj) { + return; + } + if (pathData.nodes.length > 0) { + pathData.nodes.sort(Map_QM.util.sortNode); + } else { + return; + } + divObj.style.visibility = "visible"; + divObj.style.opacity = "0"; + let shopInfo = new THREE.CSS2DObject(divObj); + shopInfo.position.set( + pathData.nodes[parseInt(node)].x, + -1 * pathData.nodes[parseInt(node)].y, + 60 + ); + shopInfo.applyMatrix4( + Map_QM.mapArr[Map_QM.util.selectBuild][parseInt(Map_QM.util.selectFloor)] + .allObj.matrix + ); + shopInfo.userData.type = type; + shopInfo.userData.isShow = false; + shopInfo.userData.floor = parseInt(Map_QM.util.selectFloor); + Map_QM.CSSObject.add(shopInfo); + TweenMax.to(divObj.style, 0.2, { opacity: 1, delay: 0.2 }); + return shopInfo; + }, + + /** + * @api {方法} changeShowShopName() 修改店铺显示名称 + * @apiGroup 地图显示 + * @apiDescription 通过店铺编号修改店铺显示名称 + * @apiVersion 4.0.0 + * @apiParam {Array} houseNumber 店铺编号 + * @apiParam {Array} nameStr 字符串 + * @apiSampleRequest off + * + * @apiParamExample {String} 请求示例 + * Map_QM.changeShowShopName(["L104"],['

肯德基

']) + */ + changeShowShopName: function (shopNums, elements) { + if (shopNums.length === elements.length) { + let labObj = Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj.children; + for (let i = 0; i < shopNums.length; i++) { + for (let j = 0; j < labObj.length; j++) { + if (labObj[j].name == shopNums[i]) { + labObj[j].element.innerHTML = elements[i]; + break; + } + } + } + } + }, + + /** + * @api {方法} showAreaAnimate() 区域定位 + * @apiGroup 地图显示 + * @apiDescription 通过区域名称凸显区域 + * @apiVersion 4.0.0 + * @apiParam {String} aName 区域名称,不传则复位 + * @apiSampleRequest off + * + * @apiParamExample {String} 请求示例 + * Map_QM.showAreaAnimate("A"); + */ + showAreaAnimate: function (aName = "") { + //在我的方向状态,恢复 + Map_QM.changeMapModel("3D"); + Map_QM.resetFloorState(); + Map_QM.controls.reset(); + Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle); + TweenMax.killAll(true); + if (!aName) { + isJUZ = false; + allJU = true; + return; + } + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.traverse((obj) => { + if (obj.userData && obj.userData.type == "build") { + if (obj.name == aName) { + Map_QM.onShowLocalSite({ x: obj.userData.xaxis, y: obj.userData.yaxis }, false); + } + } + }); + }, + + /** + * @api {方法} unionShop() 店铺合并 + * @apiGroup 地图显示 + * @apiDescription 通过店铺编号合并店铺 合铺 + * @apiVersion 4.0.0 + * @apiParam {Array} shops 店铺编号数组 + * @apiParam {Object} data 新的店铺数据(默认 空数据) + * @apiSampleRequest off + * + * @apiParamExample {String} 请求示例 + * Map_QM.unionShop(["L105","L106","L107","L108"],{name:"新店",houseNumber:"L104-L108",color:"#F4A460"}) + */ + unionShop: function ( + shops, + data = { name: "", houseNumber: "shop", color: "#F4A460" } + ) { + let shopObj = [], + xAll = 0, + yAll = 0; + if (Array.isArray(shops) && shops.length > 1) { + //删除店铺box + let shopArea = + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].shopObj + .children; + for (let i = 0; i < shops.length; i++) { + for (let k = 0; k < shopArea.length; k++) { + if (shopArea[k].name == shops[i]) { + xAll += shopArea[k].xaxis; + yAll += shopArea[k].yaxis; + shopObj.push(shopArea[k]); + Map_QM.mapArr[Map_QM.util.selectBuild][ + Map_QM.util.selectFloor + ].shopObj.remove(shopArea[k]); + break; + } + } + } + //删除文本标签 + let labObj = Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj.children; + for (let i = 0; i < shops.length; i++) { + for (let j = 0; j < labObj.length; j++) { + if (labObj[j].name == shops[i]) { + if (labObj[j].element && labObj[j].element.parentNode) { + labObj[j].element.parentNode.removeChild(labObj[j].element); + } + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj.remove(labObj[j]); + break; + } + } + } + let point = { + x: xAll / shopObj.length, + y: yAll / shopObj.length, + }; + let baseShop; + for (let l = 0; l < shopObj.length; l++) { + if (l == 0) { + baseShop = new ThreeBSP(shopObj[0]); + } else { + baseShop = baseShop.union(new ThreeBSP(shopObj[l])); + } + } + //ThreeBSP对象转化为网格模型对象 + let mesh = baseShop.toMesh(); + mesh.userData = data; + mesh.userData.shopData = { formatColor: data.color }; + mesh.userData.xaxis = point.x >> 0; + mesh.userData.yaxis = point.y >> 0; + mesh.userData.houseNumber = data.houseNumber; + mesh.userData.entColor = data.color; + mesh.userData.type = "shop"; + if (data.name) { + mesh.name = data.name; + let shopDiv = document.createElement("div"); + shopDiv.style.cssText = css_LR; + if (window.innerWidth > 2000) { + shopDiv.style.fontSize = "18px"; + } + shopDiv.innerHTML = data.name; + shopDiv.dataset.name = data.name; + shopDiv.dataset.nameEn = data.nameEn || data.name; + let shopLabel = new THREE.CSS2DObject(shopDiv); + shopLabel.position.set(point.x >> 0, (-1 * point.y) >> 0, 30); + shopLabel.name = data.houseNumber || ""; + shopLabel.userData.mapShow = true; //是否永久显示 + shopLabel.userData.isShow = true; + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj.add(shopLabel); + } + mesh.material = new THREE.MeshPhongMaterial({ + color: data.color || 0xf4a460, + transparent: true, + opacity: 0.9, + side: THREE.DoubleSide, + depthTest: true, + }); + Map_QM.mapArr[Map_QM.util.selectBuild][ + Map_QM.util.selectFloor + ].allObj.add(mesh); + } + renderCount = 0; + }, + + //////////////////////////////////////////////////////////////////////////////// /** * @param {Object} e * 地图BOX点击 */ onMouseClickBox: function (event) { - - let mouse = new THREE.Vector2() - mouse.x = (event.offsetX / Map_QM.w) * 2 - 1 - mouse.y = -(event.offsetY / Map_QM.h) * 2 + 1 - Map_QM.onCallTouchORMouse(mouse) - + startRotate = false; + let mouse = new THREE.Vector2(); + mouse.x = (event.offsetX / Map_QM.w) * 2 - 1; + mouse.y = -(event.offsetY / Map_QM.h) * 2 + 1; + Map_QM.onCallTouchORMouse(mouse); }, onCallTouchORMouse: function (mouse) { - if (!Map_QM.mapArr[Map_QM.util.selectBuild] && !Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) { - return - } - let raycaster = new THREE.Raycaster() - raycaster.setFromCamera(mouse, Map_QM.camera) - let intersects = raycaster.intersectObjects(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.children, true) - let clickShop = false - //图标点击 + if ((!Map_QM.mapArr[Map_QM.util.selectBuild] &&!Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) || !Map_QM.buildObj.visible) { + return; + } + let raycaster = new THREE.Raycaster(); + raycaster.setFromCamera(mouse, Map_QM.camera); + let intersects = raycaster.intersectObjects(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.children, true); + let clickShop = false, + clickOnly = false, + onlyData = null; for (let i = 0; i < intersects.length; i++) { - //图标点击 - if ( - intersects[i].object.userData && - (intersects[i].object.userData.type == 'icon' || - intersects[i].object.parent.userData.type == 'icon' || - intersects[i].object.parent.parent.userData.type == 'icon') - ) { - if (Map_QM.endModel && Map_QM.endModel.visible) { - Map_QM.endModel.visible = false + //店铺BOX点击 + if (intersects[i].object.userData && intersects[i].object.userData.type == "shop") { + if (intersects[i].object.name != "") { + if (Map_QM.endModel && Map_QM.endModel.visible) { + Map_QM.endModel.visible = false; + } + clickShop = true; + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].findPath.clearPath(); + Map_QM.setSelectShopMat(intersects[i].object); + break; + } else { + //空店铺有编号 + if (intersects[i].object.userData.houseNumber && intersects[i].object.userData.houseNumber != "shop") { + clickOnly = true; + onlyData = intersects[i].object.userData; + } } - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].findPath.clearPath() - let buildOrder = - intersects[i].object.userData.buildOrder || intersects[i].object.parent.userData.buildOrder || intersects[i].object.parent.parent.userData.buildOrder || 0 - let floorOrder = - intersects[i].object.userData.floorOrder || intersects[i].object.parent.userData.floorOrder || intersects[i].object.parent.parent.userData.floorOrder || 0 - let navCode = intersects[i].object.userData.navCode || intersects[i].object.parent.userData.navCode || intersects[i].object.parent.parent.userData.navCode - let src = intersects[i].object.userData.src || intersects[i].object.parent.userData.src || intersects[i].object.parent.parent.userData.src - let facCode = intersects[i].object.userData.facCode || intersects[i].object.parent.userData.facCode || intersects[i].object.parent.parent.userData.facCode - let title = intersects[i].object.userData.title || intersects[i].object.parent.userData.title || intersects[i].object.parent.parent.userData.title - /** - * @api {事件} icon 点击设施图标 - * @apiGroup 地图事件 - * @apiDescription 用户点击设施图标后触发自定义事件 - * @apiVersion 2.0.0 - * @apiSampleRequest off - * - * @apiParamExample 请求示例 - * Map_QM.addEventListener("icon",onClickIcon,false); - */ - Map_QM.dispatchEvent({ - type: 'icon', - data: { buildOrder: buildOrder, floorOrder: floorOrder, node: navCode, src: src, facCode: facCode, title: title } - }) - console.log('触发 icon 事件 ', { - type: 'icon', - data: { buildOrder: buildOrder, floorOrder: floorOrder, node: navCode, src: src, facCode: facCode, title: title } - }) - return } } - for (let i = 0; i < intersects.length; i++) { - //店铺BOX点击 - if (intersects[i].object.userData && intersects[i].object.userData.type == "shop") { - if(intersects[i].object.name != ""){ - if (Map_QM.endModel && Map_QM.endModel.visible) { - Map_QM.endModel.visible = false; - } - clickShop = true; - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].findPath.clearPath(); - Map_QM.setSelectShopMat(intersects[i].object); - break; - }else{ //空店铺有编号 - if(intersects[i].object.userData.houseNumber && intersects[i].object.userData.houseNumber != "shop"){ - clickOnly = true; - onlyData = intersects[i].object.userData; - } - } - } - } /** * @api {事件} shop 点击已绑定品牌的店铺 * @apiGroup 地图事件 * @apiDescription 用户点击店铺后触发自定义事件 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiSampleRequest off * * @apiParamExample 请求示例 * Map_QM.addEventListener("shop",onClickShop,false); */ if (clickShop && Map_QM.selectShop && Map_QM.selectShop.userData) { - if (Map_QM.selectShop.userData.shopData.hasOwnProperty('houseNumber')) { + if (Map_QM.selectShop.userData.shopData.hasOwnProperty("houseNumber")) { Map_QM.dispatchEvent({ - type: 'shop', - data: Map_QM.selectShop.userData - }) + type: "shop", + data: Map_QM.selectShop.userData, + }); } else { /** * @api {事件} onlyShop 点击未绑定品牌的店铺 * @apiGroup 地图事件 * @apiDescription 用户点击空店铺后触发自定义事件 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiSampleRequest off * * @apiParamExample 请求示例 * Map_QM.addEventListener("onlyShop",onClickShop,false); */ Map_QM.dispatchEvent({ - type: 'onlyShop', - data: Map_QM.selectShop.userData - }) + type: "onlyShop", + data: Map_QM.selectShop.userData, + }); } } else { - if(clickOnly){ - Map_QM.dispatchEvent({ - type: "onlyShop", - data: onlyData - }) - }else{ - Map_QM.dispatchEvent({ - type: "shop", - data: null - }) - } + if (clickOnly) { + Map_QM.dispatchEvent({ + type: "onlyShop", + data: onlyData, + }); + } else { + Map_QM.dispatchEvent({ + type: "shop", + data: null, + }); + } } }, /** - * @api {方法} setSelectShopMatByName(shopNum) 设置box 选中 + * @api {方法} setSelectShopMatByName(houseNumber) 设置box 选中 * @apiGroup 地图交互 * @apiDescription 地图box 选中 - * @apiVersion 2.0.0 - * @apiParam {String} shopNum POI编号 + * @apiVersion 4.0.0 + * @apiParam {String} houseNumber POI编号 * * @apiSampleRequest off * @@ -2869,211 +3705,689 @@ MainMap_QM.prototype = { */ setSelectShopMatByName: function (ipName) { for (let i = 0; i < Map_QM.mapArr[Map_QM.util.selectBuild].length; i++) { - let shopArr = Map_QM.mapArr[Map_QM.util.selectBuild][i].shopObj.children + let shopArr = Map_QM.mapArr[Map_QM.util.selectBuild][i].shopObj.children; for (let k = 0; k < shopArr.length; k++) { if (shopArr[k].name == ipName) { - Map_QM.setSelectShopMat(shopArr[k]) - break + Map_QM.setSelectShopMat(shopArr[k]); + break; } } } }, //改变选中店铺box setSelectShopMat: function (selObject) { - TweenMax.killAll(true) + TweenMax.killAll(true); if (Map_QM.selectShop) { - Map_QM.selectShop.scale.z = 1 - } - Map_QM.parseSelectShop(selObject) - }, - updateRender:function(){ - Map_QM.controls.update(); - Map_QM.renderer.render(Map_QM.scene, Map_QM.camera); - Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera); - - Map_QM.labelRenderer.renderObject( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].CSSObj, Map_QM.camera ); - Map_QM.labelRenderer.zOrder( Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj ); - }, + Map_QM.selectShop.scale.z = 1; + } + Map_QM.parseSelectShop(selObject); + }, + updateRender: function () { + Map_QM.controls.update(); + Map_QM.renderer.render(Map_QM.scene, Map_QM.camera); + Map_QM.labelRenderer.render(Map_QM.scene, Map_QM.camera); + + Map_QM.labelRenderer.renderObject(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].CSSObj, Map_QM.scene, Map_QM.camera); + Map_QM.labelRenderer.zOrder(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj); + }, /** * 初始化后调用 */ timeOutInit: function () { Map_QM.updateRender(); - Map_QM.collLabel(); - renderCount=0 + Map_QM.collLabel(); + renderCount = 0; if (Map_QM.callBackLoadOver) { - let floorData = [] + let floorData = []; for (let i = 0; i < Map_QM.util.allMap.length; i++) { - let build = [] + let build = []; for (let j = 0; j < Map_QM.util.allMap[i].buildArr.length; j++) { if (Map_QM.util.allMap[i].buildArr[j]) { - build.push({ order: Map_QM.util.allMap[i].buildArr[j].order, name: Map_QM.util.allMap[i].buildArr[j].name }) + build.push({ + order: Map_QM.util.allMap[i].buildArr[j].order, + name: Map_QM.util.allMap[i].buildArr[j].name, + }); } } - floorData.push(build) + floorData.push(build); } if (Map_QM.backObj) { - Map_QM.controls.enabled = true - Map_QM.backObj.data = floorData + Map_QM.controls.enabled = true; + Map_QM.backObj.data = floorData; } - Map_QM.callBackLoadOver(Map_QM.backObj) //初始化完成后回调 - Map_QM.callBackLoadOver = null - Map_QM.backObj = null + Map_QM.callBackLoadOver(Map_QM.backObj); //初始化完成后回调 + Map_QM.callBackLoadOver = null; + Map_QM.backObj = null; } Map_QM.dispatchEvent({ - type: 'changeFloorOver', - data: Map_QM.selectFloor - }) + type: "changeFloorOver", + data: Map_QM.selectFloor, + }); }, autoChangeEleAngle: function () { if (Map_QM.mapArr[Map_QM.util.selectBuild]) { - 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) { - let svgChilds = Map_QM.mapArr[Map_QM.util.selectBuild][m].svgObj.children; - let rat = Map_QM.controls.getRotateHorizontal(); - svgChilds.forEach((item) => { - if (Math.abs(item.rotation.x) < 0.5) { - if ((rat - item.userData.rot) > 1.7 || (rat - item.userData.rot) < -1.7) { - item.rotation.z = item.userData.rot < 0 ? item.userData.rot + 3.1415926 : item.userData.rot - 3.1415926; - } else { - item.rotation.z = item.userData.rot; - } - } - }); - let logoChilds = Map_QM.mapArr[Map_QM.util.selectBuild][m].shopObj.children; - logoChilds.forEach((item) => { - if (item.children.length>0) { - item.children.forEach((obj) => { - if (obj.userData.type == "logo") { - if ((rat - obj.userData.rot) > 1.7 || (rat - obj.userData.rot) < -1.7) { - obj.rotation.z = obj.userData.rot < 0 ? obj.userData.rot + 3.1415926 : obj.userData.rot - 3.1415926; - } else { - obj.rotation.z = obj.userData.rot; - } - } - }) - } - }); - } - } - } + 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) { + let svgChilds = Map_QM.mapArr[Map_QM.util.selectBuild][m].svgObj.children; + let rat = Map_QM.controls.getRotateHorizontal(); + svgChilds.forEach((item) => { + if (Math.abs(item.rotation.x) < 0.5) { + if ( + rat - item.userData.rot > 1.7 || + rat - item.userData.rot < -1.7 + ) { + item.rotation.z = + item.userData.rot < 0 + ? item.userData.rot + 3.1415926 + : item.userData.rot - 3.1415926; + } else { + item.rotation.z = item.userData.rot; + } + } + }); + let logoChilds = Map_QM.mapArr[Map_QM.util.selectBuild][m].shopObj.children; + logoChilds.forEach((item) => { + if (item.children.length > 0) { + item.children.forEach((obj) => { + if (obj.userData.type == "logo") { + if ( + rat - obj.userData.rot > 1.7 || + rat - obj.userData.rot < -1.7 + ) { + obj.rotation.z = + obj.userData.rot < 0 + ? obj.userData.rot + 3.1415926 + : obj.userData.rot - 3.1415926; + } else { + obj.rotation.z = obj.userData.rot; + } + } + }); + } + }); + } + } + } + }, + disPlayEvent: function () { + renderCount = 0; + let distance = Map_QM.controls.getDistance(); + if (distance > Map_QM.util.changeDist.outner + 20 && mapState != "periphery") { + Map_QM.toPeripheryInner(); + } else if (distance > Map_QM.util.changeDist.inner + 20 && distance < Map_QM.util.changeDist.outner - 20 && mapState != "out") { + Map_QM.toOutModelInner(); + } else if (distance < Map_QM.util.changeDist.inner - 20 && mapState != "mall") { + Map_QM.toMallInner(); + } }, - disPlayEvent: function (e) { - renderCount=0; - Map_QM.collLabel(); - }, /** * 碰撞检测 * @param {Object} 传入检测楼层下标 */ controlsChock: function () { - Map_QM.autoChangeEleAngle() - renderCount=0; + Map_QM.autoChangeEleAngle(); + renderCount = 0; /** * @api {事件} MapAngleChange 地图的方向改变 * @apiGroup 地图事件 * @apiDescription 用户操作地图时触发 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiSampleRequest off * * @apiParamExample 请求示例 * Map_QM.addEventListener("MapAngleChange",onMapAngleChange,false); */ Map_QM.dispatchEvent({ - type: 'MapAngleChange', - data: { hAngle: Map_QM.controls.getRotateHorizontal(), vAngle: Map_QM.controls.getRotate() } - }) - - if (Map_QM.util.options.inArea && isJUZ) { - clearTimeout(shopTime); - shopTime = setTimeout(() => { - clearTimeout(shopTime); - isJUZ = false; - Map_QM.controls.setZoom(1) - Map_QM.controls.reset() - Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle) - }, 6000); - } + type: "MapAngleChange", + data: { + hAngle: Map_QM.controls.getRotateHorizontal(), + vAngle: Map_QM.controls.getRotate(), + }, + }); + + if (Map_QM.util.options.inArea && isJUZ && allJU) { + clearTimeout(shopTime); + shopTime = setTimeout(() => { + clearTimeout(shopTime); + isJUZ = false; + Map_QM.controls.reset(); + Map_QM.util.options.deviceAng && Map_QM.rotationAngle(Map_QM.util.deviceObj.angle); + }, 10000); + } }, //内部碰撞检测 collLabel: function () { - if (!Map_QM) { - return; - } - if (Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.buildObj.visible && Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) { - if (Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.visible && (!Map_QM.buildObj.userData.hasOwnProperty("visible") || Map_QM.buildObj.userData.visible)) { - let childs = Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj.children; - let len = childs.length - for (let i = 0; i < len; i++) { - if(!childs[i].userData.isShow){ //是否可见 - continue; - } - let obj = childs[i].element; - if(Map_QM.util.options.collision){ - if (obj.style.transform) { - obj.style.display = "" - let labP = obj.getBoundingClientRect() - for (let j = 0; j < i; j++) { - if (childs[j].element.style.display == "") { - let pb = childs[j].element.getBoundingClientRect() - let isCol = Map_QM.util.isCollision(labP, pb) - if (isCol) { - if (!childs[i].userData.mapShow) { - obj.style.display = "none" - break; - } else if (!childs[j].userData.mapShow) { - childs[j].element.style.display = "none" - } - } - } - } - } - }else{ - obj.style.display = "" - } - } - } - } - - }, + if (!Map_QM || !isShowElement) { + return; + } + if(window.requestIdleCallback){ + requestIdleCallback(Map_QM.runTaskQueue, { timeout: 300 }); + }else{ + clearTimeout(allTime); + allTime = setTimeout(() => { + clearTimeout(allTime); + Map_QM.runTaskQueue(); + }, 300); + } + }, + runTaskQueue: function (){ + if (Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.buildObj.visible && Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) { + if (Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.visible && (!Map_QM.buildObj.userData.hasOwnProperty("visible") || Map_QM.buildObj.userData.visible)) { + let childs = Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].labelObj.children; + let len = childs.length; + for (let i = 0; i < len; i++) { + if (!childs[i].userData.isShow) { + //是否可见 + continue; + } + if (!Map_QM.util.options.collision) { + childs[i].element.style.display = ""; + continue; + } + let obj = childs[i].element; + obj.style.display = ""; + let labP = obj.getBoundingClientRect(); + for (let j = 0; j < i; j++) { + if (childs[j].element.style.display == "") { + let pb = childs[j].element.getBoundingClientRect(); + let isCol = Map_QM.util.isCollision(labP, pb); + if (isCol) { + if (!childs[i].userData.mapShow) { + childs[i].element.style.display = "none"; + break; + } else if (!childs[j].userData.mapShow) { + childs[j].element.style.display = "none"; + } + } + } + } + } + } + } + }, /** * 寻路---------------------------------------------------------------------------------------------------------------------------------------- */ /** - * @api {方法} bounceIcon({type:"xsj"}) 图标弹跳 + * @api {方法} bounceIcon("xsj") 图标弹跳 * @apiGroup 地图导航 * @apiDescription 地图图标弹跳效果 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {String} iconType 设施缩写 * * @apiSampleRequest off * * @apiParamExample {String} 请求示例 * - * Map_QM.bounceIcon({type:"xsj"}); + * Map_QM.bounceIcon("xsj"); * */ bounceIcon: function (iconType) { - let toFloor = parseInt(Map_QM.util.selectFloor) - let facs = Map_QM.mapArr[Map_QM.util.selectBuild][toFloor].serObj.children //交通图标 + TweenMax.killAll(true); + let facs = + Map_QM.mapArr[Map_QM.util.selectBuild][parseInt(Map_QM.util.selectFloor)] + .serObj.children; //交通图标 for (let i = 0; i < facs.length; i++) { - if (facs[i].type == 'Object3D') { - facs[i].reSetSite() - if (facs[i].facCode == iconType) { - facs[i].jumpIcon() + if (facs[i].type == "Object3D") { + if (facs[i].userData.facCode == iconType) { + facs[i].element.style.zIndex = 200; + let oldZ = facs[i].userData.site + 5; + TweenMax.fromTo( + facs[i].position, + 0.5, + { z: oldZ }, + { + z: oldZ + 80, + repeat: 1, + onUpdate: function () { + Map_QM.labelRenderer.renderObject( + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].CSSObj, Map_QM.scene, Map_QM.camera); + }, + onComplete: function () { + TweenMax.to(facs[i].position, 0.2, { + z: oldZ, + onUpdate: function () { + Map_QM.labelRenderer.renderObject(Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].CSSObj, Map_QM.scene, Map_QM.camera); + }, + }); + }, + } + ); + } else { + facs[i].element.style.zIndex = 100; + } + } + } + }, + /** + * @api {方法} countPath() 方向算法 + * @apiGroup 地图导航 + * @apiDescription 计算设施、店铺的导航方向, toObj,pathType 不能同时为空 + * @apiVersion 4.0.0 + * @apiParam {Object} toObj {build,floor,node} //终点 设施寻路可以为空 + * @apiParam {String} pathType 公共设施名称或编号(点位寻路此参数为空字符串) + * @apiParam {String} countType 8--八方向(默认) 12--十二方向 + * + * @apiSampleRequest off + * + * @apiParamExample {String} 请求示例 + * + * Map_QM.countPath({build:0,floor:0,node:0},"xsj","8"); + * + */ + countPath: function (toObj, pathType = "", _countType = "8") { + direction = { code: 500, dir: "", cost: 0, gap: 0 }; + countType = _countType; + Map_QM.util.overObj = null; + if (pathType == "") { + //传入终点导航点 + Map_QM.util.overObj = toObj; + if ( + Map_QM.util.startObj.node != "" && + Map_QM.util.startObj.node != "-1" && + Map_QM.util.overObj.node != "" + ) { + this.forShopArr.length = 0; + return this.forDirPath(); + } else { + direction.code = "404"; + return direction; + } + } else { + // + let iconPath = this.pathIcon({ type: pathType }); + Map_QM.util.overObj = iconPath; + if ( + Map_QM.util.startObj.node != "" && + Map_QM.util.startObj.node != "-1" && + Map_QM.util.overObj.node != "" + ) { + this.forShopArr.length = 0; + return this.forDirPath(); + } + } + return (direction = { code: 404, dir: "", cost: 0, gap: 0 }); + }, + forDirPath: function () { + let startNade = Map_QM.util.startObj.build +"_" +Map_QM.util.startObj.floor +"_" +Map_QM.util.startObj.node; + let toNade = Map_QM.util.overObj.build +"_" +Map_QM.util.overObj.floor +"_" +Map_QM.util.overObj.node; + let PathPoint; + direction = { code: 500, dir: "", cost: 0, gap: 0 }; + try { + let obj = dijkstra.find_path(Map_QM.util.pathStateObj.graphPath,startNade,toNade); + PathPoint = obj.nodes; + direction.cost = Math.floor((obj.cost / Map_QM.util.options.mapScale) * 0.9); + direction.gap = parseInt(obj.cost / Map_QM.util.options.mapScale); + } catch (e) { + window.captureException && window.captureException(e); + console.log(e); + direction.code = 404; + return direction; + } + let index = 0; + this.forShopArr = []; + if (PathPoint.length > 1) { + this.forShopArr.push({build: Map_QM.util.startObj.build,floor: Map_QM.util.startObj.floor,PathPoint: [],}); + let pathData; + for (let j = 0; j < PathPoint.length; j++) { + let array = PathPoint[j].split("_"); + pathData = Map_QM.util.allMap[parseInt(array[0])].buildArr[parseInt(array[1])].mapData.path; + pathData.nodes.sort(Map_QM.util.sortNumber); + if (parseInt(array[1]) == this.forShopArr[index].floor) { + //同层 + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); + } else { + this.forShopArr.push({ + build: parseInt(array[0]), + floor: parseInt(array[1]), + PathPoint: [], + }); + index++; + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); + } + } + } else { + this.forShopArr.length = 0; + } + if (this.forShopArr.length > 0) { + //--------------------------计算方向 + direction.code = 200; + if (countType == "12") { + //16方向 + Map_QM.countSixteenArrow(); + } else { + Map_QM.countStartAndEndDire(); + } + } + console.log(this.forShopArr); + if (this.forShopArr.length > 1) { + let facType; + if (this.forShopArr[0].floor > this.forShopArr[1].floor) { + //下 + if ( + Math.abs( + parseInt(this.forShopArr[0].floor) - + parseInt(this.forShopArr[1].floor) + ) < 3 + ) { + //扶梯 + facType = Map_QM.util.getFacType("downft"); + } else { + facType = Map_QM.util.getFacType("dt"); + } + } else { + if ( + Math.abs( + parseInt(this.forShopArr[0].floor) - + parseInt(this.forShopArr[1].floor) + ) < 3 + ) { + //扶梯 + facType = Map_QM.util.getFacType("upft"); + } else { + facType = Map_QM.util.getFacType("dt"); + } + } + facType = facType + ""; + if (facType.length === 1) { + direction.dir = "600" + facType; + } else if (facType.length === 2) { + direction.dir = "60" + facType; + } else if (facType.length === 3) { + direction.dir = "6" + facType; + } + } + return direction; + }, + /** + * 计算十六方向箭头 + */ + countSixteenArrow: function () { + if (this.forShopArr[0].PathPoint.length > 1) { + let keyPoints = [], + ishas = false, + allCount = 0; + for (let i = 1; i < this.forShopArr[0].PathPoint.length; i++) { + let s = Math.sqrt(Math.pow(this.forShopArr[0].PathPoint[i].x - this.forShopArr[0].PathPoint[i - 1].x,2) + + Math.pow(this.forShopArr[0].PathPoint[i].y -this.forShopArr[0].PathPoint[i - 1].y,2)); + if (s < 20) { + continue; + } + ishas = false; + let dirObj = { + angleName: Map_QM.getPathAngle(this.forShopArr[0].PathPoint[i - 1],this.forShopArr[0].PathPoint[i]), + count: s, + }; + allCount += s; + if (keyPoints.length > 0 &&keyPoints[keyPoints.length - 1].angleName == dirObj.angleName) { + keyPoints[keyPoints.length - 1].count += s; + ishas = true; + } + if (!ishas) { + keyPoints.push(dirObj); + } + } + if (allCount < 150) { + //总长度< 150 按8方向 + Map_QM.countStartAndEndDire(); + return; + } + if (keyPoints.length == 1) { + direction.dir = Map_QM.getDirByName(keyPoints[0].angleName); + return; + } + if (keyPoints.length == 0) { + //没有路径,按方向计算 + direction.code = 404; + return; + } + let upCount = 0, + rightFrontCount = 0, + rightCount = 0, + leftFrontCount = 0; + for (let item of keyPoints) { + if (item.angleName == "up") { + upCount += item.count; + } else if (item.angleName == "down") { + upCount -= item.count; + } else if (item.angleName == "right") { + rightCount += item.count; + } else if (item.angleName == "left") { + rightCount -= item.count; + } else if (item.angleName == "rightFront") { + rightFrontCount += item.count; + } else if (item.angleName == "rightRear") { + leftFrontCount -= item.count; + } else if (item.angleName == "leftFront") { + leftFrontCount += item.count; + } else if (item.angleName == "leftRear") { + rightFrontCount -= item.count; + } + } + console.log(keyPoints); + //斜方向忽略 + let dir1 = ""; + let bjCount = Math.max(150, allCount / 10); + let onlyDir = ""; + for (let item of keyPoints) { + if ( + item.angleName != "rightFront" && + item.angleName != "leftFront" && + item.angleName != "rightRear" && + item.angleName != "leftRear" + ) { + onlyDir = + dir1.length > 0 + ? dir1.substring(dir1.length - 1, dir1.length) + : dir1; + if ( + item.angleName == "down" && + (item.count > bjCount || upCount < -1 * bjCount) + ) { + if (onlyDir != "D") { + dir1 += "D"; + } + } else if ( + item.angleName == "up" && + (item.count > bjCount || upCount > bjCount) + ) { + if (onlyDir != "T") { + dir1 += "T"; + } + } else if ( + item.angleName == "right" && + (item.count > bjCount || rightCount > bjCount) + ) { + if (onlyDir != "R") { + dir1 += "R"; + } + } else if ( + item.angleName == "left" && + (item.count > bjCount || rightCount < -1 * bjCount) + ) { + if (onlyDir != "L") { + dir1 += "L"; + } + } } } + //console.log(dir1) + if (dir1.length > 2) dir1 = dir1.substring(0, 2); //两个以上方向 + direction.dir = Map_QM.getDirByName(dir1); + if (!direction.dir) Map_QM.countStartAndEndDire(); + } else { + //没有路径,按方向计算 + direction.code = 404; + } + }, + + getDirByName: function (dir) { + switch (dir) { + default: + return ""; + case "T": + return "1201"; + case "R": + return "1202"; + case "D": + return "1203"; + case "L": + return "1204"; + case "TL": + return "1205"; + case "TR": + return "1206"; + case "RT": + return "1207"; + case "RD": + return "1208"; + case "DL": + return "1209"; + case "DR": + return "1210"; + case "LT": + return "1211"; + case "LD": + return "1212"; + case "up": + return "1201"; + case "rightFront": + return "8002"; + case "right": + return "1202"; + case "rightRear": + return "8004"; + case "down": + return "1203"; + case "leftRear": + return "8006"; + case "left": + return "1204"; + case "leftFront": + return "8008"; + } + }, + + /** + * 计算八方向坐标 + */ + countStartAndEndDire: function () { + let sPoint = new Map_QM.util.Point( + this.forShopArr[0].PathPoint[0].x, + this.forShopArr[0].PathPoint[0].y + ); //本层起始点坐标 + let ePoint = new Map_QM.util.Point( + this.forShopArr[0].PathPoint[this.forShopArr[0].PathPoint.length - 1].x, + this.forShopArr[0].PathPoint[this.forShopArr[0].PathPoint.length - 1].y + ); //本层结束点坐标 + switch (Map_QM.getPathAngle(sPoint, ePoint)) { + default: + direction.dir = "8001"; + case "up": + direction.dir = "8001"; + break; + case "rightFront": + direction.dir = "8002"; + break; + case "right": + direction.dir = "8003"; + break; + case "rightRear": + direction.dir = "8004"; + break; + case "down": + direction.dir = "8005"; + break; + case "leftRear": + direction.dir = "8006"; + break; + case "left": + direction.dir = "8007"; + break; + case "leftFront": + direction.dir = "8008"; + break; + } + }, + + getPathAngle: function (sPoint, ePoint) { + let x = Math.abs(sPoint.x - ePoint.x); + let y = Math.abs(sPoint.y - ePoint.y); + let tan = x / y; + let radina = Math.atan(tan); //用反三角函数求弧度 + let angle = Math.floor(180 / (Math.PI / radina)) || 0; //将弧度转换成角度 + + if (ePoint.x > sPoint.x && ePoint.y > sPoint.y) { + // 右下方 + angle = 180 - angle; + } + if (ePoint.x == sPoint.x && ePoint.y > sPoint.y) { + // 正下方 + angle = 180; + } + if (ePoint.x < sPoint.x && ePoint.y > sPoint.y) { + //左下方 + angle = angle - 180; + } + if (ePoint.x < sPoint.x && ePoint.y == sPoint.y) { + //左方 + angle = -90; + } + if (ePoint.x < sPoint.x && ePoint.y < sPoint.y) { + // 左上方 + angle = -1 * angle; + } + if (ePoint.x == sPoint.x && ePoint.y < sPoint.y) { + //上方 + angle = 0; + } + if (ePoint.x > sPoint.x && ePoint.y < sPoint.y) { + //右上方 + angle = angle; + } + if (ePoint.x > sPoint.x && ePoint.y == sPoint.y) { + //point在x轴正方向上 + angle = 90; + } + angle -= Map_QM.util.deviceObj.angle; + angle = angle > 180 ? angle - 360 : angle; + angle = angle < -180 ? angle + 360 : angle; + + if (angle > -22 && angle <= 22) { + //前 + return "up"; + } else if (angle > 22 && angle <= 67) { + //右前 + return "rightFront"; + } else if (angle > 67 && angle <= 112) { + //右 + return "right"; + } else if (angle > 112 && angle <= 158) { + //右后 + return "rightRear"; + } else if (angle > 158 || angle <= -158) { + //后 + return "down"; + } else if (angle > -158 && angle <= -112) { + //左后 + return "leftRear"; + } else if (angle > -112 && angle <= -67) { + //左 + return "left"; + } else { + //左前 + return "leftFront"; } }, /** * @api {方法} pathIcon({type:"xsj"}) 获取最近设施 * @apiGroup 地图导航 * @apiDescription 获取离当前楼层最近的设施 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {JSON} type 设施缩写 * * @apiSampleRequest off @@ -3088,84 +4402,103 @@ MainMap_QM.prototype = { * } * */ - pathIcon: function (iconType) { - let selIcon; // - let minS = -1; - if (!Map_QM.util.startObj.build && parseInt(Map_QM.util.startObj.build) != 0) { - Map_QM.util.startObj.build = parseInt(Map_QM.util.deviceObj.build); - } - try{ - let startNade = Map_QM.util.startObj.build + "_" + Map_QM.util.startObj.floor + "_" + Map_QM.util.startObj.node; - const costAll = dijkstra.single_source_shortest_paths(Map_QM.util.pathStateObj.graphPath, startNade, startNade).costs; - if (costAll) { - for (let i = 0; i < Map_QM.mapArr[parseInt(Map_QM.util.deviceObj.build)].length; i++) { - let sers = Map_QM.mapArr[parseInt(Map_QM.util.deviceObj.build)][i].serObj.children; //服务图标 - for (let n = 0; n < sers.length; n++) { - if (sers[n].userData.facCode == iconType.type || ((iconType.type=="xsjn" || iconType.type=="xsjv") && sers[n].userData.facCode=="xsj")) { - let toNade = sers[n].userData.buildOrder+ "_" + sers[n].userData.floorOrder + "_" + sers[n].userData.navCode; - if (!selIcon) { - minS = costAll[toNade]; - if (minS) { - selIcon = sers[n]; - } - } else { - let s1 = costAll[toNade]; - if (s1 && s1 < minS) { - minS = s1; - selIcon = sers[n]; - } - } - } - } - } - - if (selIcon) { - return { "build": parseInt(Map_QM.util.deviceObj.build), "floor": selIcon.userData.floorOrder, "site": { x: selIcon.position.x, y: selIcon.position.y }, "node": selIcon.userData.navCode, "no": selIcon.userData.no, "typeCode": Map_QM.util.getFacType(iconType.type) }; - } else { // 当前楼栋没有 - for (let b = 0; b < Map_QM.mapArr.length; b++) { - if (b != parseInt(Map_QM.util.deviceObj.build)) { - for (let i = 0; i < Map_QM.mapArr[b].length; i++) { - let sers = Map_QM.mapArr[b][i].serObj.children; //服务图标 - for (let n = 0; n < sers.length; n++) { - if (sers[n].userData.facCode == iconType.type) { - let toNade = b + "_" + sers[n].userData.floorOrder + "_" + sers[n].userData.navCode; - if (!selIcon) { - minS = costAll[toNade]; - if (minS) { - selIcon = sers[n]; - selIcon.build = b; - } - } else { - let s1 = costAll[toNade]; - if (s1 && s1 < minS) { - minS = s1; - selIcon = sers[n]; - selIcon.build = b; - } - } - } - } - } - } - } - if (selIcon) { - return { "build": selIcon.userData.buildOrder, "floor": selIcon.userData.floorOrder, "node": selIcon.userData.navCode, "site": { x: selIcon.position.x, y: selIcon.position.y }, "no": selIcon.userData.no, "typeCode": Map_QM.util.getFacType(iconType.type) }; - } - } - } - }catch(e){ - console.log(e) - } - }, + pathIcon: function (iconType) { + let selIcon; // + let minS = -1; + if ( + !Map_QM.util.startObj.build && + parseInt(Map_QM.util.startObj.build) != 0 + ) { + Map_QM.util.startObj.build = parseInt(Map_QM.util.deviceObj.build); + } + try { + let startNade = Map_QM.util.startObj.build +"_" +Map_QM.util.startObj.floor +"_" +Map_QM.util.startObj.node; + const costAll = dijkstra.single_source_shortest_paths( Map_QM.util.pathStateObj.basePath,startNade,startNade).costs; + if (costAll) { + for (let i = 0;i < Map_QM.mapArr[parseInt(Map_QM.util.deviceObj.build)].length;i++) { + let sers =Map_QM.mapArr[parseInt(Map_QM.util.deviceObj.build)][i].serObj.children; //服务图标 + for (let n = 0; n < sers.length; n++) { + if (sers[n].userData.facCode == iconType.type ||((iconType.type == "xsjn" || iconType.type == "xsjv") && sers[n].userData.facCode == "xsj")) { + let toNade =sers[n].userData.buildOrder +"_" +sers[n].userData.floorOrder +"_" +sers[n].userData.navCode; + if (!selIcon) { + minS = costAll[toNade]; + if (minS) { + selIcon = sers[n]; + } + } else { + let s1 = costAll[toNade]; + if (s1 && s1 < minS) { + minS = s1; + selIcon = sers[n]; + } + } + } + } + } + + if (selIcon) { + return { + build: parseInt(Map_QM.util.deviceObj.build), + floor: selIcon.userData.floorOrder, + site: { x: selIcon.position.x, y: selIcon.position.y }, + node: selIcon.userData.navCode, + no: selIcon.userData.no, + typeCode: Map_QM.util.getFacType(iconType.type), + }; + } else { + // 当前楼栋没有 + for (let b = 0; b < Map_QM.mapArr.length; b++) { + if (b != parseInt(Map_QM.util.deviceObj.build)) { + for (let i = 0; i < Map_QM.mapArr[b].length; i++) { + let sers = Map_QM.mapArr[b][i].serObj.children; //服务图标 + for (let n = 0; n < sers.length; n++) { + if (sers[n].userData.facCode == iconType.type) { + let toNade =b +"_" +sers[n].userData.floorOrder +"_" +sers[n].userData.navCode; + if (!selIcon) { + minS = costAll[toNade]; + if (minS) { + selIcon = sers[n]; + selIcon.build = b; + } + } else { + let s1 = costAll[toNade]; + if (s1 && s1 < minS) { + minS = s1; + selIcon = sers[n]; + selIcon.build = b; + } + } + } + } + } + } + } + if (selIcon) { + return { + build: selIcon.userData.buildOrder, + floor: selIcon.userData.floorOrder, + node: selIcon.userData.navCode, + site: { x: selIcon.position.x, y: selIcon.position.y }, + no: selIcon.userData.no, + typeCode: Map_QM.util.getFacType(iconType.type), + }; + } + } + } + } catch (e) { + window.captureException && window.captureException(e); + console.log(e); + } + }, /** * @api {方法} pathByStartAndOver(startObj,toObj,callBackFun) 地图路径规划 * @apiGroup 地图导航 * @apiDescription 根据传入的起、终点;直接导航 - * @apiVersion 2.0.0 - * @apiParam {String} startObj.shopNum 店铺编号/车位编号 + * @apiVersion 4.0.0 + * @apiParam {String} startObj.houseNumber 店铺编号/车位编号 * @apiParam {String} startObj.type "shop"/"park" * - * @apiParam {String} toObj.shopNum 店铺编号/车位编号 + * @apiParam {String} toObj.houseNumber 店铺编号/车位编号 * @apiParam {String} toObj.type "shop"/"park" * * @apiParam {Function} callBackFun 回调函数 @@ -3174,16 +4507,17 @@ MainMap_QM.prototype = { * * @apiParamExample {String} 请求示例 * - * Map_QM.pathByStartAndOver({"shopNum":"L102","type":"shop"},{"shopNum":"L204","type":"shop"}); + * Map_QM.pathByStartAndOver({"houseNumber":"L102","type":"shop"},{"houseNumber":"L204","type":"shop"}); * */ pathByStartAndOver: function (startObj, toObj, callBackFun) { try { - Map_QM.util.startObj = this.shopNumToNavPoint(startObj, startObj.type) - let overObj = this.shopNumToNavPoint(toObj, toObj.type) - this.pathNode(overObj, callBackFun) + Map_QM.util.startObj = this.shopNumToNavPoint(startObj, startObj.type); + let overObj = this.shopNumToNavPoint(toObj, toObj.type); + this.pathNode(overObj, callBackFun); } catch (e) { - return '传入点位无法导航' + window.captureException && window.captureException(e); + return "传入点位无法导航"; } }, @@ -3191,7 +4525,7 @@ MainMap_QM.prototype = { * @api {方法} changeStartPoint() 设置起始点位 * @apiGroup 地图导航 * @apiDescription 设置起始点位 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {int} build 起点楼栋编号 * @apiParam {int} floor 起点楼层编号 * @apiParam {String} node 起点编号 @@ -3205,42 +4539,48 @@ MainMap_QM.prototype = { * */ changeStartPoint: function (toObj) { - this.clearFloor() - for (let i = 0; i < this.mapArr[parseInt(this.util.startObj.build)].length; i++) { - for (let len = this.mapArr[parseInt(this.util.startObj.build)][i].allObj.children.length - 1; len >= 0; len--) { - let obj = this.mapArr[parseInt(this.util.startObj.build)][i].allObj.children[len] - if (obj.userData.type == 'start') { - this.mapArr[parseInt(this.util.startObj.build)][i].allObj.remove(obj) + this.clearFloor(); + if (this.mapArr) { + for (let i = 0;i < this.mapArr[parseInt(this.util.startObj.build)].length;i++) { + for (let len =this.mapArr[parseInt(this.util.startObj.build)][i].allObj.children.length - 1;len >= 0;len--) { + let obj =this.mapArr[parseInt(this.util.startObj.build)][i].allObj.children[len]; + if (obj.userData.type == "start") { + this.mapArr[parseInt(this.util.startObj.build)][i].allObj.remove(obj); + } } } } + this.util.startObj = {}; if (toObj && toObj.node) { - let pathData = this.util.allMap[parseInt(toObj.build)].buildArr[parseInt(toObj.floor)].mapData.path - this.util.startObj.xaxis = pathData.nodes[parseInt(toObj.node)].x - this.util.startObj.yaxis = pathData.nodes[parseInt(toObj.node)].y - this.util.startObj.build = parseInt(toObj.build); - this.util.startObj.floor = parseInt(toObj.floor); - this.util.startObj.node = toObj.node; - this.util.startObj.angle = toObj.angle || 0; + let pathData =this.util.allMap[parseInt(toObj.build)].buildArr[parseInt(toObj.floor)].mapData.path; + this.util.startObj.xaxis = pathData.nodes[parseInt(toObj.node)].x; + this.util.startObj.yaxis = pathData.nodes[parseInt(toObj.node)].y; + this.util.startObj.build = parseInt(toObj.build); + this.util.startObj.floor = parseInt(toObj.floor); + this.util.startObj.node = toObj.node; + this.util.startObj.angle = toObj.angle || 0; } else { - let pathData = this.util.allMap[parseInt(this.util.deviceObj.build)].buildArr[parseInt(this.util.deviceObj.floor)].mapData.path - pathData.nodes.sort(this.util.sortNode) - this.util.deviceObj.xaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].x - this.util.deviceObj.yaxis = pathData.nodes[parseInt(this.util.deviceObj.node)].y - this.util.startObj = this.util.deviceObj + this.util.startObj.xaxis = this.util.deviceObj.xaxis; + this.util.startObj.yaxis = this.util.deviceObj.yaxis; + this.util.startObj.build = parseInt(this.util.deviceObj.build); + this.util.startObj.floor = parseInt(this.util.deviceObj.floor); + this.util.startObj.node = this.util.deviceObj.node; + this.util.startObj.angle = this.util.deviceObj.angle; + this.util.startObj.xaxis = this.util.deviceObj.xaxis; + this.util.startObj.yaxis = this.util.deviceObj.yaxis; } this.mapArr[parseInt(this.util.startObj.build)][parseInt(this.util.startObj.floor)].setStartSite( this.util.startObj.xaxis, this.util.startObj.yaxis, - parseInt(this.util.shopHeight)+20 - ) + parseInt(this.util.shopHeight) + 20 + ); }, /** * @api {方法} changeMapIPState(ipName,color) 改变POI颜色 * @apiGroup 地图交互 * @apiDescription 改变POI 颜色 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {string} ipName POI名称 * @apiParam {string} color 颜色字符串 * @@ -3251,48 +4591,50 @@ MainMap_QM.prototype = { * Map_QM.changeMapIPState("L1001","#ffff00"); * */ - changeMapIPState: function (ipName, color) { // #775544 #AD8164 - for (let i = 0; i < this.mapArr[this.util.selectBuild].length; i++) { - let shopArr = this.mapArr[this.util.selectBuild][i].shopObj.children - for (let k = 0; k < shopArr.length; k++) { - if (shopArr[k].name == ipName || (shopArr[k].userData && shopArr[k].userData.houseNumber == ipName)) { - shopArr[k].userData.initMaterial = shopArr[k].material - shopArr[k].material = this.util.getMeshMaterial(color || 0xeab16e) - break - } - } - } - }, - /** - * @api {方法} resetMapIPState(ipName) 恢复POI颜色 - * @apiGroup 地图交互 - * @apiDescription 恢复POI初始颜色 - * @apiVersion 4.0.0 - * @apiParam {string} ipName POI名称 - * - * @apiSampleRequest off - * - * @apiParamExample 请求示例 - * - * Map_QM.resetMapIPState("L101"); - * - */ - resetMapIPState: function (ipName) { - for (let i = 0; i < this.mapArr[this.util.selectBuild].length; i++) { - let shopArr = this.mapArr[this.util.selectBuild][i].shopObj.children - for (let k = 0; k < shopArr.length; k++) { - if (shopArr[k].name == ipName) { - shopArr[k].material = shopArr[k].userData.initMaterial - break - } - } - } - }, + changeMapIPState: function (ipName, color) { + // #775544 #AD8164 + for (let i = 0; i < this.mapArr[this.util.selectBuild].length; i++) { + let shopArr = this.mapArr[this.util.selectBuild][i].shopObj.children; + for (let k = 0; k < shopArr.length; k++) { + if (shopArr[k].name == ipName ||(shopArr[k].userData && shopArr[k].userData.houseNumber == ipName)) { + shopArr[k].userData.initMaterial = shopArr[k].material; + shopArr[k].material = this.util.getMeshMaterial(color || 0xeab16e); + break; + } + } + } + }, + /** + * @api {方法} resetMapIPState(ipName) 恢复POI颜色 + * @apiGroup 地图交互 + * @apiDescription 恢复POI初始颜色 + * @apiVersion 4.0.0 + * @apiParam {string} ipName POI名称 + * + * @apiSampleRequest off + * + * @apiParamExample 请求示例 + * + * Map_QM.resetMapIPState("L101"); + * + */ + resetMapIPState: function (ipName) { + for (let i = 0; i < this.mapArr[this.util.selectBuild].length; i++) { + let shopArr = this.mapArr[this.util.selectBuild][i].shopObj.children; + for (let k = 0; k < shopArr.length; k++) { + if (shopArr[k].name == ipName) { + shopArr[k].material = shopArr[k].userData.initMaterial; + break; + } + } + } + }, + /** * @api {方法} getMapIPData(ipName) 获取POI 基础数据 * @apiGroup 地图交互 * @apiDescription 获取POI 基础数据 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {string} ipName POI名称 * * @apiSampleRequest off @@ -3303,15 +4645,15 @@ MainMap_QM.prototype = { * * @apiSuccessExample 返回示例 * { - * shopNum:店铺编号, shopName:店铺名 node:导航点, floor:楼层编号, xaxis:中心点X坐标, yaxis:中心点Y坐标, borderColor:边框色, entColor:填充色 + * houseNumber:店铺编号, shopName:店铺名 node:导航点, floor:楼层编号, xaxis:中心点X坐标, yaxis:中心点Y坐标, borderColor:边框色, entColor:填充色 * } */ getMapIPData: function (ipName) { for (let i = 0; i < Map_QM.mapArr[Map_QM.util.selectBuild].length; i++) { - let shopArr = Map_QM.mapArr[Map_QM.util.selectBuild][i].shopObj.children + let shopArr = Map_QM.mapArr[Map_QM.util.selectBuild][i].shopObj.children; for (let k = 0; k < shopArr.length; k++) { - if (shopArr[k].name == ipName || (shopArr[k].userData && shopArr[k].userData.houseNumber == ipName)) { - return shopArr[k].userData + if (shopArr[k].name == ipName ||(shopArr[k].userData && shopArr[k].userData.houseNumber == ipName)) { + return shopArr[k].userData; } } } @@ -3321,7 +4663,7 @@ MainMap_QM.prototype = { * @api {方法} pathNode() 地图模拟导航 * @apiGroup 地图导航 * @apiDescription 地图路径模拟导航 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {int} floor 楼层编号 * @apiParam {string} node 路径点位编号 * @apiParam {function} callBackFun 回调方法 @@ -3334,69 +4676,360 @@ MainMap_QM.prototype = { * */ pathNode: function (toObj, callBackFun) { + Map_QM.util.isMorePath = false; if (!toObj) { - return { direction: '', wayList: [] } + return { direction: "", wayList: [] }; } - pathCameraState = Map_QM.util.options.pathStyle + pathCameraState = Map_QM.util.options.pathStyle; Map_QM.reSetGuide(); - Map_QM.onShowDeviceSite() - Map_QM.selectShop = null - Map_QM.util.pathStateObj.isPathState = true + Map_QM.onShowDeviceSite(); + Map_QM.selectShop = null; + Map_QM.util.pathStateObj.isPathState = true; Map_QM.elementDestroy("all"); + if ( + Map_QM.util.initModelArr && + Map_QM.util.initModelArr.length > 0 && + Map_QM.util.changeDist.inner > Map_QM.util.options.minDis + ) { + Map_QM.controls.maxDistance = Map_QM.util.changeDist.inner; + } if (!Map_QM.util.startObj.xaxis && !Map_QM.util.startObj.yaxis) { - Map_QM.changeStartPoint(null) + Map_QM.changeStartPoint(null); } - Map_QM.util.overObj = null - Map_QM.util.overObj = { build: toObj.build || 0, floor: toObj.floor, node: toObj.node, shopNum: toObj.shopNum } - if (Map_QM.util.overObj.node != '') { - Map_QM.cancelRender() - this.onFindPathModel() + Map_QM.util.overObj = null; + Map_QM.util.overObj = { + build: toObj.build || 0, + floor: toObj.floor, + node: toObj.node, + houseNumber: toObj.houseNumber, + comeIn: toObj.comeIn || "", + }; + if (Map_QM.util.overObj.node != "") { + Map_QM.cancelRender(); + this.onFindPathModel(); if (callBackFun) { - Map_QM.parseForShopArr() - const data = JSON.parse(JSON.stringify(Map_QM.util.pathStateObj.forShopArr)) - callBackFun(data) + Map_QM.parseForShopArr(); + const data = JSON.parse( + JSON.stringify(Map_QM.util.pathStateObj.forShopArr) + ); + callBackFun(data); + } + Map_QM.startRender(); + } + }, + + /** + * @api {方法} pathShopList() 指定路径导航 + * @apiGroup 地图导航 + * @apiDescription 根据传入的店铺编号列表绘制导航路径 + * @apiVersion 4.0.0 + * @apiParam {Array} shopList 路径的店铺编号数组 + * @apiParam {Function} callBackFun 回调函数 + * + * @apiSampleRequest off + * + * @apiParamExample 请求示例 + * + * Map_QM.pathShopList(["L1-1","L1-5","L1-8","L1-10","LA-13"],()=>{}); + * + */ + pathShopList: function (shopList, callBackFun) { + if (!shopList || shopList.length < 2) { + return { direction: "", wayList: [] }; + } + let pathList = shopList.map(Map_QM.getPathNodeByHousenumber); + Map_QM.pathList(pathList, callBackFun); + }, + /** + * 获取导航点 + */ + getPathNodeByHousenumber: function (houseNumber) { + for (let h = 0; h < Map_QM.mapArr.length; h++) { + for (let i = 0; i < Map_QM.mapArr[h].length; i++) { + let shopArr = Map_QM.mapArr[h][i].shopObj.children; + for (let k = 0; k < shopArr.length; k++) { + if ( + shopArr[k].name == houseNumber && + parseInt(shopArr[k].node) >= 0 + ) { + return { + build: h, + floor: i, + path: h + "_" + i + "_" + shopArr[k].node, + node: shopArr[k].node, + }; + } + } + } + } + }, + getPathNodeByNode: function (nodeObj) { + let build = nodeObj.buildOrder || 0; + let floor = nodeObj.floorOrder || 0; + let node = parseInt(nodeObj.node); + if (isNaN(node)) { + return null; + } else { + return { + build: build, + floor: floor, + path: build + "_" + floor + "_" + node, + node: node, + }; + } + }, + /** + * @api {方法} pathShopList() 指定路径导航 + * @apiGroup 地图导航 + * @apiDescription 根据传入的店铺编号列表绘制导航路径 + * @apiVersion 4.0.0 + * @apiParam {Array} shopList 路径的店铺编号数组 + * @apiParam {Function} callBackFun 回调函数 + * + * @apiSampleRequest off + * + * @apiParamExample 请求示例 + * [{buildOrder:0,floorOrder:0,node:8},{buildOrder:0,floorOrder:0,node:13},{buildOrder:0,floorOrder:0,node:16},{buildOrder:0,floorOrder:0,node:20}],()=>{} + */ + pathNodeList: function (nodeList, callBackFun, isShowNo = true) { + Map_QM.elementDestroy("map_no", true); + if (!nodeList || nodeList.length < 2) { + return { direction: "", wayList: [] }; + } + Map_QM.selectShop = null; + Map_QM.util.pathStateObj.isPathState = true; + let pathList = nodeList.map(Map_QM.getPathNodeByNode); + Map_QM.pathList(pathList, callBackFun, isShowNo); + }, + pathList: function (pathList, callBackFun, isShowNo = false) { + Map_QM.util.isMorePath = true; + Map_QM.clearFloor(Map_QM.util.selectFloor || -1); + pathCameraState = Map_QM.util.options.pathStyle; + Map_QM.selectShop = null; + Map_QM.util.pathStateObj.isPathState = true; + Map_QM.cancelRender(); + let startNode, + endNode, + isFrist = true, + PathPoint = []; + try { + let index = 0, + findIndex = 0, + pathNodes = []; + pathList.forEach((item, inx) => { + if (isShowNo) { + //显示序号 + let pathN =Map_QM.util.allMap[parseInt(item.build)].buildArr[parseInt(item.floor)].mapData.path.nodes; + pathN.sort(Map_QM.util.sortNode); + let labelDiv = document.createElement("div"); + labelDiv.className = "map_no"; + labelDiv.innerText = inx + 1; + let img = document.createElement("img"); + img.src = "../static/img/arrowBlack.svg"; + labelDiv.appendChild(img); + let shopLabel = new THREE.CSS2DObject(labelDiv); + shopLabel.position.set(pathN[parseInt(item.node)].x,-1 * pathN[parseInt(item.node)].y,30); + shopLabel.applyMatrix4(Map_QM.mapArr[parseInt(item.build)][parseInt(item.floor)].allObj.matrix); + shopLabel.userData.type = "map_no"; + shopLabel.userData.index = inx; + shopLabel.userData.mapShow = true; + shopLabel.userData.isShow = false; //切换楼层默认不显示,且不参与碰撞检测 + Map_QM.CSSObject.add(shopLabel); + } + + if (startNode && startNode.path) { + endNode = item; + if (endNode && endNode.path) { + let iNodes = + Map_QM.util.allMap[parseInt(endNode.build)].buildArr[parseInt(endNode.floor)].mapData.path.nodes; + iNodes.sort(Map_QM.util.sortNode); + Map_QM.util.overObj.build = endNode.build; + Map_QM.util.overObj.floor = endNode.floor; + Map_QM.util.overObj.node = endNode.node; + Map_QM.util.overObj.xaxis = iNodes[parseInt(endNode.node)].x; + Map_QM.util.overObj.yaxis = iNodes[parseInt(endNode.node)].y; + Map_QM.util.overObj.angle = 0; + let pathNode = dijkstra.find_path(Map_QM.util.pathStateObj.graphPath,startNode.path,endNode.path).nodes; + if (pathNode.length > 1) { + let pathData; + for (let j = 0; j < pathNode.length; j++) { + let array = pathNode[j].split("_"); + if (j == 0 && isFrist) { + pathNodes.push({build: parseInt(array[0]),floor: parseInt(array[1]),pathNode: []}); + } + pathData = Map_QM.util.allMap[parseInt(array[0])].buildArr[parseInt(array[1])].mapData.path; + pathData.nodes.sort(Map_QM.util.sortNode); + if (array[0] == pathNodes[index].build) { + if (array[1] == pathNodes[index].floor) { + if (!pathNodes[index].pathNode[findIndex]) { + pathNodes[index].pathNode[findIndex] = []; + } + pathNodes[index].pathNode[findIndex].push(pathData.nodes[parseInt(array[2])]); + } else { + if (j > 0) { + pathNodes[index].Facilities = this.getFacilIcon(pathNode[j - 1].split("_"),parseInt(array[0])); + } else { + pathNodes[index].Facilities = null; + } + pathNodes.push({build: parseInt(array[0]),floor: parseInt(array[1]),pathNode: [],}); + index++; + findIndex = 0; + if (!pathNodes[index].pathNode[findIndex]) { + pathNodes[index].pathNode[findIndex] = []; + } + pathNodes[index].pathNode[findIndex].push(pathData.nodes[parseInt(array[2])]); + } + } else { + pathNodes.push({ build: parseInt(array[0]),floor: parseInt(array[1]),pathNode: []}); + index++; + findIndex = 0; + if (!pathNodes[index].pathNode[findIndex]) { + pathNodes[index].pathNode[findIndex] = []; + } + pathNodes[index].pathNode[findIndex].push( + pathData.nodes[parseInt(array[2])] + ); + } + } + } + if (isFrist) { + isFrist = false; + } else { + pathNode.shift(); + } + PathPoint.push(...pathNode); + startNode = endNode; + findIndex++; + } + } else { + startNode = item; + Map_QM.changeStartPoint({ + build: startNode.build, + floor: startNode.floor, + node: startNode.node, + angle: 0, + }); + } + }); + } catch (e) { + window.captureException && window.captureException(e); + console.log(e); + return; + } + Map_QM.forShopArr.length = 0; + Map_QM.util._indexPathFloor = 0; + Map_QM.util.pathStateObj.isPathPlay = true; + Map_QM.forShopListPath(PathPoint); //传入所有导航点 + if (callBackFun) { + Map_QM.parseForShopArr(); + const data = JSON.parse( + JSON.stringify(Map_QM.util.pathStateObj.forShopArr) + ); + callBackFun(data); + } + Map_QM.startRender(); + pathNodeList = null; + }, + + forShopListPath: function (PathPoint) { + let index = 0; + this.forShopArr = []; + if (PathPoint.length > 1) { + let pathData; + for (let j = 0; j < PathPoint.length; j++) { + let array = PathPoint[j].split("_"); + if (j == 0) { + this.forShopArr.push({ + build: parseInt(array[0]), + floor: parseInt(array[1]), + PathPoint: [], + }); + } + pathData = Map_QM.util.allMap[parseInt(array[0])].buildArr[parseInt(array[1])].mapData.path; + pathData.nodes.sort(Map_QM.util.sortNode); + if (array[0] == this.forShopArr[index].build) { + if (array[1] == this.forShopArr[index].floor) { + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); + } else { + if (j > 0) { + this.forShopArr[index].Facilities = this.getFacilIcon(PathPoint[j - 1].split("_"),parseInt(array[0])); + } else { + this.forShopArr[index].Facilities = null; + } + this.forShopArr.push({build: parseInt(array[0]),floor: parseInt(array[1]),PathPoint: []}); + index++; + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); + } + } else { + this.forShopArr.push({ build: parseInt(array[0]), floor: parseInt(array[1]), PathPoint: []}); + index++; + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); + } + } + if (Map_QM.forShopArr.length > 0) { + // "floor" PathPoint Direction (Facilities) + for (let m = 0; m < Map_QM.forShopArr.length; m++) { + //查找经过店铺 + Map_QM.forShopArr[m].wayShop = Map_QM.foreignShop( + Map_QM.forShopArr[m].PathPoint, + Map_QM.forShopArr[m].build, + Map_QM.forShopArr[m].floor, + m + ); + if (Map_QM.util.overObj.build == Map_QM.forShopArr[m].build &&Map_QM.util.overObj.floor == Map_QM.forShopArr[m].floor) { + let len = Map_QM.forShopArr[m].wayShop.length; + if (Map_QM.forShopArr[m].wayShop[len - 1] && Map_QM.forShopArr[m].wayShop[len - 1].shop.yaxis == Map_QM.util.overObj.node) { + Map_QM.forShopArr[m].wayShop.pop(); + } + } + } + } else { + console.error("无可行路径"); + return; } - Map_QM.startRender() + this.onFindPathToObj(); } + pathNodeList = null; }, + parseForShopArr: function () { - Map_QM.util.pathStateObj.forShopArr = { direction: '', wayList: [] } + Map_QM.util.pathStateObj.forShopArr = { direction: "", wayList: [] }; Map_QM.forShopArr.forEach((item, index) => { - if (item.hasOwnProperty('Direction')) { - Map_QM.util.pathStateObj.forShopArr.direction = item.Direction - Map_QM.util.pathStateObj.forShopArr.directionEn = item.DirectionEn + if (item.hasOwnProperty("Direction")) { + Map_QM.util.pathStateObj.forShopArr.direction = item.Direction; + Map_QM.util.pathStateObj.forShopArr.directionEn = item.DirectionEn; } - if (item.hasOwnProperty('wayShop') && item.wayShop) { + if (item.hasOwnProperty("wayShop") && item.wayShop) { for (let i = 0; i < item.wayShop.length; i++) { - let enTlite = item.wayShop[i].shop.nameEn == '' ? item.wayShop[i].shop.name : item.wayShop[i].shop.nameEn + let enTlite = item.wayShop[i].shop.shopNameEn == "" ? item.wayShop[i].shop.shopName : item.wayShop[i].shop.shopNameEn; Map_QM.util.pathStateObj.forShopArr.wayList.push({ isAddPrefix: false, - name: '经过 ' + item.wayShop[i].shop.name, - nameEn: 'PASS ' + enTlite, - logoPath: item.wayShop[i].shop.logoPath, - code: item.wayShop[i].shop.code, - shopNum: item.wayShop[i].shop.houseNumber - }) + shopName: "经过 " + item.wayShop[i].shop.shopName || item.wayShop[i].shop.name, + shopNameEn: "PASS " + enTlite, + logoPath: item.wayShop[i].shop.logoPath || item.wayShop[i].shop.logoUrl, + shopCode: item.wayShop[i].shop.shopCode, + houseNumber: item.wayShop[i].shop.houseNumber, + }); } } - if (item.hasOwnProperty('Facilities') && item.Facilities) { + if (item.hasOwnProperty("Facilities") && item.Facilities) { //设施 Map_QM.util.pathStateObj.forShopArr.wayList.push({ isAddPrefix: true, - name: '乘坐 ' + item.Facilities.userData.title + '到 ' + Map_QM.mapArr[Map_QM.util.selectBuild][parseInt(Map_QM.forShopArr[index + 1].floor)].floorName, - nameEn: 'BY ' + item.Facilities.userData.title + 'TO ' + Map_QM.mapArr[Map_QM.util.selectBuild][parseInt(Map_QM.forShopArr[index + 1].floor)].floorName, + shopName: "乘坐 " + item.Facilities.userData.title +"到 " + Map_QM.mapArr[parseInt(Map_QM.forShopArr[index + 1].build)][parseInt(Map_QM.forShopArr[index + 1].floor)].floorName, + shopNameEn:"BY " +item.Facilities.userData.title +"TO " + Map_QM.mapArr[parseInt(Map_QM.forShopArr[index + 1].build)][parseInt(Map_QM.forShopArr[index + 1].floor)].floorName, logoPath: item.Facilities.imgUrl, - code: ((Math.random() * 0x1234567) | 0).toString(16).substring(0), - shopNum: item.Facilities.userData.facCode + item.Facilities.userData.no - }) + shopCode: ((Math.random() * 0x1234567) | 0).toString(16).substring(0), + houseNumber:item.Facilities.userData.facCode + item.Facilities.userData.no, + }); } - }) + }); }, /** * @api {方法} getGapByPathNode() 获取实际距离 * @apiGroup 地图导航 * @apiDescription 通过点位获取距离 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {int} floor 楼层编号 * @apiParam {string} node 路径点位编号 * @@ -3412,109 +5045,50 @@ MainMap_QM.prototype = { * } */ getGapByPathNode: function (toObj) { - let startNade = Map_QM.util.deviceObj.build + '_' + Map_QM.util.deviceObj.floor + '_' + Map_QM.util.deviceObj.node - let toNade = toObj.build + '_' + toObj.floor + '_' + toObj.node + let startNade = Map_QM.util.deviceObj.build +"_" + Map_QM.util.deviceObj.floor + "_" + Map_QM.util.deviceObj.node; + let toNade = toObj.build + "_" + toObj.floor + "_" + toObj.node; let path = { cost: -1 }, - minTime = 1 + minTime = 1; try { - path = dijkstra.find_path(Map_QM.util.pathStateObj.graphPath, startNade, toNade) - minTime = parseInt(path.cost / Map_QM.util.options.mapScale / 50) < 0.5 ? 0.5 : parseInt(path.cost / Map_QM.util.options.mapScale / 50) - console.log(`距离目的地 ${parseInt(path.cost / Map_QM.util.options.mapScale)} 米,预计${mint} 分钟`) // 21 是比例尺 + path = dijkstra.find_path( Map_QM.util.pathStateObj.basePath,startNade,toNade); + minTime = parseInt(path.cost / Map_QM.util.options.mapScale / 50) < 0.5? 0.5 : parseInt(path.cost / Map_QM.util.options.mapScale / 50); + console.log(`距离目的地 ${parseInt(path.cost / Map_QM.util.options.mapScale)} 米,预计${minTime} 分钟`); // 21 是比例尺 } catch (e) { - console.log(e) - } - return { dis: parseInt(path.cost / Map_QM.util.options.mapScale), time: minTime } - }, - /** - * @api {方法} getAllIcon() 获取所有Icon - * @apiGroup 地图数据 - * @apiDescription 获取所有Icon - * @apiVersion 2.0.0 - * @apiParam {int} floorOrder 楼层编号(默认 所有) - * - * @apiSampleRequest off - * - */ - getAllIcon: function (floorOrder = -1, buildOrder = -1) { - let icons = [] - if (floorOrder != -1) { - let bd = buildOrder == -1 ? Map_QM.util.selectBuild : buildOrder - let sers = Map_QM.mapArr[bd][floorOrder].serObj.children //服务图标 - for (let n = 0; n < sers.length; n++) { - if (sers[n].type == 'Object3D'&& sers[n].userData.type == "icon") { - let title = sers[n].userData.title || Map_QM.util.getFacName(sers[n].userData.facCode) - let titleEn = Map_QM.util.iconEn[title] - let type = sers[n].userData.facCode - let imgUrl = sers[n].userData.src - if (sers[n].userData.facCode == 'upft' || sers[n].userData.facCode == 'downft' || sers[n].userData.facCode == 'ft') { - if (title == '上扶梯' || title == '下扶梯') { - title = '扶梯' - } - titleEn = Map_QM.util.iconEn[title] - type = 'ft' - } - let icon = { type: type, floor: floorOrder, imgUrl: imgUrl, poid: sers[n].userData.poid, title: title, titleEn: titleEn } - icons.push(icon) - } - } - return icons - } - - for (let j = 0; j < Map_QM.mapArr.length; j++) { - let iconBuild = [] - for (let i = 0; i < Map_QM.mapArr[j].length; i++) { - let iconArr = [] - if (Map_QM.mapArr[j][i].serObj) { - let sers = Map_QM.mapArr[j][i].serObj.children //服务图标 - for (let n = 0; n < sers.length; n++) { - if (sers[n].type == 'Object3D' && sers[n].userData.type == "icon") { - let title = sers[n].userData.title || Map_QM.util.getFacName(sers[n].userData.facCode) - let titleEn = Map_QM.util.iconEn[title] - let type = sers[n].userData.facCode - let imgUrl = sers[n].userData.src - if (sers[n].userData.facCode == 'upft' || sers[n].userData.facCode == 'downft' || sers[n].userData.facCode == 'ft') { - title = '扶梯' - titleEn = Map_QM.util.iconEn[title] - type = 'ft' - } - let icon = { type: type, floor: i, imgUrl: imgUrl, poid: sers[n].userData.poid, title: title, titleEn: titleEn } - iconArr.push(icon) - } - } - } - iconBuild.push(iconArr) - } - icons.push(iconBuild) + window.captureException && window.captureException(e); + console.log(e); } - return icons + return { + dis: parseInt(path.cost / Map_QM.util.options.mapScale), + time: minTime, + }; }, /** * @api {方法} pathPark() 获取车位点位 * @apiGroup 地图数据 * @apiDescription 获取车位导航点 - * @apiVersion 2.0.0 - * @apiParam {String} shopNum 车位编号 + * @apiVersion 4.0.0 + * @apiParam {String} houseNumber 车位编号 * * @apiSampleRequest off * * @apiParamExample 请求示例 * - * Map_QM.pathPark({shopNum:"B1002"}); + * Map_QM.pathPark({houseNumber:"B1002"}); * * @apiSuccessExample 返回示例 * { - * shopNum: 车位编号, node: 导航点, floor: 楼层编号, xaxis: 中心点X坐标, yaxis: 中心点Y坐标 + * houseNumber: 车位编号, node: 导航点, floor: 楼层编号, xaxis: 中心点X坐标, yaxis: 中心点Y坐标 * } */ pathPark: function (toObj) { - return this.shopNumToNavPoint(toObj, 'park') + return this.shopNumToNavPoint(toObj, "park"); }, /** * @api {方法} pathShopByName() 获取店铺点位 * @apiGroup 地图数据 * @apiDescription 通过店铺名称获取点位 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiParam {String} shopName 店铺名称 * * @apiSampleRequest off @@ -3525,74 +5099,154 @@ MainMap_QM.prototype = { * * @apiSuccessExample 返回示例 * { - * shopNum: 店铺编号, node: 导航点, floor: 楼层编号, xaxis: 中心点X坐标, yaxis: 中心点Y坐标, comeIn:店铺多门点 + * houseNumber: 店铺编号, node: 导航点, floor: 楼层编号, xaxis: 中心点X坐标, yaxis: 中心点Y坐标, comeIn:店铺多门点 * } */ pathShopByName: function (shopName) { for (let item of Map_QM.util.shopData) { if (item.name === shopName) { - let toObj = { shopNum: item.houseNumber, node: item.yaxis } + let toObj = { houseNumber: item.houseNumber, node: item.yaxis }; for (let h = 0; h < Map_QM.util.allMap.length; h++) { - let sArr = Map_QM.util.allMap[h].buildArr + let sArr = Map_QM.util.allMap[h].buildArr; for (let i = 0; i < sArr.length; i++) { - let shops = Map_QM.util.allMap[h].buildArr[i].mapData.shopArea + let shops = Map_QM.util.allMap[h].buildArr[i].mapData.shopArea; for (let k = 0; k < shops.length; k++) { - if (shops[k].name == toObj.shopNum) { - toObj.floor = i - toObj.build = h - toObj.node = shops[k].shopNav - toObj.xaxis = shops[k].xaxis - toObj.yaxis = shops[k].yaxis + if (shops[k].name == toObj.houseNumber) { + toObj.floor = i; + toObj.build = h; + toObj.node = shops[k].shopNav; + toObj.xaxis = shops[k].xaxis; + toObj.yaxis = shops[k].yaxis; if (shops[k].comeIn) { - toObj.comeIn = shops[k].comeIn + toObj.comeIn = shops[k].comeIn; } - return toObj + return toObj; } } } } - return toObj + return toObj; + } + } + }, + /** + * @api {方法} changeBoxStateByFormat() 切换box显示状态 + * @apiGroup 地图交互 + * @apiDescription 根据业态切换box显示状态 + * @apiVersion 4.0.0 + * @apiParam {String} formatCode 业态Id + * @apiParam {Boolean} isShow 是否显示 + * + * @apiSampleRequest off + * + * @apiParamExample {Object} 请求示例 + * + * Map_QM.changeBoxStateByFormat("X8f1sfGl0gfa_QwVcMy86",false); + * + */ + changeBoxStateByFormat: function (formatCode, isShow) { + for (let h = 0; h < Map_QM.mapArr.length; h++) { + for (let i = 0; i < Map_QM.mapArr[h].length; i++) { + let shopArr = Map_QM.mapArr[h][i].shopObj.children; + for (let k = 0; k < shopArr.length; k++) { + if ( + shopArr[k].userData && + shopArr[k].userData.formatCode == formatCode + ) { + shopArr[k].visible = isShow; + } + } + Map_QM.mapArr[h][i].labelObj.traverse((obj) => { + if (obj.element && obj.userData.formatCode == formatCode) { + obj.element.style.display = isShow ? "" : "none"; + obj.userData.isShow = isShow; + } + }); + } + } + Map_QM.updateRender(); + Map_QM.collLabel(); + }, + /** + * @api {方法} changeBoxStateByName() 切换box显示状态 + * @apiGroup 地图交互 + * @apiDescription 根据名称切换box显示状态 + * @apiVersion 4.0.0 + * @apiParam {String} houseNumber box名称 + * @apiParam {Boolean} isShow 是否显示 + * + * @apiSampleRequest off + * + * @apiParamExample {Object} 请求示例 + * + * Map_QM.changeBoxStateByName("L101", true); + * + */ + changeBoxStateByName: function (houseNumber, isShow) { + for (let h = 0; h < Map_QM.mapArr.length; h++) { + for (let i = 0; i < Map_QM.mapArr[h].length; i++) { + let shopArr = Map_QM.mapArr[h][i].shopObj.children; + for (let k = 0; k < shopArr.length; k++) { + if (shopArr[k].name == houseNumber) { + shopArr[k].visible = isShow; + } + } + Map_QM.mapArr[h][i].labelObj.traverse((obj) => { + if (obj.name == houseNumber) { + obj.element.style.display = isShow ? "" : "none"; + obj.userData.isShow = isShow; + } + }); } } + Map_QM.updateRender(); + Map_QM.collLabel(); }, /** * @api {方法} shopNumToNavPoint() 获取导航点位 * @apiGroup 地图导航 * @apiDescription 通过店铺编号或车位获取导航点位 - * @apiVersion 2.0.0 - * @apiParam {Object} object build,floor,shopNum 楼栋编号,楼层编号,店铺或车位编号 + * @apiVersion 4.0.0 + * @apiParam {Object} object build,floor,houseNumber 楼栋编号,楼层编号,店铺或车位编号 * @apiParam {String} type 店铺或车位标识 "shop" "park" * * @apiSampleRequest off * * @apiSuccessExample 返回示例 * { - * shopNum: 店铺编号, node: 导航点, floor: 楼层编号, xaxis: 中心点X坐标, yaxis: 中心点Y坐标, comeIn:店铺多门点 + * houseNumber: 店铺编号, node: 导航点, floor: 楼层编号, xaxis: 中心点X坐标, yaxis: 中心点Y坐标, comeIn:店铺多门点 * } */ shopNumToNavPoint: function (obj, type) { - let shopArr - let reObj = { build: Map_QM.util.selectBuild, node: '', xaxis: '', yaxis: '', floor: '', comeIn: '' } + let shopArr; + let reObj = { + build: Map_QM.util.selectBuild, + node: "", + xaxis: "", + yaxis: "", + floor: "", + comeIn: "", + }; for (let h = 0; h < Map_QM.util.allMap.length; h++) { - let sArr = Map_QM.util.allMap[h].buildArr + let sArr = Map_QM.util.allMap[h].buildArr; for (let i = 0; i < sArr.length; i++) { - if (type == 'shop') { - shopArr = sArr[i].mapData.shopArea - } else if (type == 'park') { - shopArr = sArr[i].mapData.parkArea + if (type == "shop") { + shopArr = sArr[i].mapData.shopArea; + } else if (type == "park") { + shopArr = sArr[i].mapData.parkArea; } for (let k = 0; k < shopArr.length; k++) { - if (shopArr[k].name == obj.shopNum) { - reObj.floor = i - reObj.build = h - reObj.xaxis = shopArr[k].xaxis - reObj.yaxis = shopArr[k].yaxis - reObj.node = shopArr[k].shopNav - reObj.shopNum = obj.shopNum + if (shopArr[k].name == obj.houseNumber) { + reObj.floor = i; + reObj.build = h; + reObj.xaxis = shopArr[k].xaxis; + reObj.yaxis = shopArr[k].yaxis; + reObj.node = shopArr[k].shopNav; + reObj.houseNumber = obj.houseNumber; if (shopArr[k].comeIn) { - reObj.comeIn = shopArr[k].comeIn + reObj.comeIn = shopArr[k].comeIn; } - return reObj + return reObj; } } } @@ -3602,108 +5256,131 @@ MainMap_QM.prototype = { * 模拟导航获取路线 */ onFindPathModel: function (usePath = null) { - Map_QM.forShopArr.length = 0 - Map_QM.util._indexPathFloor = 0 - Map_QM.util.pathStateObj.isPathPlay = true - if (isNaN(parseInt(Map_QM.util.startObj.node)) || parseInt(Map_QM.util.startObj.node) == -1) { - return + Map_QM.forShopArr.length = 0; + Map_QM.util._indexPathFloor = 0; + Map_QM.util.pathStateObj.isPathPlay = true; + if (isNaN(parseInt(Map_QM.util.startObj.node)) ||parseInt(Map_QM.util.startObj.node) == -1) { + return; } - if (!Map_QM.util.startObj.xaxis) { - let pathData = Map_QM.util.allMap[parseInt(Map_QM.util.startObj.build)].buildArr[parseInt(Map_QM.util.startObj.floor)].mapData.path - Map_QM.util.startObj.xaxis = pathData.nodes[parseInt(Map_QM.util.startObj.node)].x - Map_QM.util.startObj.yaxis = pathData.nodes[parseInt(Map_QM.util.startObj.node)].y - } - 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) + try { + if (!Map_QM.util.startObj.xaxis) { + let pathData = Map_QM.util.allMap[parseInt(Map_QM.util.startObj.build)].buildArr[parseInt(Map_QM.util.startObj.floor)].mapData.path; + Map_QM.util.startObj.xaxis = pathData.nodes[parseInt(Map_QM.util.startObj.node)].x; + Map_QM.util.startObj.yaxis = pathData.nodes[parseInt(Map_QM.util.startObj.node)].y; + } + 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); + } + } + let startNade = + Map_QM.util.startObj.build + "_" + Map_QM.util.startObj.floor + "_" + Map_QM.util.startObj.node; + let toNade = Map_QM.util.overObj.build + "_" + Map_QM.util.overObj.floor + "_" + Map_QM.util.overObj.node; + let path = dijkstra.find_path(usePath, startNade, toNade); + Map_QM.forShopPath(path.nodes); + } catch (e) { + window.captureException && window.captureException(e); + console.log(e); + return; } - let startNade = Map_QM.util.startObj.build + "_" + Map_QM.util.startObj.floor + "_" + Map_QM.util.startObj.node; - let toNade = Map_QM.util.overObj.build + "_" + Map_QM.util.overObj.floor + "_" + Map_QM.util.overObj.node; - let path = dijkstra.find_path(usePath, startNade, toNade); - Map_QM.forShopPath(path.nodes); }, forShopPath: function (PathPoint) { - let Dir = '向前出发', - index = 0 - let DirEn = 'to forward' - this.forShopArr = [] + let Dir = "向前出发", + index = 0; + let DirEn = "to forward"; + this.forShopArr = []; if (PathPoint.length > 1) { - this.forShopArr.push({ build: Map_QM.util.startObj.build, floor: Map_QM.util.startObj.floor, PathPoint: [] }) - let pathData + this.forShopArr.push({ + build: Map_QM.util.startObj.build, + floor: Map_QM.util.startObj.floor, + PathPoint: [], + }); + let pathData; for (let j = 0; j < PathPoint.length; j++) { - let array = PathPoint[j].split('_') - pathData = Map_QM.util.allMap[parseInt(array[0])].buildArr[parseInt(array[1])].mapData.path + let array = PathPoint[j].split("_"); + pathData = Map_QM.util.allMap[parseInt(array[0])].buildArr[parseInt(array[1])].mapData.path; if (array[0] == this.forShopArr[index].build) { if (array[1] == this.forShopArr[index].floor) { - this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]) + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); } else { if (j > 0) { - this.forShopArr[index].Facilities = this.getFacilIcon(PathPoint[j - 1].split('_'), parseInt(array[0])) + this.forShopArr[index].Facilities = this.getFacilIcon( PathPoint[j - 1].split("_"),parseInt(array[0])); } else { - this.forShopArr[index].Facilities = null + this.forShopArr[index].Facilities = null; } - this.forShopArr.push({ build: parseInt(array[0]), floor: parseInt(array[1]), PathPoint: [] }) - index++ - this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]) + this.forShopArr.push({ + build: parseInt(array[0]), + floor: parseInt(array[1]), + PathPoint: [] + }); + index++; + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); } } else { - this.forShopArr.push({ build: parseInt(array[0]), floor: parseInt(array[1]), PathPoint: [] }) - index++ - this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]) + this.forShopArr.push({ + build: parseInt(array[0]), + floor: parseInt(array[1]), + PathPoint: [] + }); + index++; + this.forShopArr[index].PathPoint.push(pathData.nodes[parseInt(array[2])]); } } let dy = 0, dx = 0, - ang = 0 + ang = 0; if (this.forShopArr[0].PathPoint.length > 1) { if (this.forShopArr[0].PathPoint.length == 2) { - dy = this.forShopArr[0].PathPoint[1].y - this.forShopArr[0].PathPoint[0].y - dx = this.forShopArr[0].PathPoint[1].x - this.forShopArr[0].PathPoint[0].x + dy = this.forShopArr[0].PathPoint[1].y - this.forShopArr[0].PathPoint[0].y; + dx = this.forShopArr[0].PathPoint[1].x - this.forShopArr[0].PathPoint[0].x; } else { - dy = this.forShopArr[0].PathPoint[2].y - this.forShopArr[0].PathPoint[1].y - dx = this.forShopArr[0].PathPoint[2].x - this.forShopArr[0].PathPoint[1].x + dy = this.forShopArr[0].PathPoint[2].y - this.forShopArr[0].PathPoint[1].y; + dx = this.forShopArr[0].PathPoint[2].x -this.forShopArr[0].PathPoint[1].x; } - ang = (Math.atan2(dy, dx) * 180) / Math.PI - Map_QM.util.deviceObj.angle - - ang = ang > 180 ? ang - 360 : ang - ang = ang < -180 ? ang + 360 : ang + ang = (Math.atan2(dy, dx) * 180) / Math.PI - Map_QM.util.deviceObj.angle; + ang = ang > 180 ? ang - 360 : ang; + ang = ang < -180 ? ang + 360 : ang; if (ang < -50 && ang >= -130) { - Dir = '向前出发' - DirEn = 'to forward' + Dir = "向前出发"; + DirEn = "to forward"; } else if (ang >= -50 && ang < 50) { - Dir = '向右出发' - DirEn = 'to right' + Dir = "向右出发"; + DirEn = "to right"; } else if (ang >= 50 && ang < 130) { - Dir = '向后出发' - DirEn = 'to back' + Dir = "向后出发"; + DirEn = "to back"; } else { - Dir = '向左出发' - DirEn = 'to left' + Dir = "向左出发"; + DirEn = "to left"; } } - let pLen = Map_QM.forShopArr[Map_QM.forShopArr.length - 1].PathPoint.length - Map_QM.util.overObj.xaxis = Map_QM.forShopArr[Map_QM.forShopArr.length - 1].PathPoint[pLen - 1].x - Map_QM.util.overObj.yaxis = Map_QM.forShopArr[Map_QM.forShopArr.length - 1].PathPoint[pLen - 1].y + let pLen = Map_QM.forShopArr[Map_QM.forShopArr.length - 1].PathPoint.length; + Map_QM.util.overObj.xaxis = Map_QM.forShopArr[Map_QM.forShopArr.length - 1].PathPoint[pLen - 1].x; + Map_QM.util.overObj.yaxis = Map_QM.forShopArr[Map_QM.forShopArr.length - 1].PathPoint[pLen - 1].y; if (Map_QM.forShopArr.length > 0) { // "floor" PathPoint Direction (Facilities) - Map_QM.forShopArr[0].Direction = Dir - Map_QM.forShopArr[0].DirectionEn = DirEn + Map_QM.forShopArr[0].Direction = Dir; + Map_QM.forShopArr[0].DirectionEn = DirEn; for (let m = 0; m < Map_QM.forShopArr.length; m++) { //查找经过店铺 - Map_QM.forShopArr[m].wayShop = Map_QM.foreignShop(Map_QM.forShopArr[m].PathPoint, Map_QM.forShopArr[m].build, Map_QM.forShopArr[m].floor, m) - if (Map_QM.util.overObj.build == Map_QM.forShopArr[m].build && Map_QM.util.overObj.floor == Map_QM.forShopArr[m].floor) { - let len = Map_QM.forShopArr[m].wayShop.length - if (Map_QM.forShopArr[m].wayShop[len - 1] && Map_QM.forShopArr[m].wayShop[len - 1].shop.yaxis == Map_QM.util.overObj.node) { - Map_QM.forShopArr[m].wayShop.pop() + Map_QM.forShopArr[m].wayShop = Map_QM.foreignShop( + Map_QM.forShopArr[m].PathPoint, + Map_QM.forShopArr[m].build, + Map_QM.forShopArr[m].floor, + m + ); + if (Map_QM.util.overObj.build == Map_QM.forShopArr[m].build && Map_QM.util.overObj.floor == Map_QM.forShopArr[m].floor ) { + let len = Map_QM.forShopArr[m].wayShop.length; + if (Map_QM.forShopArr[m].wayShop[len - 1] &&Map_QM.forShopArr[m].wayShop[len - 1].shop.yaxis == Map_QM.util.overObj.node) { + Map_QM.forShopArr[m].wayShop.pop(); } } } @@ -3711,102 +5388,111 @@ MainMap_QM.prototype = { * @api {事件} InitPathOver 地图导航状态完成 * @apiGroup 地图事件 * @apiDescription 地图开始导航时触发 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiSampleRequest off * * @apiParamExample 请求示例 * Map_QM.addEventListener("InitPathOver",onInitPathOver,false); */ Map_QM.dispatchEvent({ - type: 'InitPathOver', - data: Map_QM.forShopArr - }) + type: "InitPathOver", + data: Map_QM.forShopArr, + }); } else { - console.error('无可行路径,请检查起、终点位') - return + console.error("无可行路径,请检查起、终点位"); + return; } - this.onFindPathToObj() + this.onFindPathToObj(); } }, getMinCostByArray: function (floor, array, costall) { - if (!Map_QM.util.startObj) { - Map_QM.changeStartPoint(); - } - if (!Map_QM.util.numBuild) { - Map_QM.util.numBuild = 0; - } - let mis = -1, nodeP; - for (let i = 0; i < array.length; i++) { - let toNade = Map_QM.util.numBuild + "_" + floor + "_" + array[i]; - let PathPoint = costall[toNade]; - if (mis == -1) { - mis = PathPoint; - nodeP = array[i]; - } else { - if (mis > PathPoint) { - mis = PathPoint; - nodeP = array[i]; - } - } - } - return nodeP; - }, + if (!Map_QM.util.startObj) { + Map_QM.changeStartPoint(); + } + if (!Map_QM.util.numBuild) { + Map_QM.util.numBuild = 0; + } + let mis = -1, + nodeP; + for (let i = 0; i < array.length; i++) { + let toNade = Map_QM.util.numBuild + "_" + floor + "_" + array[i]; + let PathPoint = costall[toNade]; + if (mis == -1) { + mis = PathPoint; + nodeP = array[i]; + } else { + if (mis > PathPoint) { + mis = PathPoint; + nodeP = array[i]; + } + } + } + return nodeP; + }, /** * 途径店铺 */ foreignShop: function (pathArr, build, cFloor, m) { - let shopList = [] - let shops = Map_QM.mapArr[parseInt(build)][parseInt(cFloor)].shopObj.children + let shopList = []; + let shops = + Map_QM.mapArr[parseInt(build)][parseInt(cFloor)].shopObj.children; for (let n = 0; n < pathArr.length; n++) { for (let i = 0; i < shops.length; i++) { - if (shops[i].userData && shops[i].userData.type == 'shop' && shops[i].userData.navRecommend) { - if (shops[i].userData.node == pathArr[n].id && shops[i].userData.shopData) { - let data = { pathArrIn: m, pathIndex: n, shop: shops[i].userData.shopData } - shopList.push(data) - break + if (shops[i].userData && shops[i].userData.type == "shop" && shops[i].userData.navRecommend) { + if (shops[i].userData.node == pathArr[n].id &&shops[i].userData.shopData) { + let data = { + pathArrIn: m, + pathIndex: n, + shop: shops[i].userData.shopData + }; + shopList.push(data); + break; } } } } - return shopList + return shopList; }, getFacilIcon: function (fromFArr, build = -1) { if (build === -1) { - build = Map_QM.util.selectBuild + build = Map_QM.util.selectBuild; } - let childs = this.mapArr[build][fromFArr[1]].serObj.children - let selectEle + let childs = this.mapArr[build][fromFArr[1]].serObj.children; + let selectEle; for (let i = 0; i < childs.length; i++) { - if (childs[i].type == "Object3D" && childs[i].userData.navCode == fromFArr[2] && ("dt,ft,upft,lt,downft".search(childs[i].userData.facCode) != -1)) { - selectEle = { imgUrl: childs[i].userData.src, userData: childs[i].userData, position: { x: childs[i].position.x, y: childs[i].position.y } } - break - } + if (childs[i].type == "Object3D" &&childs[i].userData.navCode == fromFArr[2] &&"dt,ft,upft,lt,downft".search(childs[i].userData.facCode) != -1 ) { + selectEle = { + imgUrl: childs[i].userData.src, + userData: childs[i].userData, + position: { x: childs[i].position.x, y: childs[i].position.y } + }; + break; + } } - return selectEle + return selectEle; }, /** * 寻路动画方法 */ onFindPathToObj: function () { - outTime = -1 - Map_QM.util._indexPathFloor = 0 - Map_QM.callBackLoadOver = Map_QM.callBackForPathShop //楼层初始化完成后回调 - if (pathCameraState == '2D') { - Map_QM.onInnerMeDir() - Map_QM.controls.enabled = false - Map_QM.guide = Map_QM.man_2d - } - Map_QM.changeBuildInner(Map_QM.forShopArr[Map_QM.util._indexPathFloor].build, Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor) + Map_QM.util._indexPathFloor = 0; + Map_QM.callBackLoadOver = Map_QM.callBackForPathShop; //楼层初始化完成后回调 + if (pathCameraState == "2D") { + Map_QM.onInnerMeDir(); + Map_QM.controls.enabled = false; + Map_QM.guide = Map_QM.man_2d; + } + Map_QM.changeBuildInner( Map_QM.forShopArr[Map_QM.util._indexPathFloor].build,Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor); }, /** * 播放楼层动画完成后 */ callBackForPathShop: function () { - Map_QM.callBackLoadOver = null + Map_QM.callBackLoadOver = null; if (Map_QM.util.pathStateObj.isPathState) { //如果是寻路状态,继续导航 - Map_QM.onFindPath() + Map_QM.onFindPath(); } }, /** @@ -3815,66 +5501,61 @@ MainMap_QM.prototype = { * @param {Object} endN */ onFindPath: function () { - TweenMax.killAll(true) - + TweenMax.killAll(true); if (Map_QM.util.overObj.floor == Map_QM.util.selectFloor && Map_QM.util.overObj.xaxis) { - Map_QM.mapArr[Map_QM.util.overObj.build][Map_QM.util.overObj.floor].setOverSite( - Map_QM.util.overObj.xaxis, - Map_QM.util.overObj.yaxis, - parseInt(Map_QM.util.shopHeight) - ) - }else{ - Map_QM.endModel && (Map_QM.endModel.visible = false); - Map_QM.endIcon && (Map_QM.endIcon.visible = false); - } - + Map_QM.mapArr[Map_QM.util.overObj.build][Map_QM.util.overObj.floor].setOverSite(Map_QM.util.overObj.xaxis, Map_QM.util.overObj.yaxis,parseInt(Map_QM.util.shopHeight)); + } else { + Map_QM.endModel && (Map_QM.endModel.visible = false); + Map_QM.endIcon && (Map_QM.endIcon.visible = false); + } if (Map_QM.forShopArr.length > 0) { - document.addEventListener('pathOver', Map_QM.onFindPathFloor, true) - Map_QM.mapArr[Map_QM.forShopArr[Map_QM.util._indexPathFloor].build][Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor].findPath.clearPath() - Map_QM.mapArr[Map_QM.forShopArr[Map_QM.util._indexPathFloor].build][Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor].findPath.onFindPathAnimation( - Map_QM.forShopArr[Map_QM.util._indexPathFloor].PathPoint - ) //传入数组 - Map_QM.mapArr[Map_QM.forShopArr[Map_QM.util._indexPathFloor].build][Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor].findPath.guidePathPlay( - Map_QM.forShopArr[Map_QM.util._indexPathFloor] - ) - Map_QM.controlsChock() + document.addEventListener("pathOver", Map_QM.onFindPathFloor, true); + if (Map_QM.util.isMorePath) { + Map_QM.mapArr[Map_QM.forShopArr[Map_QM.util._indexPathFloor].build][Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor].findPath.onFindPathAnimation(pathNodes[Map_QM.util._indexPathFloor].pathNode, Map_QM.util.isMorePath,pathNodes[Map_QM.util._indexPathFloor].floor); //传入数组 + } else { + Map_QM.mapArr[Map_QM.forShopArr[Map_QM.util._indexPathFloor].build][Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor].findPath.clearPath(); + Map_QM.mapArr[Map_QM.forShopArr[Map_QM.util._indexPathFloor].build][Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor].findPath.onFindPathAnimation(Map_QM.forShopArr[Map_QM.util._indexPathFloor].PathPoint,false ); //传入数组 + } + Map_QM.mapArr[Map_QM.forShopArr[Map_QM.util._indexPathFloor].build][Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor].findPath.guidePathPlay(Map_QM.forShopArr[Map_QM.util._indexPathFloor]); + Map_QM.controlsChock(); } }, + /** * 显示楼层 */ showNavFloor: function (fromFloor, toFloor, build) { - let floorArr = [] - let min = Math.min(fromFloor, toFloor) - let max = Math.max(fromFloor, toFloor) + let floorArr = []; + let min = Math.min(fromFloor, toFloor); + let max = Math.max(fromFloor, toFloor); for (let i = min; i <= max; i++) { - floorArr.push(Map_QM.mapArr[build][i].floorName) + floorArr.push(Map_QM.mapArr[build][i].floorName); } if (floorArr.length > 5) { - floorArr.splice(2, floorArr.length - 3) - floorArr[1] = '...' + floorArr.splice(2, floorArr.length - 3); + floorArr[1] = "..."; } - return floorArr + return floorArr; }, //导航完成事件 onFindPathFloor: function (event) { - document.removeEventListener('pathOver', Map_QM.onFindPathFloor) + document.removeEventListener("pathOver", Map_QM.onFindPathFloor); if (Map_QM.forShopArr.length <= Map_QM.util._indexPathFloor) { - return + return; } if (Map_QM.util._indexPathFloor < Map_QM.forShopArr.length - 1) { //楼层切换 if (Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities) { - let pathFloor = Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor - let x0 = Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.position.x + 64 - let y0 = Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.position.y - let model = Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.userData.model + let pathFloor = Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor; + let x0 =Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.position.x +64; + let y0 = Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.position.y; + let model = Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.userData.model; /** * @api {事件} PathPlaying 地图导航的实时状态 * @apiGroup 地图事件 * @apiDescription 地图导航过程中实时触发 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiSampleRequest off * * @apiParamExample 请求示例 @@ -3882,140 +5563,146 @@ MainMap_QM.prototype = { */ Map_QM.dispatchEvent({ //寻路中返回小人当前所在点位 - type: 'PathPlaying', + type: "PathPlaying", data: { - shopNum: Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.userData.facCode + Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.userData.no - } - }) - let box - if (model && model.userData.name == 'dt') { + houseNumber:Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.userData.facCode + Map_QM.forShopArr[Map_QM.util._indexPathFloor].Facilities.userData.no, + }, + }); + let box; + if (model && model.userData.name == "dt") { model.traverse(function (child) { - if (child.isMesh && child.name == 'zhitibox') { - box = child + if (child.isMesh && child.name == "zhitibox") { + box = child; } - if (child.isMesh && (child.name == 'zhitijiegou' || child.name == 'zhitiboli')) { - child.scale.y = 7.5 + if (child.isMesh && (child.name == "zhitijiegou" || child.name == "zhitiboli")) { + child.scale.y = 3; } - }) + }); } let zo = 2, tz = 2, boxT = 0, - boxZ = 0 - let add = window.innerWidth>2000 ? 80 : 40; - let lft = window.innerWidth>2000 ? 8 : 4; - Map_QM.util._indexPathFloor++ - let toFloor = parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor) - Map_QM.util.selectFloor = toFloor - let floorArr = Map_QM.showNavFloor(pathFloor, toFloor, parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].build)) //电梯旁显示的楼层名称 + boxZ = 0; + let add = window.innerWidth > 2000 ? 80 : 40; + let lft = window.innerWidth > 2000 ? 8 : 4; + Map_QM.util._indexPathFloor++; + let toFloor = parseInt( + Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor + ); + Map_QM.util.selectFloor = toFloor; + let floorArr = Map_QM.showNavFloor( + pathFloor, + toFloor, + parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].build) + ); //电梯旁显示的楼层名称 if (pathFloor < toFloor) { - tz = (floorArr.length - 1) * add - boxT = 27 + tz = (floorArr.length - 1) * add; + boxT = 12; } else { - zo = (floorArr.length - 1) * add - boxZ = 27 + zo = (floorArr.length - 1) * add; + boxZ = 12; } - document.getElementById('moveFloor').style.bottom = zo + 'px' - document.getElementById('moveFloor').style.width = add + 'px' - document.getElementById('moveFloor').style.height = add + 'px' - Map_QM.moveFloorbg.element.style.width = (add+lft) + 'px' - Map_QM.moveFloorbg.element.style.height = floorArr.length * add + 'px' - Map_QM.moveFloorbg.position.set(x0, y0, (floorArr.length * add)/-1) - Map_QM.moveFloorbg.applyMatrix4(Map_QM.mapArr[parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].build)][pathFloor].allObj.matrix) - - let floorBox = document.getElementById('floorBox') + document.getElementById("moveFloor").style.bottom = zo + "px"; + document.getElementById("moveFloor").style.width = add + "px"; + document.getElementById("moveFloor").style.height = add + "px"; + + Map_QM.moveFloorbg.element.style.width = add + lft + "px"; + Map_QM.moveFloorbg.element.style.height = floorArr.length * add + "px"; + Map_QM.moveFloorbg.position.set(x0, y0, (floorArr.length * add) / -1); + Map_QM.moveFloorbg.applyMatrix4( + Map_QM.mapArr[ + parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].build) + ][pathFloor].allObj.matrix + ); + let floorBox = document.getElementById("floorBox"); while (floorBox.hasChildNodes()) { - floorBox.removeChild(floorBox.firstChild) + floorBox.removeChild(floorBox.firstChild); } for (let i = floorArr.length - 1; i >= 0; i--) { - let span2 = document.createElement('span') - span2.style.cssText = 'display: block;color: #000000; text-align: center;' - span2.style.fontSize = '16px' - if ( window.innerWidth>2000) { - span2.style.fontSize = '24px' - } - span2.style.width = (add+lft) + 'px' - span2.style.height = add + 'px' - span2.style.lineHeight = add + 'px' - span2.innerText = floorArr[i] - floorBox.appendChild(span2) + let span2 = document.createElement("span"); + span2.style.cssText = "display: block;color: #000000; text-align: center;"; + span2.style.fontSize = "16px"; + if (window.innerWidth > 2000) { + span2.style.fontSize = "24px"; + } + span2.style.width = add + lft + "px"; + span2.style.height = add + "px"; + span2.style.lineHeight = add + "px"; + span2.innerText = floorArr[i]; + floorBox.appendChild(span2); } - TweenMax.fromTo( - '#moveFloor', - 1.5, - { bottom: zo }, + + TweenMax.fromTo("#moveFloor",1.5,{ bottom: zo }, { bottom: tz, delay: 0.1, onComplete: function () { Map_QM.moveFloorbg.element.style.display = "none"; - Map_QM.callBackLoadOver = Map_QM.callBackForPathShop //楼层初始化完成后回调 - Map_QM.changeFloorInner(Map_QM.forShopArr[Map_QM.util._indexPathFloor].build, Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor) - } + Map_QM.callBackLoadOver = Map_QM.callBackForPathShop; //楼层初始化完成后回调 + Map_QM.changeFloorInner( + Map_QM.forShopArr[Map_QM.util._indexPathFloor].build, + Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor + ); + }, } - ) - Map_QM.moveFloorbg.element.style.display = ""; + ); + Map_QM.moveFloorbg.element.style.display = "block"; if (box) { - TweenMax.fromTo( - box.position, - 1.2, - { y: boxZ }, - { - y: boxT, - delay: 0.2, + TweenMax.fromTo(box.position, 1.2, { y: boxZ }, + { y: boxT, delay: 0.2, onComplete: function () { - box.position.y = 0 + box.position.y = 0; model.traverse(function (child) { - if (child.isMesh && (child.name == 'zhitijiegou' || child.name == 'zhitiboli')) { - child.scale.y = 1 + if ( + child.isMesh && + (child.name == "zhitijiegou" || child.name == "zhitiboli") + ) { + child.scale.y = 1; } - }) - } + }); + }, } - ) + ); } - if (pathCameraState == '3D') { - let xt = Map_QM.guide.position.x + event.detail.dx * 10 - let yt = Map_QM.guide.position.y + event.detail.dy * 10 - if (model && model.userData.name == 'upft') { - Map_QM.guide.visible = true - TweenMax.to(Map_QM.guide.position, 1.3, { - x: xt, - y: yt, - z: 50, + if (pathCameraState == "3D") { + let xt = Map_QM.guide.position.x + event.detail.dx * 10; + let yt = Map_QM.guide.position.y + event.detail.dy * 10; + if (model && model.userData.name == "upft") { + Map_QM.guide.visible = true; + TweenMax.to(Map_QM.guide.position, 1.3, { x: xt, y: yt, z: 50, onComplete: function () { - Map_QM.guide.visible = false - } - }) + Map_QM.guide.visible = false; + }, + }); } - if (model && model.userData.name == 'downft') { - Map_QM.guide.visible = true - TweenMax.to(Map_QM.guide.position, 1.3, { - x: xt, - y: yt, - z: -50, + if (model && model.userData.name == "downft") { + Map_QM.guide.visible = true; + TweenMax.to(Map_QM.guide.position, 1.3, { x: xt, y: yt, z: -50, onComplete: function () { - Map_QM.guide.visible = false - } - }) + Map_QM.guide.visible = false; + }, + }); } } } else { //楼栋切换 - Map_QM.util._indexPathFloor++ - Map_QM.callBackLoadOver = Map_QM.callBackForPathShop - Map_QM.changeBuildInner(Map_QM.forShopArr[Map_QM.util._indexPathFloor].build, Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor) + Map_QM.util._indexPathFloor++; + Map_QM.callBackLoadOver = Map_QM.callBackForPathShop; + Map_QM.changeBuildInner( + Map_QM.forShopArr[Map_QM.util._indexPathFloor].build, + Map_QM.forShopArr[Map_QM.util._indexPathFloor].floor + ); } } else { - Map_QM.util.startObj = Map_QM.util.deviceObj + Map_QM.util.startObj = Map_QM.util.deviceObj; /** * @api {事件} PathPlayOver 地图导航完成 * @apiGroup 地图事件 * @apiDescription 地图导航到达目标点时触发 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * @apiSampleRequest off * * @apiParamExample 请求示例 @@ -4023,88 +5710,88 @@ MainMap_QM.prototype = { */ Map_QM.dispatchEvent({ //寻路完成 - type: 'PathPlayOver', - data: 'PathPlayOver' - }) + type: "PathPlayOver", + data: "PathPlayOver", + }); } }, /** * 楼层状态清理 */ clearFloor: function (fIndex = -1, reSet = true) { - isJUZ = false - Map_QM.controls.setZoom(1) + isJUZ = false; if (fIndex == -1) { - fIndex = Map_QM.util.deviceObj.floor + fIndex = Map_QM.util.deviceObj.floor; } if (Map_QM.selectShop) { - Map_QM.selectShop.scale.z = 1 + Map_QM.selectShop.scale.z = 1; } if (Map_QM.endModel && Map_QM.endModel.visible) { - Map_QM.endModel.visible = false + Map_QM.endModel.visible = false; } if (Map_QM.endIcon && Map_QM.endIcon.visible) { - Map_QM.endIcon.visible = false + Map_QM.endIcon.visible = false; } if (Map_QM.moveFloorbg) { - Map_QM.moveFloorbg.element.style.display = "none" + Map_QM.moveFloorbg.element.style.display = "none"; } if (reSet) { //叠层不处理 if (Map_QM.mapArr[Map_QM.util.selectBuild] && Map_QM.mapArr[Map_QM.util.selectBuild].length > 0) { for (let i = 0; i < Map_QM.mapArr[Map_QM.util.selectBuild].length; i++) { - let child = Map_QM.mapArr[Map_QM.util.selectBuild][i].allObj + let child = Map_QM.mapArr[Map_QM.util.selectBuild][i].allObj; for (let k = child.children.length - 1; k >= 0; k--) { - if (child.children[k].name == 'lineDash') { - Map_QM.mapArr[Map_QM.util.selectBuild][i].allObj.remove(child.children[k]) + if (child.children[k].name == "lineDash") { + Map_QM.mapArr[Map_QM.util.selectBuild][i].allObj.remove(child.children[k]); } } - Map_QM.mapArr[Map_QM.util.selectBuild][i].findPath.clearPath() + Map_QM.mapArr[Map_QM.util.selectBuild][i].findPath.clearPath(); } } - Map_QM.remove_child(Map_QM.dtLineGroup) + Map_QM.remove_child(Map_QM.dtLineGroup); } - TweenMax.killAll(true) + TweenMax.killAll(true); }, remove_child: function (remObj) { if (!remObj) { - return + return; } - let child_elem = remObj.children + let child_elem = remObj.children; for (let i = child_elem.length - 1; i >= 0; i--) { if (child_elem[i].children.length > 0) { - Map_QM.remove_child(child_elem[i]) + Map_QM.remove_child(child_elem[i]); } else { if (child_elem[i] instanceof THREE.Mesh) { - child_elem[i].geometry.dispose() // 删除几何体 - if (child_elem[i].material !== undefined) Map_QM.removeMaterial(child_elem.material) // 删除材质 + child_elem[i].geometry.dispose(); // 删除几何体 + if (child_elem[i].material !== undefined) + Map_QM.removeMaterial(child_elem.material); // 删除材质 } } - if (child_elem[i].name != 'light' && child_elem[i].name != 'dtline') { - remObj.remove(child_elem[i]) + if (child_elem[i].name != "light" && child_elem[i].name != "dtline") { + remObj.remove(child_elem[i]); } } }, removeMaterial: function (material) { if (Array.isArray(material)) { for (var i = 0, l = material.length; i < l; i++) { - this.removeMaterialFromRefCounter(material[i]) + this.removeMaterialFromRefCounter(material[i]); } } else { - this.removeMaterialFromRefCounter(material) + this.removeMaterialFromRefCounter(material); } }, removeMaterialFromRefCounter: function (material) { - var materialsRefCounter = this.materialsRefCounter + var materialsRefCounter = this.materialsRefCounter; if (materialsRefCounter) { - var count = materialsRefCounter.get(material) - count-- + var count = materialsRefCounter.get(material); + count--; if (count === 0) { - materialsRefCounter.delete(material) - delete this.materials[material.uuid] + materialsRefCounter.delete(material); + delete this.materials[material.uuid]; } else { - materialsRefCounter.set(material, count) + materialsRefCounter.set(material, count); } } }, @@ -4113,46 +5800,47 @@ MainMap_QM.prototype = { * @api {方法} pathStop() 导航暂停/播放 * @apiGroup 地图导航 * @apiDescription 导航动画暂停/播放 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * */ pathStop: function (isPlaying) { - Map_QM.util.pathStateObj.isPathPlay = isPlaying === undefined ? !Map_QM.util.pathStateObj.isPathPlay : isPlaying - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].findPath.pathPlay.isPlay = Map_QM.util.pathStateObj.isPathPlay + Map_QM.util.pathStateObj.isPathPlay =isPlaying === undefined? !Map_QM.util.pathStateObj.isPathPlay : isPlaying; + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].findPath.pathPlay.isPlay = Map_QM.util.pathStateObj.isPathPlay; }, /** * @api {方法} pathRePlay() 导航动画重播 * @apiGroup 地图导航 * @apiDescription 导航动画重播 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiSampleRequest off * */ pathRePlay: function () { - clearTimeout(Map_QM.util.timeObj.pathTime) - TweenMax.killAll(true) - if(!Map_QM.util.overObj.node){ - return - } - Map_QM.util.timeObj.pathTime = setTimeout(() => { - clearTimeout(Map_QM.util.timeObj.pathTime) - Map_QM.controls.reset() - if (Map_QM.util.overObj && Map_QM.forShopArr[0]) { - Map_QM.util.pathStateObj.isPathPlay = true - Map_QM.clearFloor() - Map_QM.onFindPathToObj() - } - }, 100) + clearTimeout(Map_QM.util.timeObj.pathTime); + TweenMax.killAll(true); + if (!Map_QM.util.overObj.node) { + return; + } + Map_QM.util.timeObj.pathTime = setTimeout(() => { + clearTimeout(Map_QM.util.timeObj.pathTime); + Map_QM.controls.reset(); + if (Map_QM.util.overObj && Map_QM.forShopArr[0]) { + Map_QM.util.pathStateObj.isPathPlay = true; + Map_QM.clearFloor(); + Map_QM.onFindPathToObj(); + } + }, 100); + }, /** * @api {方法} ChangePathByFt() 切换扶梯模式 * @apiGroup 地图导航 * @apiDescription 导航切换扶梯模式 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {function} callBack 回调函数 * @@ -4164,30 +5852,30 @@ MainMap_QM.prototype = { * */ ChangePathByFt: function (callBack) { - clearTimeout(Map_QM.util.timeObj.pathTime) - TweenMax.killAll(true) - if(!Map_QM.util.overObj.node || Map_QM.util.isMorePath){ - return - } + clearTimeout(Map_QM.util.timeObj.pathTime); + TweenMax.killAll(true); + if (!Map_QM.util.overObj.node || Map_QM.util.isMorePath) { + return; + } Map_QM.util.timeObj.pathTime = setTimeout(() => { - clearTimeout(Map_QM.util.timeObj.pathTime) - Map_QM.controls.reset() + clearTimeout(Map_QM.util.timeObj.pathTime); + Map_QM.controls.reset(); if (Map_QM.util.overObj) { - Map_QM.clearFloor() - Map_QM.onFindPathModel(Map_QM.util.pathStateObj.ftPath) + Map_QM.clearFloor(); + Map_QM.onFindPathModel(Map_QM.util.pathStateObj.ftPath); if (callBack) { - Map_QM.parseForShopArr() - const data = JSON.parse(JSON.stringify(Map_QM.util.pathStateObj.forShopArr)) - callBack(data) + Map_QM.parseForShopArr(); + const data = JSON.parse(JSON.stringify(Map_QM.util.pathStateObj.forShopArr)); + callBack(data); } } - }, 100) + }, 100); }, /** * @api {方法} ChangePathByDt() 切换电梯模式 * @apiGroup 地图导航 * @apiDescription 导航切换电梯模式 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {function} callBack 回调函数 * @@ -4199,30 +5887,30 @@ MainMap_QM.prototype = { * */ ChangePathByDt: function (callBack) { - clearTimeout(Map_QM.util.timeObj.pathTime) - TweenMax.killAll(true) - if(!Map_QM.util.overObj.node || Map_QM.util.isMorePath){ - return - } + clearTimeout(Map_QM.util.timeObj.pathTime); + TweenMax.killAll(true); + if (!Map_QM.util.overObj.node || Map_QM.util.isMorePath) { + return; + } Map_QM.util.timeObj.pathTime = setTimeout(() => { - clearTimeout(Map_QM.util.timeObj.pathTime) - Map_QM.controls.reset() + clearTimeout(Map_QM.util.timeObj.pathTime); + Map_QM.controls.reset(); if (Map_QM.util.overObj) { - Map_QM.clearFloor() - Map_QM.onFindPathModel(Map_QM.util.pathStateObj.dtPath) + Map_QM.clearFloor(); + Map_QM.onFindPathModel(Map_QM.util.pathStateObj.dtPath); if (callBack) { - Map_QM.parseForShopArr() - const data = JSON.parse(JSON.stringify(Map_QM.util.pathStateObj.forShopArr)) - callBack(data) + Map_QM.parseForShopArr(); + const data = JSON.parse(JSON.stringify(Map_QM.util.pathStateObj.forShopArr)); + callBack(data); } } - }, 100) + }, 100); }, /** * @api {方法} ChangePathByGood() 切换最佳模式 * @apiGroup 地图导航 * @apiDescription 导航切换最佳模式 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {function} callBack 回调函数 * @@ -4234,37 +5922,37 @@ MainMap_QM.prototype = { * */ ChangePathByGood: function (callBack) { - clearTimeout(Map_QM.util.timeObj.pathTime) - TweenMax.killAll(true) - if(!Map_QM.util.overObj.node || Map_QM.util.isMorePath){ - return - } + clearTimeout(Map_QM.util.timeObj.pathTime); + TweenMax.killAll(true); + if (!Map_QM.util.overObj.node || Map_QM.util.isMorePath) { + return; + } Map_QM.util.timeObj.pathTime = setTimeout(() => { - clearTimeout(Map_QM.util.timeObj.pathTime) - Map_QM.controls.reset() + clearTimeout(Map_QM.util.timeObj.pathTime); + Map_QM.controls.reset(); if (Map_QM.util.overObj) { - Map_QM.clearFloor() - Map_QM.onFindPathModel(Map_QM.util.pathStateObj.graphPath) + Map_QM.clearFloor(); + Map_QM.onFindPathModel(Map_QM.util.pathStateObj.graphPath); if (callBack) { - Map_QM.parseForShopArr() - const data = JSON.parse(JSON.stringify(Map_QM.util.pathStateObj.forShopArr)) - callBack(data) + Map_QM.parseForShopArr(); + const data = JSON.parse(JSON.stringify(Map_QM.util.pathStateObj.forShopArr)); + callBack(data); } } - }, 100) + }, 100); }, /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// changeDocmentResize: function (e) { - let w = parseInt(Map_QM.ele.clientWidth) || parseInt(window.getComputedStyle(Map_QM.ele, null).getPropertyValue('width')) - let h = parseInt(Map_QM.ele.clientHeight) || parseInt(window.getComputedStyle(Map_QM.ele, null).getPropertyValue('height')) - Map_QM.changeWindowResize(w, h) + let w = parseInt(Map_QM.ele.clientWidth) || parseInt(window.getComputedStyle(Map_QM.ele, null).getPropertyValue("width")); + let h = parseInt(Map_QM.ele.clientHeight) || parseInt( window.getComputedStyle(Map_QM.ele, null).getPropertyValue("height")); + Map_QM.changeWindowResize(w, h); }, /** * @api {方法} changeWindowResize() 窗口变化 * @apiGroup 地图交互 * @apiDescription 窗口变化 - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {int} width 窗口宽 * @apiParam {int} height 窗口高 @@ -4276,27 +5964,33 @@ MainMap_QM.prototype = { * Map_QM.changeWindowResize(1280,1080); */ changeWindowResize: function (width, height) { - Map_QM.aspect = width / height - Map_QM.cameraPerspective.aspect = Map_QM.aspect - Map_QM.cameraPerspective.updateProjectionMatrix() + if(!width){ + width = parseInt(Map_QM.ele.clientWidth) || parseInt(window.getComputedStyle(Map_QM.ele, null).getPropertyValue("width")); + } + if(!height){ + height = parseInt(Map_QM.ele.clientHeight) || parseInt(window.getComputedStyle(Map_QM.ele, null).getPropertyValue("height")); + } + Map_QM.aspect = width / height; + Map_QM.cameraPerspective.aspect = Map_QM.aspect; + Map_QM.cameraPerspective.updateProjectionMatrix(); Map_QM.cameraOrtho.left = -150 * Map_QM.aspect Map_QM.cameraOrtho.right = 150 * Map_QM.aspect Map_QM.cameraOrtho.top = 150; Map_QM.cameraOrtho.bottom = -150; - Map_QM.cameraOrtho.updateProjectionMatrix() - Map_QM.renderer.setSize(width, height) - Map_QM.labelRenderer.setSize(width, height) + Map_QM.cameraOrtho.updateProjectionMatrix(); + Map_QM.renderer.setSize(width, height); + Map_QM.labelRenderer.setSize(width, height); Map_QM.updateRender(); - Map_QM.collLabel(); - Map_QM.w = width - Map_QM.h = height - } -} + Map_QM.collLabel(); + Map_QM.w = width; + Map_QM.h = height; + }, +}; /** * @api {方法} init(callBack,options) 地图初始化 * @apiGroup 地图数据 * @apiDescription 初始化地图赋值 Map_QM - * @apiVersion 2.0.0 + * @apiVersion 4.0.0 * * @apiParam {function} callBack 初始化成功后的回调函数 * @apiParam {object} options 初始化对象 @@ -4306,18 +6000,20 @@ MainMap_QM.prototype = { * @apiParam {int} options.angle 起点设备角度 默认值 0 * @apiParam {string} options.perc_H 弹窗的偏移量 默认值 "-50%"; * @apiParam {string} options.containerId 地图div容器Id 默认值 "mapContainer" - * @apiParam {string} options.playSpeed 动画播放速度 默认值6 + * @apiParam {string} options.playSpeed 动画播放速度 默认值8 * @apiParam {boolean} options.collision 是否支持名称的碰撞检测 默认值 true * @apiParam {boolean} options.modelIcon 交通设施是否使用模型 默认值 true * @apiParam {Array} options.otherPath 人为干预的路线 默认值 []; * @apiParam {int} options.fSpace 双叠层状态下楼层的间距 默认值 500 * @apiParam {uint} options.navColor 途径店铺颜色 默认值 0xEE6A50 + * @apiParam {boolean} options.shadow 是否显示阴影 默认值 false * @apiParam {boolean} options.iconName 图标名称是否显示 默认值false * @apiParam {uint} options.pathColor 导航路径颜色 默认值 0xb47834, * @apiParam {string} options.pathStyle 导航第一视角 默认值 "2D", - * @apiParam {string} options.shopStyle 店铺显示字段编号(shopNum)名称(shopName) 默认值 "shopName", - * @apiParam {int} options.camZoom 地图显示我的方向状态的放大倍数 默认值 3 + * @apiParam {string} options.shopStyle 店铺显示字段编号(houseNumber)名称(shopName) 默认值 "shopName", * @apiParam {boolean} options.inArea 地图点击后是否聚焦到当前位置 默认值 false + * @apiParam {string} options.mapData 地图数据 res.data.mapData + * @apiParam {string} options.shopData 店铺数据 res.data * @apiParam {Array} options.iconUrl 设施库图标 默认值 [] * * @apiSampleRequest off @@ -4326,209 +6022,228 @@ MainMap_QM.prototype = { * MainMap_QM.init(callBackLoadOver,{build : 0, floor : 3, navPoint : 7, angle : 0, perc_H : "-50%",containerId : "mapContainer"}); */ MainMap_QM.init = function (callBack, options) { - if(Map_QM){ - Map_QM.cancelRender() - Map_QM.beforeDestroy() - } - Map_QM = new MainMap_QM(callBack, options) - return Map_QM -} -Object.assign(MainMap_QM.prototype, THREE.EventDispatcher.prototype) + if (Map_QM) { + Map_QM.cancelRender(); + Map_QM.beforeDestroy(); + } + Map_QM = new MainMap_QM(callBack, options); + return Map_QM; +}; +Object.assign(MainMap_QM.prototype, THREE.EventDispatcher.prototype); //////////////////////////////////////-------------------------------FloorMap -FloorMap_QM = function (bIndex, fIndex, floorName) { - this.Model_QM = new MyModel_QM() - this.facUtil = new Facilities_QM() - this.findPath = new FindPath_QM() - this.logoUtil = new ShopLogo_QM() - this.allObj = new THREE.Group() - this.allObj.name = floorName - this.allObj.rotation.x = Math.PI / -2 - this.CSSObj = new THREE.Group() - - this.labelObj = new THREE.Group() - this.labelObj.renderOrder = 100 - this.floorOrder = fIndex - this.buildOrder = bIndex - this.floorName = floorName - - //存第三方 - this.otherObj = new THREE.Object3D() - this.allObj.add(this.otherObj) - - //存放设施图标 - this.serObj = new THREE.Object3D() - //存放车位box - this.parkObj = new THREE.Group() - //标签 - this.tagObj = new THREE.Group() - this.tagObj.renderOrder = 100 - //存放设施图标 - this.svgObj = new THREE.Group() - //店铺 - this.shopObj = new THREE.Group() - this.allObj.add(this.shopObj) - this.allObj.add(this.svgObj) - this.allObj.add(this.CSSObj) - - this.CSSObj.add(this.serObj) - this.CSSObj.add(this.labelObj) - this.CSSObj.add(this.tagObj) - //标签 - this.showTagObj = new THREE.Group() - this.showTagObj.renderOrder = 100 - this.CSSObj.add(this.showTagObj) - - //线条 - this.lineObj = new THREE.Group() - this.lineObj.renderOrder = 100 - this.allObj.add(this.lineObj) - - this.startIcon -} +var FloorMap_QM = function (bIndex, fIndex, floorName) { + this.Model_QM = new MyModel_QM(); + this.facUtil = new Facilities_QM(); + this.findPath = new FindPath_QM(); + this.logoUtil = new ShopLogo_QM(); + this.allObj = new THREE.Group(); + this.allObj.name = floorName; + this.allObj.rotation.x = Math.PI / -2; + this.CSSObj = new THREE.Group(); + this.labelObj = new THREE.Group(); + this.labelObj.renderOrder = 100; + this.floorOrder = fIndex; + this.buildOrder = bIndex; + this.floorName = floorName; + //存第三方 + this.otherObj = new THREE.Object3D(); + this.allObj.add(this.otherObj); + + //存放设施图标 + this.serObj = new THREE.Object3D(); + //存放车位box + this.parkObj = new THREE.Group(); + //标签 + this.tagObj = new THREE.Group(); + this.tagObj.renderOrder = 100; + //存放设施图标 + this.svgObj = new THREE.Group(); + //店铺 + this.shopObj = new THREE.Group(); + this.allObj.add(this.shopObj); + this.allObj.add(this.svgObj); + this.allObj.add(this.CSSObj); + + this.CSSObj.add(this.serObj); + this.CSSObj.add(this.labelObj); + this.CSSObj.add(this.tagObj); + //标签 + this.showTagObj = new THREE.Group(); + this.showTagObj.renderOrder = 100; + this.CSSObj.add(this.showTagObj); + + //线条 + this.lineObj = new THREE.Group(); + this.lineObj.renderOrder = 100; + this.allObj.add(this.lineObj); + + this.startIcon; +}; FloorMap_QM.prototype = { initDraw: function () { - this.initFloor() - this.initFacilitie() - this.initStairs() - this.initTextArea() - this.initWall() - this.initDecos() - this.initPark() - this.initModel() - this.initTree() //植树 - this.initLogos() //贴图 + this.initFloor(); + this.initFacilitie(); + this.initStairs(); + this.initTextArea(); + this.initWall(); + this.initDecos(); + this.initPark(); + this.initModel(); + this.initTree(); //植树 + this.initLogos(); //贴图 }, initLogos: function () { - let sopce = this + let sopce = this; if (Map_QM.util.logos) { - Map_QM.util.logos.map(item => { + Map_QM.util.logos.map((item) => { if (item.build == sopce.buildOrder && item.floor == sopce.floorOrder) { - sopce.logoUtil.renderIcon(item, sopce, item.site || 0) + sopce.logoUtil.renderIcon(item, sopce, item.site || 0); } - }) + }); } }, initModel: function () { - let sopce = this + let sopce = this; if (Map_QM.util.modelArr) { for (let i = 0; i < Map_QM.util.modelArr.length; i++) { if (Map_QM.util.modelArr[i].build == this.buildOrder && Map_QM.util.modelArr[i].floor == this.floorOrder) { - new THREE.GLTFLoader().load(Map_QM.util.beforPath + Map_QM.util.modelArr[i].url, function (object) { - //加载路径fbx文件 - let mod = object.scene - mod.traverse(function (child) { - if (child.isMesh) { - child.receiveShadow = false - child.castShadow = false - child.userData.opacity = child.material.opacity - if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding //贴图需要转换成 线性编码 + new THREE.GLTFLoader().load( + Map_QM.util.beforPath + Map_QM.util.modelArr[i].url, + function (object) { + //加载路径fbx文件 + let mod = object.scene; + mod.traverse(function (child) { + if (child.isMesh) { + child.receiveShadow = Map_QM.util.options.shadow; + child.castShadow = Map_QM.util.options.shadow; + child.userData.opacity = child.material.opacity; + if (child.material.map) { + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 + } + child.material.color.convertGammaToLinear(0.7); } - child.material.color.convertGammaToLinear(0.7) + }); + for (let t = 0; t < Map_QM.util.modelArr[i].list.length; t++) { + let obj = mod.clone(); + obj.position.set( + Map_QM.util.modelArr[i].list[t].site.x, + -1 * Map_QM.util.modelArr[i].list[t].site.y, + Map_QM.util.modelArr[i].list[t].site.z + ); + obj.scale.set( + Map_QM.util.modelArr[i].list[t].size.x, + Map_QM.util.modelArr[i].list[t].size.y, + Map_QM.util.modelArr[i].list[t].size.z + ); + obj.rotateX((Map_QM.util.modelArr[i].list[t].rot.x * Math.PI) / 180); + obj.rotateY((Map_QM.util.modelArr[i].list[t].rot.y * Math.PI) / 180); + obj.rotateZ((Map_QM.util.modelArr[i].list[t].rot.z * Math.PI) / 180); + sopce.allObj.add(obj); } - }) - for (let t = 0; t < Map_QM.util.modelArr[i].list.length; t++) { - let obj = mod.clone() - obj.position.set(Map_QM.util.modelArr[i].list[t].site.x, -1 * Map_QM.util.modelArr[i].list[t].site.y, Map_QM.util.modelArr[i].list[t].site.z) - obj.scale.set(Map_QM.util.modelArr[i].list[t].size.x, Map_QM.util.modelArr[i].list[t].size.y, Map_QM.util.modelArr[i].list[t].size.z) - obj.rotateX(Map_QM.util.modelArr[i].list[t].rot.x * Math.PI / 180) - obj.rotateY(Map_QM.util.modelArr[i].list[t].rot.y * Math.PI / 180) - obj.rotateZ(Map_QM.util.modelArr[i].list[t].rot.z * Math.PI / 180) - sopce.allObj.add(obj) } - }) + ); } } } if (Map_QM.util.labelIconArr) { for (let i = 0; i < Map_QM.util.labelIconArr.length; i++) { if (Map_QM.util.labelIconArr[i].build == this.buildOrder && Map_QM.util.labelIconArr[i].floor == this.floorOrder) { - let SpriteDiv = document.createElement('div') - SpriteDiv.className = Map_QM.util.labelIconArr[i].className - SpriteDiv.innerHTML = Map_QM.util.labelIconArr[i].title - SpriteDiv.dataset.id = Map_QM.util.labelIconArr[i].data.id - SpriteDiv.dataset.x = Map_QM.util.labelIconArr[i].site.x - SpriteDiv.dataset.y = Map_QM.util.labelIconArr[i].site.y - SpriteDiv.dataset.z = Map_QM.util.labelIconArr[i].site.z - let pointLabel = new THREE.CSS2DObject(SpriteDiv) - pointLabel.position.set(Map_QM.util.labelIconArr[i].site.x, -1 * Map_QM.util.labelIconArr[i].site.y, Map_QM.util.labelIconArr[i].site.z) - pointLabel.name = Map_QM.util.labelIconArr[i].title - pointLabel.userData = Map_QM.util.labelIconArr[i].data - pointLabel.userData.site = Map_QM.util.labelIconArr[i].site - pointLabel.userData.mapShow = true - pointLabel.userData.isShow = true - pointLabel.userData.type = "icon" + let SpriteDiv = document.createElement("div"); + SpriteDiv.className = Map_QM.util.labelIconArr[i].className; + SpriteDiv.innerHTML = Map_QM.util.labelIconArr[i].title; + SpriteDiv.dataset.id = Map_QM.util.labelIconArr[i].data.id; + SpriteDiv.dataset.x = Map_QM.util.labelIconArr[i].site.x; + SpriteDiv.dataset.y = Map_QM.util.labelIconArr[i].site.y; + SpriteDiv.dataset.z = Map_QM.util.labelIconArr[i].site.z; + let pointLabel = new THREE.CSS2DObject(SpriteDiv); + pointLabel.position.set( + Map_QM.util.labelIconArr[i].site.x, + -1 * Map_QM.util.labelIconArr[i].site.y, + Map_QM.util.labelIconArr[i].site.z + ); + pointLabel.name = Map_QM.util.labelIconArr[i].title; + pointLabel.userData = Map_QM.util.labelIconArr[i].data; + pointLabel.userData.site = Map_QM.util.labelIconArr[i].site; + pointLabel.userData.mapShow = true; + pointLabel.userData.isShow = true; + pointLabel.userData.type = "icon"; if (Map_QM.util.labelIconArr[i].click) { //可点击 - SpriteDiv.addEventListener( - 'click', - event => { + SpriteDiv.addEventListener("click", (event) => { Map_QM.dispatchEvent({ - type: 'labelIcon', - data: event.target.dataset - }) + type: "labelIcon", + data: event.target.dataset, + }); }, false - ) + ); } else { - pointLabel.element.style.pointerEvents = 'none' + pointLabel.element.style.pointerEvents = "none"; } - pointLabel.userData.floor = Map_QM.util.labelIconArr[i].floor - sopce.showTagObj.add(pointLabel) + pointLabel.userData.floor = Map_QM.util.labelIconArr[i].floor; + sopce.showTagObj.add(pointLabel); } } } }, initTree: function () { - let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData + let mapData = + Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData; if (mapData.models) { for (let t = 0; t < mapData.models.length; t++) { for (let i = 0; i < Map_QM.util.fbxModels.length; i++) { if (mapData.models[t].type == Map_QM.util.fbxModels[i].key) { - let obj = Map_QM.util.fbxModels[i].obj.scene.clone() - obj.position.set(mapData.models[t].x, -1 * mapData.models[t].y, mapData.models[t].site) - obj.scale.set(mapData.models[t].scale, mapData.models[t].scale, mapData.models[t].scale) - obj.rotateX(Map_QM.util.fbxModels[i].operation.rot.x) - obj.rotateY(-1 * mapData.models[t].angle * Math.PI / 180) - obj.renderOrder = 100 - for (let k = 0; k < Map_QM.util.fbxModels[i].obj.animations.length; k++) { - let mixer = new THREE.AnimationMixer(obj) - mixer.clipAction(Map_QM.util.fbxModels[i].obj.animations[k]).play() - Map_QM.mixers.push(mixer) - } - //加载编辑器动画 - obj.name = mapData.models[t].name - if (mapData.animations) { - mapData.animations.forEach((item)=>{ - if(mapData.models[t].name == item.name){ - let posArr = [], rotArr = [], scaleArr = [], keyArr = [], proArr = [], clip - item.frames.forEach((it)=>{ - keyArr.push(it.time) - posArr.push(it.pos.x, -1*it.pos.y, it.pos.z) - rotArr.push(it.rot/-180*Math.PI) - scaleArr.push(it.size,it.size,it.size) - proArr.push(it.pro) - }); - if(item.isType){ //特殊模型动画 - let rotKF = new THREE.KeyframeTrack(item.sonName, keyArr, proArr) - clip = new THREE.AnimationClip(item.name, keyArr[keyArr.length-1], [rotKF]) - }else{ - let posKF = new THREE.KeyframeTrack(item.name+'.position', keyArr, posArr) - let rotKF = new THREE.KeyframeTrack(item.name+'.rotation[y]', keyArr, rotArr) - let scalKF = new THREE.KeyframeTrack(item.name+'.scale', keyArr, scaleArr) - clip = new THREE.AnimationClip(item.name, keyArr[keyArr.length-1], [posKF, rotKF, scalKF]) - } - if(clip){ - let mixer = new THREE.AnimationMixer(obj) - mixer.clipAction(clip).play() - Map_QM.mixers.push(mixer) - } - } - }) - } - this.allObj.add(obj) + let obj = Map_QM.util.fbxModels[i].obj.scene.clone(); + obj.position.set(mapData.models[t].x, -1 * mapData.models[t].y, mapData.models[t].site); + obj.scale.set(mapData.models[t].scale,mapData.models[t].scale,mapData.models[t].scale); + obj.rotateX(Map_QM.util.fbxModels[i].operation.rot.x); + obj.rotateY((-1 * mapData.models[t].angle * Math.PI) / 180); + obj.renderOrder = 100; + for (let k = 0;k < Map_QM.util.fbxModels[i].obj.animations.length; k++ ) { + let mixer = new THREE.AnimationMixer(obj); + mixer.clipAction(Map_QM.util.fbxModels[i].obj.animations[k]).play(); + Map_QM.mixers.push(mixer); + } + //加载编辑器动画 + obj.name = mapData.models[t].name; + if (mapData.animations) { + mapData.animations.forEach((item) => { + if (mapData.models[t].name == item.name) { + obj.rotateY(mapData.models[t].angle * Math.PI / 180); + let posArr = [], + rotArr = [], + scaleArr = [], + keyArr = [], + proArr = [], + clip; + item.frames.forEach((it) => { + keyArr.push(it.time); + posArr.push(it.pos.x, -1 * it.pos.y, it.pos.z); + rotArr.push((it.rot / -180) * Math.PI); + scaleArr.push(it.size, it.size, it.size); + proArr.push(it.pro); + }); + if (item.isType) { + //特殊模型动画 + let rotKF = new THREE.KeyframeTrack(item.sonName, keyArr, proArr); + clip = new THREE.AnimationClip(item.name, keyArr[keyArr.length - 1], [rotKF]); + } else { + let posKF = new THREE.KeyframeTrack(item.name + ".position",keyArr,posArr); + let rotKF = new THREE.KeyframeTrack(item.name + ".rotation[y]", keyArr,rotArr); + let scalKF = new THREE.KeyframeTrack(item.name + ".scale",keyArr,scaleArr); + clip = new THREE.AnimationClip(item.name,keyArr[keyArr.length - 1],[posKF, rotKF, scalKF]); + } + if (clip) { + let mixer = new THREE.AnimationMixer(obj); + mixer.clipAction(clip).play(); + Map_QM.mixers.push(mixer); + } + } + }); + } + this.allObj.add(obj); } } } @@ -4536,124 +6251,131 @@ FloorMap_QM.prototype = { }, //初始化单楼层 initFloor: function () { - let floor - let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData - let entColor, borderColor + let floor; + let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData; + let entColor, borderColor; if (mapData.floorArea) { - floor = Map_QM.util.changeAreaToString(mapData.floorArea) + floor = Map_QM.util.changeAreaToString(mapData.floorArea); } - let bLen = mapData.buildArea.length - let hLen = mapData.hollowArea.length - let hows_f = [] + let bLen = mapData.buildArea.length; + let hLen = mapData.hollowArea.length; + let hows_f = []; for (let m = 0; m < hLen; m++) { - let isIn = Map_QM.util.checkAreaInArea(mapData.hollowArea[m], mapData.floorArea); - if(isIn){ - hows_f.push(Map_QM.util.changeAreaToString(mapData.hollowArea[m])); - } + let isIn = Map_QM.util.checkAreaInArea(mapData.hollowArea[m],mapData.floorArea); + if (isIn) { + hows_f.push(Map_QM.util.changeAreaToString(mapData.hollowArea[m])); + } } if (floor) { - entColor = mapData.floorArea.entColor - borderColor = mapData.floorArea.borderColor - floorH = parseInt(mapData.floorArea.toHeight) - let mash = this.Model_QM.MyModelShape(floor, hows_f, mapData.floorArea, entColor, borderColor, 10 + 100 * this.floorOrder); - mash.receiveShadow = true - mash.castShadow = false + entColor = mapData.floorArea.entColor; + borderColor = mapData.floorArea.borderColor; + floorH = parseInt(mapData.floorArea.toHeight); + let mash = this.Model_QM.MyModelShape(floor,hows_f,mapData.floorArea,entColor,borderColor,10 + 100 * this.floorOrder); + mash.receiveShadow = true; + mash.castShadow = false; mash.userData = { - type: 'floor', - order: this.floorOrder - } - mash.userData.opacity = mapData.floorArea.alphaModle / 100 || 0 - mash.name = 'floor' - this.allObj.add(mash) + type: "floor", + order: this.floorOrder, + }; + mash.userData.opacity = mapData.floorArea.alphaModle / 100 || 0; + mash.name = "floor"; + this.allObj.add(mash); } /////////////////////初始化楼栋 for (let i = 0; i < bLen; i++) { - let build = Map_QM.util.changeAreaToString(mapData.buildArea[i]) - let hows = [] + let build = Map_QM.util.changeAreaToString(mapData.buildArea[i]); + let hows = []; for (let t = 0; t < hLen; t++) { - let isIn = Map_QM.util.checkAreaInArea(mapData.hollowArea[t], mapData.buildArea[i]) + let isIn = Map_QM.util.checkAreaInArea(mapData.hollowArea[t],mapData.buildArea[i]); if (isIn) { - hows.push(Map_QM.util.changeAreaToString(mapData.hollowArea[t])) + hows.push(Map_QM.util.changeAreaToString(mapData.hollowArea[t])); } } - entColor = mapData.buildArea[i].entColor - borderColor = mapData.buildArea[i].borderColor - buildH = parseInt(mapData.buildArea[i].toHeight) - let mash = this.Model_QM.MyPlaneShape(build, hows, mapData.buildArea[i], entColor, borderColor, 30 + 100 * this.floorOrder) - mash.receiveShadow = true - mash.castShadow = false + entColor = mapData.buildArea[i].entColor; + borderColor = mapData.buildArea[i].borderColor; + buildH = parseInt(mapData.buildArea[i].toHeight); + let mash = this.Model_QM.MyPlaneShape(build,hows,mapData.buildArea[i],entColor,borderColor,30 + 100 * this.floorOrder); + mash.receiveShadow = true; + mash.castShadow = false; mash.userData = { - type: 'build', + type: "build", order: this.floorOrder, - xaxis: mapData.buildArea[i].xaxis, - yaxis: mapData.buildArea[i].yaxis - } - mash.userData.opacity = mapData.buildArea[i].alphaModle / 100 || 0 + xaxis: mapData.buildArea[i].xaxis, + yaxis: mapData.buildArea[i].yaxis, + }; + mash.userData.opacity = mapData.buildArea[i].alphaModle / 100 || 0; mash.name = mapData.buildArea[i].name; - this.allObj.add(mash) + this.allObj.add(mash); } //店铺 - let sLen = mapData.shopArea.length - let show = (showE = '') - let showLeb = '' - let logo = '', + let sLen = mapData.shopArea.length; + let show = "", + showE = "", + showLeb = "", + formatCode = "", + mapShow = false; + let logo = "", navRecommend = false, - shopD = {}, - type = 'deco' - let shopData = Map_QM.util.shopData + shopD = {}; + let shopData = Map_QM.util.shopData; for (let i = 0; i < sLen; i++) { - if (Map_QM.util.changeAreaToString(mapData.shopArea[i]) != '') { - let arr = Map_QM.util.changeShopLinesToString(mapData.shopArea[i]) - entColor = mapData.shopArea[i].entColor || '#b79266' - borderColor = mapData.shopArea[i].borderColor || '#b79266' - show = showE = mapData.shopArea[i].name - logo = '' - showLeb = '' - navRecommend = false - mapShow = false - shopD = {} + if (Map_QM.util.changeAreaToString(mapData.shopArea[i]) != "") { + for (let t = 0; t < sLen; t++) { + let isIn = Map_QM.util.checkAreaInArea(mapData.shopArea[i], mapData.shopArea[t]); + isIn &&(mapData.shopArea[i].site = parseInt(mapData.shopArea[i].site) + 1); + } + let arr = Map_QM.util.changeShopLinesToString(mapData.shopArea[i]); + entColor = mapData.shopArea[i].entColor || "#b79266"; + borderColor = mapData.shopArea[i].borderColor || "#b79266"; + show = showE = mapData.shopArea[i].name; + logo = ""; + showLeb = ""; + navRecommend = false; + mapShow = false; + shopD = {}; if (shopData) { for (let h = 0; h < shopData.length; h++) { - let houseNum = shopData[h].houseNumber - if (houseNum == mapData.shopArea[i].name) { - show = shopData[h].shopName || shopData[h].name - showLeb = houseNum - 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 = false - } - 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].activityList && shopData[h].activityList.length > 0) { + if (shopData[h].houseNumber === mapData.shopArea[i].name) { + showLeb = shopData[h].houseNumber; + show = shopData[h].shopName == undefined ? shopData[h].name : shopData[h].shopName; + showE = shopData[h].shopNameEn == undefined ? shopData[h].nameEn : shopData[h].shopNameEn; + logo = shopData[h].logoUrl; + mapShow = shopData[h].mapShow ?? false; //是否常显示 + formatCode = shopData[h].industryFatherCode; + if (shopData[h].isPass) { + navRecommend = shopData[h].isPass; + } else { + navRecommend = false; + } + shopD = shopData[h]; + if (shopData[h].isNewShop) { + //新店 + mapData.shopArea[i].type = "new-shop"; + this.addTagLabel(mapData.shopArea[i], {node: mapData.shopArea[i].shopNav, floor: this.floorOrder, build: this.buildOrder}); + } else { + if (shopData[h].activityList &&shopData[h].activityList.length > 0) { //促销 - mapData.shopArea[i].type = 'promotion' - this.addTagLabel(mapData.shopArea[i], { node: mapData.shopArea[i].shopNav, floor: this.floorOrder, build: this.buildOrder }) + mapData.shopArea[i].type = "promotion"; + this.addTagLabel(mapData.shopArea[i], {node: mapData.shopArea[i].shopNav, floor: this.floorOrder, build: this.buildOrder }); } - shopData[h].color&& (entColor = shopData[h].color) - shopData[h].formatColor&& (entColor = shopData[h].formatColor) - shopData[h].borderColor &&(borderColor = shopData[h].borderColor) - break } - + shopData[h].color && (entColor = shopData[h].color); + shopData[h].formatColor && (entColor = shopData[h].formatColor); + shopData[h].borderColor && (borderColor = shopData[h].borderColor); + break; + } } } - let hollShop = [] + let hollShop = []; if (mapData.shopArea[i].hollArea) { for (let k = 0; k < mapData.shopArea[i].hollArea.length; k++) { - hollShop.push(Map_QM.util.changeAreaToString(mapData.shopArea[i].hollArea[k])) + hollShop.push(Map_QM.util.changeAreaToString(mapData.shopArea[i].hollArea[k])); } } - let mahc = this.Model_QM.MyModelShape(arr, hollShop, mapData.shopArea[i], entColor, borderColor, 100) - mahc.node = mapData.shopArea[i].shopNav + let mahc = this.Model_QM.MyModelShape(arr,hollShop,mapData.shopArea[i],entColor,borderColor,60 + 100 * this.floorOrder); + mahc.node = mapData.shopArea[i].shopNav; mahc.userData = { + id: mapData.shopArea[i].id, shopData: shopD, xaxis: mapData.shopArea[i].xaxis >> 0, yaxis: mapData.shopArea[i].yaxis >> 0, @@ -4661,260 +6383,261 @@ FloorMap_QM.prototype = { floor: this.floorOrder, build: this.buildOrder, navRecommend: navRecommend, - type: 'shop', - entColor: entColor, - shopNum: mapData.shopArea[i].name, + type: "shop", + houseNumber: mapData.shopArea[i].name, shopName: show, + formatCode: formatCode, logo: logo, - borderColor: borderColor - } - mahc.userData.opacity = mapData.shopArea[i].alphaModle / 100 || 0 - mahc.name = showLeb - mahc.xaxis = mapData.shopArea[i].xaxis >> 0 - mahc.yaxis = mapData.shopArea[i].yaxis >> 0 - this.shopObj.add(mahc) + opacity: mapData.shopArea[i].alphaModle / 100 || 0, + }; + mahc.name = showLeb; + 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) + this.logoUtil.renderIcon(mapData.shopArea[i],mahc,parseInt(mapData.shopArea[i].toHeight) +1 ); } else { //添加文字 - 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) - }) + 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) { - let shopDiv = document.createElement('div') - shopDiv.style.cssText = css_LR - if(window.innerWidth>2000){ - shopDiv.style.height = "20px" - shopDiv.style.fontSize = "18px" - } - shopDiv.innerHTML = Map_QM.util.options.shopStyle == "shopName" ? show : mapData.shopArea[i].name; - shopDiv.dataset.name = show - shopDiv.dataset.nameEn = showE - shopDiv.style.display = "none" - 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 //是否永久显示 - shopLabel.userData.isShow = true - this.labelObj.add(shopLabel) + if (showLeb != "" || some) { + let shopDiv = document.createElement("div"); + shopDiv.style.cssText = css_LR; + if (window.innerWidth > 2000) { + shopDiv.style.fontSize = "18px"; + } + shopDiv.innerHTML =Map_QM.util.options.shopStyle == "shopName" ? show : mapData.shopArea[i].name; + shopDiv.dataset.name = show; + shopDiv.dataset.nameEn = showE; + shopDiv.style.display = "none"; + 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; //是否永久显示 + shopLabel.userData.formatCode = formatCode; + shopLabel.userData.isShow = true; + this.labelObj.add(shopLabel); } } } } }, addTagLabel: function (obj, userData) { - let shopDiv = document.createElement('img') - shopDiv.src = Map_QM.util.beforPath + "static/img/" + obj.type + ".png" - shopDiv.style.zIndex = 200 - shopDiv.style.width = "3.125vw" - let shopLabel = new THREE.CSS2DObject(shopDiv) - shopLabel.userData = userData - shopLabel.userData.mapShow = true //是否永久显示 - shopLabel.userData.isShow = false - shopLabel.userData.type = obj.type - shopLabel.position.set(obj.xaxis >> 0, -1 * obj.yaxis >> 0, Map_QM.util.shopHeight+30) - this.tagObj.add(shopLabel) - }, + let shopDiv = document.createElement("img"); + shopDiv.src = Map_QM.util.beforPath + "static/img/" + obj.type + ".png"; + shopDiv.style.zIndex = 30; + shopDiv.style.width = "3.125vw"; + let shopLabel = new THREE.CSS2DObject(shopDiv); + shopLabel.userData = userData; + shopLabel.userData.mapShow = true; //是否永久显示 + shopLabel.userData.isShow = false; + shopLabel.userData.type = obj.type; + shopLabel.position.set(obj.xaxis >> 0, (-1 * obj.yaxis) >> 0, Map_QM.util.shopHeight + 30); + this.tagObj.add(shopLabel); + }, //初始化服务图标 initFacilitie: function () { - let serArr = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData.icons + let serArr = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData.icons; for (let i = 0; i < serArr.length; i++) { - if (serArr[i].hasOwnProperty('iShow')) { + if (serArr[i].hasOwnProperty("iShow")) { if (serArr[i].iShow) { - serArr[i].floorOrder = this.floorOrder - serArr[i].buildOrder = this.buildOrder - this.facUtil.renderIcon(serArr[i], this) + serArr[i].floorOrder = this.floorOrder; + serArr[i].buildOrder = this.buildOrder; + this.facUtil.renderIcon(serArr[i], this); } } else { - serArr[i].floorOrder = this.floorOrder - serArr[i].buildOrder = this.buildOrder - this.facUtil.renderIcon(serArr[i], this) + serArr[i].floorOrder = this.floorOrder; + serArr[i].buildOrder = this.buildOrder; + this.facUtil.renderIcon(serArr[i], this); } } }, //初始化电梯图标 initStairs: function () { - let facArr = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData.stairs + let facArr = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData.stairs; for (let i = 0; i < facArr.length; i++) { - if (facArr[i].facCode == 'ft') { - if (Map_QM.util.pathStateObj.elevatorDown && Map_QM.util.pathStateObj.elevator) { + if (facArr[i].facCode == "ft") { + if (Map_QM.util.pathStateObj.elevatorDown && Map_QM.util.pathStateObj.elevator && Map_QM.util.options.modelIcon) { if (facArr[i].downState) { //上扶梯 - let ex = Map_QM.util.pathStateObj.elevator.clone() - ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0) - ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180 - ex.userData.type = 'icon' - ex.userData.use = '3d' - ex.userData.name = 'upft' - ex.userData.buildOrder = facArr[i].buildOrder - ex.userData.floorOrder = facArr[i].floorOrder - ex.userData.navCode = facArr[i].navCode - ex.userData.src = 'static/img/ft.png' - ex.userData.facCode = facArr[i].facCode - ex.userData.title = facArr[i].title - this.serObj.add(ex) - facArr[i].facCode = 'ft' - this.facUtil.renderIcon(facArr[i], this, false, ex) + let ex = Map_QM.util.pathStateObj.elevator.clone(); + ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0); + ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180; + ex.userData.type = "icon"; + ex.userData.use = "3d"; + ex.userData.name = "upft"; + ex.userData.buildOrder = facArr[i].buildOrder; + ex.userData.floorOrder = facArr[i].floorOrder; + ex.userData.navCode = facArr[i].navCode; + ex.userData.src = "static/img/ft.png"; + ex.userData.facCode = facArr[i].facCode; + ex.userData.title = facArr[i].title; + this.serObj.add(ex); + facArr[i].facCode = "ft"; + this.facUtil.renderIcon(facArr[i], this, false, ex); } else if (facArr[i].upState) { //下扶梯 - let ex = Map_QM.util.pathStateObj.elevatorDown.clone() - ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0) - ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180 - ex.userData.type = 'icon' - ex.userData.use = '3d' - ex.userData.name = 'downft' - ex.userData.buildOrder = facArr[i].buildOrder - ex.userData.floorOrder = facArr[i].floorOrder - ex.userData.navCode = facArr[i].navCode - ex.userData.src = 'static/img/ft.png' - ex.userData.facCode = facArr[i].facCode - ex.userData.title = facArr[i].title - this.serObj.add(ex) - facArr[i].facCode = 'ft' - this.facUtil.renderIcon(facArr[i], this, false, ex) + let ex = Map_QM.util.pathStateObj.elevatorDown.clone(); + ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0); + ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180; + ex.userData.type = "icon"; + ex.userData.use = "3d"; + ex.userData.name = "downft"; + ex.userData.buildOrder = facArr[i].buildOrder; + ex.userData.floorOrder = facArr[i].floorOrder; + ex.userData.navCode = facArr[i].navCode; + ex.userData.src = "static/img/ft.png"; + ex.userData.facCode = facArr[i].facCode; + ex.userData.title = facArr[i].title; + this.serObj.add(ex); + facArr[i].facCode = "ft"; + this.facUtil.renderIcon(facArr[i], this, false, ex); } else { - this.facUtil.renderIcon(facArr[i], this, true) + this.facUtil.renderIcon(facArr[i], this, true); } } else { - this.facUtil.renderIcon(facArr[i], this, true) + this.facUtil.renderIcon(facArr[i], this, true); } - } else if (facArr[i].facCode == 'upft') { - if (Map_QM.util.pathStateObj.elevator) { - let ex = Map_QM.util.pathStateObj.elevator.clone() - ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0) - ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180 - ex.userData.type = 'icon' - ex.userData.use = '3d' - ex.userData.name = 'upft' - ex.userData.buildOrder = facArr[i].buildOrder - ex.userData.floorOrder = facArr[i].floorOrder - ex.userData.navCode = facArr[i].navCode - ex.userData.src = 'static/img/ft.png' - ex.userData.facCode = facArr[i].facCode - ex.userData.title = facArr[i].title - this.serObj.add(ex) - facArr[i].facCode = 'ft' - this.facUtil.renderIcon(facArr[i], this, false, ex) + } else if (facArr[i].facCode == "upft") { + if (Map_QM.util.pathStateObj.elevator && Map_QM.util.options.modelIcon) { + let ex = Map_QM.util.pathStateObj.elevator.clone(); + ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0); + ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180; + ex.userData.type = "icon"; + ex.userData.use = "3d"; + ex.userData.name = "upft"; + ex.userData.buildOrder = facArr[i].buildOrder; + ex.userData.floorOrder = facArr[i].floorOrder; + ex.userData.navCode = facArr[i].navCode; + ex.userData.src = "static/img/ft.png"; + ex.userData.facCode = facArr[i].facCode; + ex.userData.title = facArr[i].title; + this.serObj.add(ex); + facArr[i].facCode = "ft"; + this.facUtil.renderIcon(facArr[i], this, false, ex); } else { - facArr[i].facCode = 'ft' - this.facUtil.renderIcon(facArr[i], this, true) + facArr[i].facCode = "ft"; + this.facUtil.renderIcon(facArr[i], this, true); } - } else if (facArr[i].facCode == 'downft') { - if (Map_QM.util.pathStateObj.elevatorDown) { - let ex = Map_QM.util.pathStateObj.elevatorDown.clone() - ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0) - ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180 - ex.userData.type = 'icon' - ex.userData.use = '3d' - ex.userData.name = 'downft' - ex.userData.buildOrder = facArr[i].buildOrder - ex.userData.floorOrder = facArr[i].floorOrder - ex.userData.navCode = facArr[i].navCode - ex.userData.src = 'static/img/ft.png' - ex.userData.facCode = facArr[i].facCode - ex.userData.title = facArr[i].title - this.serObj.add(ex) - facArr[i].facCode = 'ft' - this.facUtil.renderIcon(facArr[i], this, false, ex) + } else if (facArr[i].facCode == "downft") { + if (Map_QM.util.pathStateObj.elevatorDown && Map_QM.util.options.modelIcon) { + let ex = Map_QM.util.pathStateObj.elevatorDown.clone(); + ex.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0); + ex.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180; + ex.userData.type = "icon"; + ex.userData.use = "3d"; + ex.userData.name = "downft"; + ex.userData.buildOrder = facArr[i].buildOrder; + ex.userData.floorOrder = facArr[i].floorOrder; + ex.userData.navCode = facArr[i].navCode; + ex.userData.src = "static/img/ft.png"; + ex.userData.facCode = facArr[i].facCode; + ex.userData.title = facArr[i].title; + this.serObj.add(ex); + facArr[i].facCode = "ft"; + this.facUtil.renderIcon(facArr[i], this, false, ex); } else { - facArr[i].facCode = 'ft' - this.facUtil.renderIcon(facArr[i], this, true) + facArr[i].facCode = "ft"; + this.facUtil.renderIcon(facArr[i], this, true); } - } else if (facArr[i].facCode == 'dt') { - if (Map_QM.util.pathStateObj.straight) { - let stra = Map_QM.util.pathStateObj.straight.clone() - stra.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0) - stra.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180 - stra.userData.type = 'icon' - stra.userData.use = '3d' - stra.userData.name = 'dt' - stra.userData.buildOrder = facArr[i].buildOrder - stra.userData.floorOrder = facArr[i].floorOrder - stra.userData.navCode = facArr[i].navCode - stra.userData.src = 'static/img/dt.png' - stra.userData.facCode = facArr[i].facCode - stra.userData.title = facArr[i].title - this.serObj.add(stra) - this.facUtil.renderIcon(facArr[i], this, false, stra) + } else if (facArr[i].facCode == "dt") { + if (Map_QM.util.pathStateObj.straight && Map_QM.util.options.modelIcon) { + let stra = Map_QM.util.pathStateObj.straight.clone(); + stra.position.set(facArr[i].x, -1 * facArr[i].y, facArr[i].site || 0); + stra.rotation.y = ((facArr[i].angle || 0) * Math.PI) / -180; + stra.userData.type = "icon"; + stra.userData.use = "3d"; + stra.userData.name = "dt"; + stra.userData.buildOrder = facArr[i].buildOrder; + stra.userData.floorOrder = facArr[i].floorOrder; + stra.userData.navCode = facArr[i].navCode; + stra.userData.src = "static/img/dt.png"; + stra.userData.facCode = facArr[i].facCode; + stra.userData.title = facArr[i].title; + this.serObj.add(stra); + this.facUtil.renderIcon(facArr[i], this, false, stra); } else { - this.facUtil.renderIcon(facArr[i], this, true) + this.facUtil.renderIcon(facArr[i], this, true); } } else { - this.facUtil.renderIcon(facArr[i], this, true) + this.facUtil.renderIcon(facArr[i], this, true); } } }, //初始化装饰图标 initDecos: function () { - let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData - let sLen = mapData.decos.length - let entColor, borderColor + let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData; + let sLen = mapData.decos.length; + let entColor, borderColor; + if (mapData.groupArea) { for (let k = 0; k < mapData.groupArea.length; k++) { - var gp = new THREE.Group() - gp.rotateX((mapData.groupArea[k].angleX * Math.PI) / 180) - gp.rotateY((mapData.groupArea[k].angleY * Math.PI) / 180) - gp.rotateZ((mapData.groupArea[k].angleZ * Math.PI) / 180) + var gp = new THREE.Group(); + gp.rotateX((mapData.groupArea[k].angleX * Math.PI) / 180); + gp.rotateY((mapData.groupArea[k].angleY * Math.PI) / 180); + gp.rotateZ((mapData.groupArea[k].angleZ * Math.PI) / 180); for (let i = 0; i < sLen; i++) { - if (mapData.decos[i].gid && mapData.decos[i].gid == mapData.groupArea[k]._name && Map_QM.util.changeAreaToString(mapData.decos[i]) != '') { - let arr = Map_QM.util.changeAreaToString(mapData.decos[i]) - entColor = mapData.decos[i].entColor - borderColor = mapData.decos[i].borderColor - let show = mapData.decos[i].name == 'deco' ? '' : mapData.decos[i].name - let hollShop = [] + let arr = Map_QM.util.changeAreaToString(mapData.decos[i]); + if (mapData.decos[i].gid && mapData.decos[i].gid == mapData.groupArea[k].name && arr.length > 0) { + entColor = mapData.decos[i].entColor; + borderColor = mapData.decos[i].borderColor; + let show = mapData.decos[i].name == "deco" ? "" : mapData.decos[i].name; + let hollShop = []; if (mapData.decos[i].hollArea) { for (let k = 0; k < mapData.decos[i].hollArea.length; k++) { - hollShop.push(Map_QM.util.changeAreaToString(mapData.decos[i].hollArea[k])) + hollShop.push(Map_QM.util.changeAreaToString(mapData.decos[i].hollArea[k])); } } - let mahc = this.Model_QM.MyModelShape(arr, hollShop, mapData.decos[i], entColor, borderColor, 240) - mahc.xaxis = mapData.decos[i].xaxis >> 0 - mahc.yaxis = mapData.decos[i].yaxis >> 0 - mahc.node = mapData.decos[i].shopNav + let mahc = this.Model_QM.MyModelShape(arr,hollShop,mapData.decos[i],entColor,borderColor,70 + 100 * this.floorOrder); + mahc.xaxis = mapData.decos[i].xaxis >> 0; + mahc.yaxis = mapData.decos[i].yaxis >> 0; + mahc.node = mapData.decos[i].shopNav; mahc.userData = { - type: 'deco', - name: show - } - mahc.userData.opacity = mapData.decos[i].alphaModle / 100 || 0 - gp.add(mahc) - mahc.position.x = -1 * mapData.groupArea[k].xaxis - mahc.position.y = mapData.groupArea[k].yaxis + type: "deco", + name: show, + }; + mahc.userData.opacity = mapData.decos[i].alphaModle / 100 || 0; + gp.add(mahc); + mahc.position.x = -1 * mapData.groupArea[k].xaxis; + mahc.position.y = mapData.groupArea[k].yaxis; } } - this.allObj.add(gp) - gp.position.x = mapData.groupArea[k].xaxis - gp.position.y = -1 * mapData.groupArea[k].yaxis - gp.position.z = mapData.groupArea[k].site || 0 - gp.scale.set(mapData.groupArea[k].scale, mapData.groupArea[k].scale, mapData.groupArea[k].scale) + this.allObj.add(gp); + gp.position.x = mapData.groupArea[k].xaxis; + gp.position.y = -1 * mapData.groupArea[k].yaxis; + gp.position.z = mapData.groupArea[k].site || 0; + gp.scale.set(mapData.groupArea[k].scale,mapData.groupArea[k].scale,mapData.groupArea[k].scale); } } for (let i = 0; i < sLen; i++) { - let arr = Map_QM.util.changeAreaToString(mapData.decos[i]) - if (!mapData.decos[i].gid && arr.length>0) { - entColor = mapData.decos[i].entColor - borderColor = mapData.decos[i].borderColor - let show = mapData.decos[i].name == 'deco' ? '' : mapData.decos[i].name - let hollShop = [] + let arr = Map_QM.util.changeAreaToString(mapData.decos[i]); + if (!mapData.decos[i].gid && arr.length > 0) { + entColor = mapData.decos[i].entColor; + borderColor = mapData.decos[i].borderColor; + let show = mapData.decos[i].name == "deco" ? "" : mapData.decos[i].name; + let hollShop = []; if (mapData.decos[i].hollArea) { for (let k = 0; k < mapData.decos[i].hollArea.length; k++) { - hollShop.push(Map_QM.util.changeAreaToString(mapData.decos[i].hollArea[k])) + hollShop.push(Map_QM.util.changeAreaToString(mapData.decos[i].hollArea[k])); } } - let mahc = this.Model_QM.MyModelShape(arr, hollShop, mapData.decos[i], entColor, borderColor, 70 + 100 * this.floorOrder); + let mahc; + mahc = this.Model_QM.MyModelShape(arr,hollShop,mapData.decos[i],entColor,borderColor,70 + 100 * this.floorOrder ); mahc.userData = { - "type": "deco", - "node": mapData.decos[i].shopNav, - "xaxis": mapData.decos[i].xaxis, - "yaxis": mapData.decos[i].yaxis, - "houseNumber": mahc.name, - "name": show - }; - this.allObj.add(mahc) + type: "deco", + node: mapData.decos[i].shopNav, + xaxis: mapData.decos[i].xaxis, + yaxis: mapData.decos[i].yaxis, + houseNumber: mahc.name, + name: show, + }; + this.allObj.add(mahc); } } }, @@ -4922,25 +6645,18 @@ FloorMap_QM.prototype = { * 渲染墙体 */ initWall: function () { - let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData + let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData; //渲染 if (mapData.wallArea) { - let sLen = mapData.wallArea.length + let sLen = mapData.wallArea.length; for (let i = 0; i < sLen; i++) { - let arr = Map_QM.util.changeWallToString(mapData.wallArea[i]) - let mahc = this.Model_QM.MyModelShape( - arr, - null, - mapData.wallArea[i], - mapData.wallArea[i].entColor || '#eaeaea', - mapData.wallArea[i].borderColor || '#eaeaea', - 300 - ) + let arr = Map_QM.util.changeWallToString(mapData.wallArea[i]); + let mahc = this.Model_QM.MyModelShape(arr, null, mapData.wallArea[i], mapData.wallArea[i].entColor || "#eaeaea", mapData.wallArea[i].borderColor || "#eaeaea", 300); mahc.userData = { - type: 'wall' - } - mahc.userData.opacity = mapData.wallArea[i].alphaModle / 100 || 0 - this.allObj.add(mahc) + type: "wall", + }; + mahc.userData.opacity = mapData.wallArea[i].alphaModle / 100 || 0; + this.allObj.add(mahc); } } }, @@ -4948,280 +6664,295 @@ FloorMap_QM.prototype = { * 渲染文本 */ initTextArea: function () { - let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData + let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData; //渲染 if (mapData.svgArea) { - let sLen = mapData.svgArea.length + let sLen = mapData.svgArea.length; for (let i = 0; i < sLen; i++) { - let mahc = this.Model_QM.MyModelText(mapData.svgArea[i]) + let mahc = this.Model_QM.MyModelText(mapData.svgArea[i]); mahc.userData = { - type: 'svg', + type: "svg", rot: mahc.rotation.z, - shopNum: mapData.svgArea[i].name - } - this.svgObj.add(mahc) + houseNumber: mapData.svgArea[i].name, + }; + this.svgObj.add(mahc); } } }, /** * 设置终点图标 */ - setOverSite: function (shopX, shopY, shopZ) { - if (Map_QM.endModel) { - Map_QM.endModel.visible = pathCameraState == "2D" ? false : true; - Map_QM.endModel.scale.x = Map_QM.endModel.scale.y = Map_QM.endModel.scale.z = 100; - Map_QM.endModel.position.set(shopX, shopZ, shopY); //x,z,y - Map_QM.endModel.applyMatrix4(Map_QM.sceneGap.matrix); - if (Map_QM.endIcon) { - Map_QM.endIcon.visible = pathCameraState == "2D" ? true : false; - Map_QM.endIcon.scale.x = 100; - Map_QM.endIcon.scale.y = 120; - Map_QM.endIcon.position.set(shopX, 100, shopY); //x,z,y - Map_QM.endIcon.applyMatrix4(Map_QM.sceneGap.matrix); - } - } else { - try { - Map_QM.scene.traverse(item => { - if (item.name == "Z-model") { - Map_QM.scene.remove(item); - } - }); - } catch (e) { - console.log("traverse") - } - - let loader2 = new THREE.GLTFLoader(); - loader2.load(Map_QM.util.beforPath + "static/img/zhong.glb", function (collada2) { - collada2.scene.scale.x = collada2.scene.scale.y = collada2.scene.scale.z = 100; - if (shopX != 0 && shopY != 0) { - collada2.scene.position.set(shopX, shopZ, shopY); //x,z,y - } - collada2.scene.applyMatrix4(Map_QM.sceneGap.matrix); - collada2.scene.renderOrder = 200; - collada2.scene.traverse(function (child) { - if (child.type === "Mesh") { - child.castShadow = Map_QM.util.options.shadow; - child.receiveShadow = Map_QM.util.options.shadow; - if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 - } - } - }); - for (let k = 0; k < collada2.animations.length; k++) { - let mixer = new THREE.AnimationMixer(collada2.scene) - mixer.clipAction(collada2.animations[k]).play() - Map_QM.mixers.push(mixer) - } - collada2.scene.name = "Z-model"; - Map_QM.endModel = collada2.scene; - Map_QM.scene.add(collada2.scene); - Map_QM.endModel.visible = pathCameraState == "2D" ? false : true; - }); - let spriteMap = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/Z.png"); - let spriteMaterial = new THREE.SpriteMaterial({ //sizeAttenuation: false 禁止跟随鼠标缩放 - map: spriteMap, - depthTest: true, - transparent: true, - alphaTest: 0.5 - }); - Map_QM.endIcon = new MySprite_QM(spriteMaterial); - Map_QM.endIcon.scale.set(100, 120, 1); - Map_QM.endIcon.center = new THREE.Vector2(0.5, 0); - Map_QM.endIcon.position.set(shopX, 100, shopY); - Map_QM.endIcon.applyMatrix4(Map_QM.sceneGap.matrix); - Map_QM.endIcon.renderOrder = 300; - Map_QM.endIcon.name = "Z-model"; - Map_QM.endIcon.visible = pathCameraState == "2D" ? true : false; - Map_QM.scene.add(Map_QM.endIcon); - } - }, + setOverSite: function (shopX, shopY, shopZ) { + if (Map_QM.endModel) { + Map_QM.endModel.visible = pathCameraState == "2D" ? false : true; + Map_QM.endModel.scale.x = Map_QM.endModel.scale.y = Map_QM.endModel.scale.z = 100; + Map_QM.endModel.position.set(shopX, shopZ, shopY); //x,z,y + Map_QM.endModel.applyMatrix4(Map_QM.sceneGap.matrix); + if (Map_QM.endIcon) { + Map_QM.endIcon.visible = pathCameraState == "2D" ? true : false; + Map_QM.endIcon.scale.x = 100; + Map_QM.endIcon.scale.y = 120; + Map_QM.endIcon.position.set(shopX, 100, shopY); //x,z,y + Map_QM.endIcon.applyMatrix4(Map_QM.sceneGap.matrix); + } + } else { + try { + Map_QM.scene.traverse((item) => { + if (item.name == "Z-model") { + Map_QM.scene.remove(item); + } + }); + } catch (e) { + window.captureException && window.captureException(e); + console.log("traverse"); + } + + let loader2 = new THREE.GLTFLoader(); + loader2.load( + Map_QM.util.beforPath + "static/img/zhong.glb", + function (collada2) { + collada2.scene.scale.x = collada2.scene.scale.y = collada2.scene.scale.z = 100; + if (shopX != 0 && shopY != 0) { + collada2.scene.position.set(shopX, shopZ, shopY); //x,z,y + } + collada2.scene.applyMatrix4(Map_QM.sceneGap.matrix); + collada2.scene.renderOrder = 200; + collada2.scene.traverse(function (child) { + if (child.type === "Mesh") { + child.castShadow = Map_QM.util.options.shadow; + child.receiveShadow = Map_QM.util.options.shadow; + if (child.material.map) { + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 + } + } + }); + for (let k = 0; k < collada2.animations.length; k++) { + let mixer = new THREE.AnimationMixer(collada2.scene); + mixer.clipAction(collada2.animations[k]).play(); + Map_QM.mixers.push(mixer); + } + collada2.scene.name = "Z-model"; + Map_QM.endModel = collada2.scene; + Map_QM.scene.add(collada2.scene); + Map_QM.endModel.visible = pathCameraState == "2D" ? false : true; + } + ); + let spriteMap = new THREE.TextureLoader().load( + Map_QM.util.beforPath + "static/img/Z.png" + ); + let spriteMaterial = new THREE.SpriteMaterial({ + //sizeAttenuation: false 禁止跟随鼠标缩放 + map: spriteMap, + depthTest: true, + transparent: true, + alphaTest: 0.5, + }); + Map_QM.endIcon = new MySprite_QM(spriteMaterial); + Map_QM.endIcon.scale.set(100, 120, 1); + Map_QM.endIcon.center = new THREE.Vector2(0.5, 0); + Map_QM.endIcon.position.set(shopX, 100, shopY); + Map_QM.endIcon.applyMatrix4(Map_QM.sceneGap.matrix); + Map_QM.endIcon.renderOrder = 300; + Map_QM.endIcon.name = "Z-model"; + Map_QM.endIcon.visible = pathCameraState == "2D" ? true : false; + Map_QM.scene.add(Map_QM.endIcon); + } + }, /** * 设置起点图标 */ - setStartSite: function (shopX, shopY, shopZ) { - let _this = this; - if (Map_QM.devModel) { - Map_QM.devModel.position.set(shopX, -1 * shopY,50); - _this.allObj.add(Map_QM.devModel) - Map_QM.qiModel.position.set(shopX, -1 * shopY,10); - _this.allObj.add(Map_QM.qiModel) - Map_QM.qiIcon.position.set(shopX, -1 * shopY, shopZ); - _this.allObj.add(Map_QM.qiIcon) - } else { - new THREE.GLTFLoader().load(Map_QM.util.beforPath + "static/img/guide.glb", function (obj) { - obj.scene.scale.x = obj.scene.scale.y = obj.scene.scale.z = 100; - obj.scene.rotation.x = Math.PI / 2; - obj.scene.rotation.y = Map_QM.util.deviceObj.angle*Math.PI/-180; - obj.scene.traverse(function (child) { - if (child.type === "Mesh") { - child.castShadow = Map_QM.util.options.shadow; - child.receiveShadow = Map_QM.util.options.shadow; - if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 - } - } - }); - if (shopX != 0 && shopY != 0) { - obj.scene.position.set(shopX, -1 * shopY, 50); //x,z,y - } - for (let k = 0; k < obj.animations.length; k++) { - let mixer = new THREE.AnimationMixer(obj.scene) - mixer.clipAction(obj.animations[k]).play() - Map_QM.mixers.push(mixer) - } - Map_QM.devModel = obj.scene; - Map_QM.devModel.renderOrder = 160; - _this.allObj.add(Map_QM.devModel); - }); - - new THREE.GLTFLoader().load(Map_QM.util.beforPath + "static/img/qi.glb", function (collada) { - collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = 100; - collada.scene.rotateX(Math.PI / 2); - collada.scene.visible =false; - collada.scene.traverse(function (child) { - if (child.type === "Mesh") { - child.castShadow = Map_QM.util.options.shadow; - child.receiveShadow = Map_QM.util.options.shadow; - if (child.material.map) { - child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 - } - } - }); - if (shopX != 0 && shopY != 0) { - collada.scene.position.set(shopX, -1 * shopY, parseInt(Map_QM.util.buildHeight) + 5); //x,z,y - } - for (let k = 0; k < collada.animations.length; k++) { - let mixer = new THREE.AnimationMixer(collada.scene) - mixer.clipAction(collada.animations[k]).play() - Map_QM.mixers.push(mixer) - } - collada.scene.renderOrder = 200; - collada.scene.userData.type = "start"; - Map_QM.qiModel = collada.scene; - _this.allObj.add(collada.scene); - //-------------------------------------------------------------- - let spriteMap = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/Q.png"); - let spriteMaterial = new THREE.SpriteMaterial({ //sizeAttenuation: false 禁止跟随鼠标缩放 - map: spriteMap, - depthTest: true, - transparent: true, - alphaTest: 0.5 - }); - Map_QM.qiIcon = new MySprite_QM(spriteMaterial); - Map_QM.qiIcon.scale.set(100, 120, 1); - Map_QM.qiIcon.center = new THREE.Vector2(0.5, 0); - Map_QM.qiIcon.position.set(shopX, -1 * shopY, shopZ + 50); - Map_QM.qiIcon.renderOrder = 500; - Map_QM.qiIcon.visible = false; - Map_QM.qiIcon.userData.type = "start"; - _this.allObj.add(Map_QM.qiIcon); - - - }); - } - }, + setStartSite: function (shopX, shopY, shopZ) { + let _this = this; + if (Map_QM.qiModel) { + Map_QM.devModel.position.set(shopX, -1 * shopY, 20); + _this.allObj.add(Map_QM.devModel); + Map_QM.qiModel.position.set(shopX, -1 * shopY, 10); + _this.allObj.add(Map_QM.qiModel); + Map_QM.qiIcon.position.set(shopX, -1 * shopY, shopZ); + _this.allObj.add(Map_QM.qiIcon); + } else { + new THREE.GLTFLoader().load( + Map_QM.util.beforPath + "static/img/guide.glb", + function (obj) { + obj.scene.scale.x = obj.scene.scale.y = obj.scene.scale.z = 100; + obj.scene.rotation.x = Math.PI / 2; + obj.scene.rotation.y = (Map_QM.util.deviceObj.angle * Math.PI) / -180; + obj.scene.traverse(function (child) { + if (child.type === "Mesh") { + child.castShadow = Map_QM.util.options.shadow; + child.receiveShadow = Map_QM.util.options.shadow; + if (child.material.map) { + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 + } + } + }); + if (shopX != 0 && shopY != 0) { + obj.scene.position.set(shopX, -1 * shopY, 50); //x,z,y + } + for (let k = 0; k < obj.animations.length; k++) { + let mixer = new THREE.AnimationMixer(obj.scene); + mixer.clipAction(obj.animations[k]).play(); + Map_QM.mixers.push(mixer); + } + Map_QM.devModel = obj.scene; + Map_QM.devModel.visible = false; + Map_QM.devModel.renderOrder = 160; + _this.allObj.add(Map_QM.devModel); + } + ); + new THREE.GLTFLoader().load( + Map_QM.util.beforPath + "static/img/qi.glb", + function (collada) { + collada.scene.scale.x = collada.scene.scale.y = collada.scene.scale.z = 100; + collada.scene.rotateX(Math.PI / 2); + collada.scene.traverse(function (child) { + if (child.type === "Mesh") { + child.castShadow = Map_QM.util.options.shadow; + child.receiveShadow = Map_QM.util.options.shadow; + if (child.material.map) { + child.material.map.encoding = THREE.LinearEncoding; //贴图需要转换成 线性编码 + } + } + }); + if (shopX != 0 && shopY != 0) { + collada.scene.position.set( shopX, -1 * shopY, parseInt(Map_QM.util.buildHeight) + 5); //x,z,y + } + for (let k = 0; k < collada.animations.length; k++) { + let mixer = new THREE.AnimationMixer(collada.scene); + mixer.clipAction(collada.animations[k]).play(); + Map_QM.mixers.push(mixer); + } + collada.scene.renderOrder = 200; + collada.scene.userData.type = "start"; + Map_QM.qiModel = collada.scene; + _this.allObj.add(collada.scene); + //-------------------------------------------------------------- + let spriteMap = new THREE.TextureLoader().load( + Map_QM.util.beforPath + "static/img/Q.png" + ); + let spriteMaterial = new THREE.SpriteMaterial({ + //sizeAttenuation: false 禁止跟随鼠标缩放 + map: spriteMap, + depthTest: true, + transparent: true, + alphaTest: 0.5, + }); + Map_QM.qiIcon = new MySprite_QM(spriteMaterial); + Map_QM.qiIcon.scale.set(100, 120, 1); + Map_QM.qiIcon.center = new THREE.Vector2(0.5, 0); + Map_QM.qiIcon.position.set(shopX, -1 * shopY, shopZ + 50); + Map_QM.qiIcon.renderOrder = 500; + Map_QM.qiIcon.visible = false; + Map_QM.qiIcon.userData.type = "start"; + _this.allObj.add(Map_QM.qiIcon); + } + ); + } + }, /** * 查找线 * @param {Object} startNode * @param {Object} endNode */ isNoFindLine: function (startNode, endNode) { - let no = false + let no = false; for (let i = 0; i < startNode.lineArr.length; i++) { - if (startNode.lineArr[i].nextNode.id == endNode.id || startNode.lineArr[i].selfNode.id == endNode.id) { - no = true - break + if (startNode.lineArr[i].nextNode.id == endNode.id ||startNode.lineArr[i].selfNode.id == endNode.id) { + no = true; + break; } } - return no + return no; }, //初始化停车位 - initPark: function () { - let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData; - //渲染车位 - if (mapData.parkArea) { - let sLen = mapData.parkArea.length; - if (sLen > 0) { - this.allObj.add(this.parkObj); - } - let shapeArr = [], materials = [], parkHeight = 1, borderColor = 0xaaaaaa; - for (let i = 0; i < sLen; i++) { - let arr = Map_QM.util.changeParkToString(mapData.parkArea[i]); - if (arr != "") { - parkHeight = Math.max(parseInt(mapData.parkArea[i].toHeight), parkHeight); - borderColor = mapData.parkArea[i].borderColor; - if (arr.length > 0) { - let shape = new THREE.Shape(); - shape.moveTo(arr[0][0], -1 * arr[0][1]); - for (let k = 1; k < arr.length; k++) { - shape.lineTo(arr[k][0], -1 * arr[k][1]); - } - shapeArr.push(shape); - let meshMaterial; - let color2 = new THREE.Color(mapData.parkArea[i].entColor); - for (let e = 0; e < Map_QM.util.parkMaterialArr.length; e++) { - if (Map_QM.util.parkMaterialArr[e].color.equals(color2)) { - meshMaterial = Map_QM.util.parkMaterialArr[e]; - } - } - if (!meshMaterial) { - meshMaterial = new THREE.MeshBasicMaterial({ - color: mapData.parkArea[i].entColor - }); - Map_QM.util.parkMaterialArr.push(meshMaterial); - } - materials.push(meshMaterial); - if (mapData.parkArea[i].childArea && mapData.parkArea[i].childArea.length > 0) { - for (let m = 0; m < mapData.parkArea[i].childArea.length; m++) { - let meshMaterial0; - if (mapData.parkArea[i].childArea[m].color && mapData.parkArea[i].childArea[m].color != "#FFffff") { - let color2 = new THREE.Color(mapData.parkArea[i].childArea[m].color); - for (let e = 0; e < Map_QM.util.parkMaterialArr.length; e++) { - if (Map_QM.util.parkMaterialArr[e].color.equals(color2)) { - meshMaterial0 = Map_QM.util.parkMaterialArr[e]; - } - } - if (!meshMaterial0) { - meshMaterial0 = new THREE.MeshBasicMaterial({ - color: mapData.parkArea[i].childArea[m].color - }); - Map_QM.util.parkMaterialArr.push(meshMaterial0); - } - } else { - meshMaterial0 = meshMaterial; - } - let ps = mapData.parkArea[i].childArea[m].points; - let shape0 = new THREE.Shape(); - // 设置开始点的位置 - shape0.moveTo(ps[0].x, -1 * ps[0].y); - for (let t = 0; t < ps.length; t++) { - shape0.lineTo(ps[t].x, -1 * ps[t].y); - } - shapeArr.push(shape0); - materials.push(meshMaterial0); - } - } - - } - //显示车位编号 - if (mapData.parkArea[i].parkNum != "NaN" && i % 10 == 0) { - let shopDiv = document.createElement('div'); - shopDiv.style.cssText = css_LR - shopDiv.style.display = "none"; - shopDiv.textContent = mapData.parkArea[i].parkNum; - let shopLabel = new THREE.CSS2DObject(shopDiv); - shopLabel.userData.mapShow = true; //是否永久显示 - shopLabel.name = mapData.parkArea[i].name; - shopLabel.position.set(mapData.parkArea[i].xaxis >> 0, -1 * mapData.parkArea[i].yaxis >> 0, parseInt(mapData.parkArea[i].toHeight) + 1); - this.labelObj.add(shopLabel); - } - } - } - let mahc = this.Model_QM.MyParkShape(shapeArr, materials, parkHeight); - this.parkObj.add(mahc); - } - } -} + initPark: function () { + let mapData = Map_QM.util.allMap[this.buildOrder].buildArr[this.floorOrder].mapData; + //渲染车位 + if (mapData.parkArea) { + let sLen = mapData.parkArea.length; + if (sLen > 0) { + this.allObj.add(this.parkObj); + } + let shapeArr = [], + materials = [], + parkHeight = 1, + borderColor = 0xaaaaaa; + for (let i = 0; i < sLen; i++) { + let arr = Map_QM.util.changeParkToString(mapData.parkArea[i]); + if (arr != "") { + parkHeight = Math.max(parseInt(mapData.parkArea[i].toHeight), parkHeight); + borderColor = mapData.parkArea[i].borderColor; + if (arr.length > 0) { + let shape = new THREE.Shape(); + shape.moveTo(arr[0][0], -1 * arr[0][1]); + for (let k = 1; k < arr.length; k++) { + shape.lineTo(arr[k][0], -1 * arr[k][1]); + } + shapeArr.push(shape); + let meshMaterial; + let color2 = new THREE.Color(mapData.parkArea[i].entColor); + for (let e = 0; e < Map_QM.util.parkMaterialArr.length; e++) { + if (Map_QM.util.parkMaterialArr[e].color.equals(color2)) { + meshMaterial = Map_QM.util.parkMaterialArr[e]; + } + } + if (!meshMaterial) { + meshMaterial = new THREE.MeshBasicMaterial({ + color: mapData.parkArea[i].entColor, + }); + Map_QM.util.parkMaterialArr.push(meshMaterial); + } + materials.push(meshMaterial); + if (mapData.parkArea[i].childArea && mapData.parkArea[i].childArea.length > 0) { + for (let m = 0; m < mapData.parkArea[i].childArea.length; m++) { + let meshMaterial0; + if (mapData.parkArea[i].childArea[m].color && mapData.parkArea[i].childArea[m].color != "#FFffff") { + let color2 = new THREE.Color(mapData.parkArea[i].childArea[m].color); + for (let e = 0; e < Map_QM.util.parkMaterialArr.length; e++) { + if (Map_QM.util.parkMaterialArr[e].color.equals(color2)) { + meshMaterial0 = Map_QM.util.parkMaterialArr[e]; + } + } + if (!meshMaterial0) { + meshMaterial0 = new THREE.MeshBasicMaterial({ + color: mapData.parkArea[i].childArea[m].color, + }); + Map_QM.util.parkMaterialArr.push(meshMaterial0); + } + } else { + meshMaterial0 = meshMaterial; + } + let ps = mapData.parkArea[i].childArea[m].points; + let shape0 = new THREE.Shape(); + // 设置开始点的位置 + shape0.moveTo(ps[0].x, -1 * ps[0].y); + for (let t = 0; t < ps.length; t++) { + shape0.lineTo(ps[t].x, -1 * ps[t].y); + } + shapeArr.push(shape0); + materials.push(meshMaterial0); + } + } + } + //显示车位编号 + if (mapData.parkArea[i].parkNum != "NaN" && i % 20 == 0) { + let shopDiv = document.createElement("div"); + shopDiv.style.cssText = css_LR + shopDiv.style.display = "none"; + shopDiv.textContent = mapData.parkArea[i].parkNum; + let shopLabel = new THREE.CSS2DObject(shopDiv); + shopLabel.userData.mapShow = true; //是否永久显示 + shopLabel.name = mapData.parkArea[i].name; + shopLabel.position.set(mapData.parkArea[i].xaxis >> 0,(-1 * mapData.parkArea[i].yaxis) >> 0,parseInt(mapData.parkArea[i].toHeight) + 1); + this.labelObj.add(shopLabel); + } + } + } + let mahc = this.Model_QM.MyParkShape(shapeArr, materials, parkHeight); + this.parkObj.add(mahc); + } + }, +}; /** * 渲染3D模型类 @@ -5230,667 +6961,735 @@ FloorMap_QM.prototype = { * 模型对象 options */ MyModel_QM = function () { - this.xaxis = 0 - this.yaxis = 0 - this.node = 0 -} + this.xaxis = 0; + this.yaxis = 0; + this.node = 0; +}; MyModel_QM.prototype.MyParkShape = function (shapes, materials, toHeight = 5) { - let scanGeometry = new THREE.ShapeBufferGeometry(shapes, 1); - let material = new THREE.LineBasicMaterial({ - color: "#aeaeae" - }); //材质对象lineColor - Map_QM.util.lineBasicMaterialArr.push(material); - - // 创建模型 - let mesh = new THREE.Mesh(scanGeometry, materials); - mesh.position.z = toHeight; - mesh.renderOrder = 300; - mesh.userData.type = "park"; - - let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); - let cubeLine = new THREE.LineSegments(cubeEdges, material); - mesh.add(cubeLine); - return mesh; -} - -MyModel_QM.prototype.MyModelShape = function (areaArr, howllowArr, opObj, entityColor = 0xdadada, lineColor = 0xeeeeee, indexOrder = 1) { - let len = areaArr.length; - if (len == 0) { - return; - } - let alphaModle = opObj.alphaModle / 100 || 0; - // 实例化shape对象 - let shape = new THREE.Shape(); - // 设置开始点的位置 - shape.moveTo(areaArr[0][0], -1 * areaArr[0][1]); - for (let i = 0; i < areaArr.length; i++) { - if (areaArr[i].length == 4) { - shape.lineTo(areaArr[i][2], -1 * areaArr[i][3]); - } else { - shape.bezierCurveTo(areaArr[i][2], -1 * areaArr[i][3], areaArr[i][4], -1 * areaArr[i][5], areaArr[i][6], -1 * areaArr[i][7]); - } - } - let material; - let matcolor = new THREE.Color(lineColor) - for (let k = 0; k < Map_QM.util.lineBasicMaterialArr.length; k++) { - if (Map_QM.util.lineBasicMaterialArr[k].color.equals(matcolor)) { - material = Map_QM.util.lineBasicMaterialArr[k]; - } - } - if (!material) { - material = new THREE.LineBasicMaterial({ - color: lineColor, - opacity: 0.8, - transparent: true - }); //材质对象lineColor - Map_QM.util.lineBasicMaterialArr.push(material); - } - if (howllowArr && howllowArr.length > 0) { - for (let n = 0; n < howllowArr.length; n++) { - let hole = new THREE.Path(); // 添加孔洞 - hole.moveTo(howllowArr[n][0][0], -1 * howllowArr[n][0][1]); - for (let k = 0; k < howllowArr[n].length; k++) { - if (howllowArr[n][k].length == 4) { - hole.lineTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3]); - } else { - hole.bezierCurveTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3], howllowArr[n][k][4], -1 * howllowArr[n][k][5], howllowArr[n][k][6], -1 * howllowArr[n][k][7]); - } - } - shape.holes.push(hole); - } - } - - let scanGeometry, meshMaterial, options = { - depth: parseInt(opObj.toHeight), - bevelEnabled: false, - curveSegments: 12, - bevelThickness: 0, - bevelSize: 0, - bevelSegments: 0, - material: 0, //frontMaterial = green - extrudeMaterial: 1, //sideMaterial = gray - }; + let scanGeometry = new THREE.ShapeBufferGeometry(shapes, 1); + let material = new THREE.LineBasicMaterial({ + color: "#aeaeae", + }); //材质对象lineColor + Map_QM.util.lineBasicMaterialArr.push(material); + + // 创建模型 + let mesh = new THREE.Mesh(scanGeometry, materials); + mesh.position.z = toHeight; + mesh.renderOrder = 300; + mesh.userData.type = "park"; + + let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); + let cubeLine = new THREE.LineSegments(cubeEdges, material); + mesh.add(cubeLine); + return mesh; +}; + +MyModel_QM.prototype.MyModelShape = function (areaArr,howllowArr,opObj,entityColor = 0xdadada,lineColor = 0xeeeeee,indexOrder = 1) { + let len = areaArr.length; + if (len == 0) { + return; + } + let alphaModle = opObj.alphaModle / 100 || 0; + // 实例化shape对象 + let shape = new THREE.Shape(); + // 设置开始点的位置 + shape.moveTo(areaArr[0][0], -1 * areaArr[0][1]); + for (let i = 0; i < areaArr.length; i++) { + if (areaArr[i].length == 4) { + shape.lineTo(areaArr[i][2], -1 * areaArr[i][3]); + } else { + shape.bezierCurveTo(areaArr[i][2], -1 * areaArr[i][3], areaArr[i][4], -1 * areaArr[i][5], areaArr[i][6], -1 * areaArr[i][7]); + } + } + let material; + let matcolor = new THREE.Color(lineColor); + for (let k = 0; k < Map_QM.util.lineBasicMaterialArr.length; k++) { + if (Map_QM.util.lineBasicMaterialArr[k].color.equals(matcolor)) { + material = Map_QM.util.lineBasicMaterialArr[k]; + } + } + if (!material) { + material = new THREE.LineBasicMaterial({ + color: lineColor, + opacity: 0.8, + transparent: true, + }); //材质对象lineColor + Map_QM.util.lineBasicMaterialArr.push(material); + } + if (howllowArr && howllowArr.length > 0) { + for (let n = 0; n < howllowArr.length; n++) { + let hole = new THREE.Path(); // 添加孔洞 + hole.moveTo(howllowArr[n][0][0], -1 * howllowArr[n][0][1]); + for (let k = 0; k < howllowArr[n].length; k++) { + if (howllowArr[n][k].length == 4) { + hole.lineTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3]); + } else { + hole.bezierCurveTo(howllowArr[n][k][2],-1 * howllowArr[n][k][3],howllowArr[n][k][4],-1 * howllowArr[n][k][5],howllowArr[n][k][6],-1 * howllowArr[n][k][7]); + } + } + shape.holes.push(hole); + } + } - scanGeometry = new THREE.ExtrudeGeometry(shape, options); - let meshColor = new THREE.Color(entityColor); - for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { - if (Map_QM.util.meshMaterialArr[e].color && Map_QM.util.meshMaterialArr[e].color.equals(meshColor) && Map_QM.util.meshMaterialArr[e].opacity == alphaModle && !Map_QM.util.meshMaterialArr[e].userData.map) { - meshMaterial = Map_QM.util.meshMaterialArr[e]; - } - } - if (!meshMaterial) { - meshMaterial = new THREE.MeshPhongMaterial({ //MeshStandardMaterial MeshPhongMaterial MeshBasicMaterial - color: entityColor, - transparent: true, - opacity: alphaModle, - side: THREE.DoubleSide, - depthTest: true - }); - Map_QM.util.meshMaterialArr.push(meshMaterial); - } - if (opObj.angleY || opObj.angleZ) { - Map_QM.util.rotateYZ(scanGeometry, opObj.angleY * Math.PI / 180, opObj.angleZ * Math.PI / 180); - } - // 创建模型 - let mesh; - if(opObj.map == "home"){ - Map_QM.util.assignUVs(scanGeometry); - let mapMaterial,ceMaterial; - for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { - if (Map_QM.util.meshMaterialArr[e].userData.map == "front" && Map_QM.util.meshMaterialArr[e].opacity == alphaModle) { - mapMaterial = Map_QM.util.meshMaterialArr[e]; - } - if (Map_QM.util.meshMaterialArr[e].userData.map == "c50" && Map_QM.util.meshMaterialArr[e].opacity == alphaModle) { - ceMaterial = Map_QM.util.meshMaterialArr[e]; - } - } - if(!mapMaterial){ - let texture = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/front.png"); - texture.wrapS = THREE.ClampToEdgeWrapping; - texture.wrapT = THREE.RepeatWrapping; - mapMaterial = new THREE.MeshPhongMaterial({ - color: entityColor, - map: texture, - transparent: true, - opacity: alphaModle, - side: THREE.DoubleSide, - depthTest: true - }); - mapMaterial.userData.map = "front"; - Map_QM.util.meshMaterialArr.push(mapMaterial); - } - if(!ceMaterial){ - let texture2 = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/c50.png"); - texture2.wrapS = THREE.RepeatWrapping; - texture2.wrapT = THREE.ClampToEdgeWrapping; - ceMaterial = new THREE.MeshPhongMaterial({ - color: entityColor, - map: texture2, - transparent: true, - opacity: alphaModle, - side: THREE.DoubleSide, - depthTest: true - }); - ceMaterial.userData.map = "c50"; - Map_QM.util.meshMaterialArr.push(ceMaterial); - } - mesh = new THREE.Mesh(scanGeometry, [meshMaterial,ceMaterial,mapMaterial]); - } else if(opObj.map){ - Map_QM.util.packUv(scanGeometry); - let ceMaterial; - for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { - if (Map_QM.util.meshMaterialArr[e].userData.map == opObj.map && Map_QM.util.meshMaterialArr[e].opacity == alphaModle) { - ceMaterial = Map_QM.util.meshMaterialArr[e]; - } - } - if(!ceMaterial){ - let texture2 = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/"+opObj.map+".png"); - texture2.wrapS = THREE.RepeatWrapping; - texture2.wrapT = THREE.ClampToEdgeWrapping; - ceMaterial = new THREE.MeshPhongMaterial({ - color: entityColor, - map: texture2, - transparent: true, - opacity: alphaModle, - side: THREE.DoubleSide, - depthTest: true - }); - ceMaterial.userData.map = opObj.map; - Map_QM.util.meshMaterialArr.push(ceMaterial); - } - mesh = new THREE.Mesh(scanGeometry, [meshMaterial,ceMaterial]); - }else{ - mesh = new THREE.Mesh(scanGeometry, meshMaterial); - } - - if (opObj.type != "wall") { - let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); - let cubeLine = new THREE.LineSegments(cubeEdges, material); - cubeLine.renderOrder = indexOrder - 5; - mesh.add(cubeLine); - } - if (opObj.name != "floor") { - mesh.position.z = opObj.site || 0; - } else { - mesh.position.z = -1 * parseInt(opObj.toHeight) - 1; - } - mesh.castShadow = true; - mesh.renderOrder = indexOrder; - mesh.name = opObj.name || ""; - return mesh; -} + let scanGeometry, + meshMaterial, + options = { + depth: parseInt(opObj.toHeight), + bevelEnabled: false, + curveSegments: 12, + bevelThickness: 0, + bevelSize: 0, + bevelSegments: 0, + material: 0, //frontMaterial = green + extrudeMaterial: 1, //sideMaterial = gray + }; + + scanGeometry = new THREE.ExtrudeGeometry(shape, options); + let meshColor = new THREE.Color(entityColor); + for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { + if (Map_QM.util.meshMaterialArr[e].color && + Map_QM.util.meshMaterialArr[e].color.equals(meshColor) && + Map_QM.util.meshMaterialArr[e].opacity == alphaModle && + !Map_QM.util.meshMaterialArr[e].userData.map + ) { + meshMaterial = Map_QM.util.meshMaterialArr[e]; + } + } + if (!meshMaterial) { + meshMaterial = new THREE.MeshPhongMaterial({ + //MeshStandardMaterial MeshPhongMaterial MeshBasicMaterial + color: entityColor, + transparent: true, + opacity: alphaModle, + side: THREE.DoubleSide, + depthTest: true, + }); + Map_QM.util.meshMaterialArr.push(meshMaterial); + } + if (opObj.angleY || opObj.angleZ) { + Map_QM.util.rotateYZ(scanGeometry,(opObj.angleY * Math.PI) / 180,(opObj.angleZ * Math.PI) / 180); + } + // 创建模型 + let mesh; + if (opObj.map == "home") { + Map_QM.util.assignUVs(scanGeometry); + let mapMaterial, ceMaterial; + for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { + if (Map_QM.util.meshMaterialArr[e].userData.map == "front" && Map_QM.util.meshMaterialArr[e].opacity == alphaModle) { + mapMaterial = Map_QM.util.meshMaterialArr[e]; + } + if (Map_QM.util.meshMaterialArr[e].userData.map == "c50" && Map_QM.util.meshMaterialArr[e].opacity == alphaModle) { + ceMaterial = Map_QM.util.meshMaterialArr[e]; + } + } + if (!mapMaterial) { + let texture = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/front.png"); + texture.wrapS = THREE.ClampToEdgeWrapping; + texture.wrapT = THREE.RepeatWrapping; + mapMaterial = new THREE.MeshPhongMaterial({ + color: entityColor, + map: texture, + transparent: true, + opacity: alphaModle, + side: THREE.DoubleSide, + depthTest: true, + }); + mapMaterial.userData.map = "front"; + Map_QM.util.meshMaterialArr.push(mapMaterial); + } + if (!ceMaterial) { + let texture2 = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/c50.png"); + texture2.wrapS = THREE.RepeatWrapping; + texture2.wrapT = THREE.ClampToEdgeWrapping; + ceMaterial = new THREE.MeshPhongMaterial({ + color: entityColor, + map: texture2, + transparent: true, + opacity: alphaModle, + side: THREE.DoubleSide, + depthTest: true, + }); + ceMaterial.userData.map = "c50"; + Map_QM.util.meshMaterialArr.push(ceMaterial); + } + mesh = new THREE.Mesh(scanGeometry, [meshMaterial, ceMaterial, mapMaterial,]); + } else if (opObj.map) { + Map_QM.util.packUv(scanGeometry); + let ceMaterial; + for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { + if (Map_QM.util.meshMaterialArr[e].userData.map == opObj.map && Map_QM.util.meshMaterialArr[e].opacity == alphaModle) { + ceMaterial = Map_QM.util.meshMaterialArr[e]; + } + } + if (!ceMaterial) { + let texture2 = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/" + opObj.map + ".png"); + texture2.wrapS = THREE.RepeatWrapping; + texture2.wrapT = THREE.ClampToEdgeWrapping; + ceMaterial = new THREE.MeshPhongMaterial({ + color: entityColor, + map: texture2, + transparent: true, + opacity: alphaModle, + side: THREE.DoubleSide, + depthTest: true, + }); + ceMaterial.userData.map = opObj.map; + Map_QM.util.meshMaterialArr.push(ceMaterial); + } + mesh = new THREE.Mesh(scanGeometry, [meshMaterial, ceMaterial]); + } else { + mesh = new THREE.Mesh(scanGeometry, meshMaterial); + } + + if (opObj.type != "wall") { + let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); + let cubeLine = new THREE.LineSegments(cubeEdges, material); + cubeLine.renderOrder = indexOrder - 5; + mesh.add(cubeLine); + } + if (opObj.name != "floor") { + mesh.position.z = opObj.site || 0; + } else { + mesh.position.z = -1 * parseInt(opObj.toHeight) - 1; + } + mesh.castShadow = true; + mesh.renderOrder = indexOrder; + mesh.name = opObj.name || ""; + return mesh; +}; //绘制平面 -MyModel_QM.prototype.MyPlaneShape = function (areaArr, howllowArr, opObj, entityColor = "#dadada", lineColor = "#eeeeee", indexOrder = 1) { - let len = areaArr.length; - if (len == 0) { - return; - } - let alphaModle = opObj.alphaModle / 100 || 0; - // 实例化shape对象 - let shape = new THREE.Shape(); - // 设置开始点的位置 - shape.moveTo(areaArr[0][0], -1 * areaArr[0][1]); - for (let i = 0; i < areaArr.length; i++) { - if (areaArr[i].length == 4) { - shape.lineTo(areaArr[i][2], -1 * areaArr[i][3]); - } else { - shape.bezierCurveTo(areaArr[i][2], -1 * areaArr[i][3], areaArr[i][4], -1 * areaArr[i][5], areaArr[i][6], -1 * areaArr[i][7]); - } - } - let material; - for (let k = 0; k < Map_QM.util.lineBasicMaterialArr.length; k++) { - let color2 = new THREE.Color(lineColor) - if (Map_QM.util.lineBasicMaterialArr[k].color.equals(color2)) { - material = Map_QM.util.lineBasicMaterialArr[k]; - } - } - if (!material) { - material = new THREE.LineBasicMaterial({ - color: lineColor, - opacity: 0.8, - transparent: true - }); //材质对象lineColor - Map_QM.util.lineBasicMaterialArr.push(material); - } - if (howllowArr && howllowArr.length > 0) { - for (let n = 0; n < howllowArr.length; n++) { - let hole = new THREE.Path(); // 添加孔洞 - hole.moveTo(howllowArr[n][0][0], -1 * howllowArr[n][0][1]); - for (let k = 0; k < howllowArr[n].length; k++) { - if (howllowArr[n][k].length == 4) { - hole.lineTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3]); - } else { - hole.bezierCurveTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3], howllowArr[n][k][4], -1 * howllowArr[n][k][5], howllowArr[n][k][6], -1 * howllowArr[n][k][7]); - } - } - shape.holes.push(hole); - } - } - let scanGeometry, meshMaterial; - scanGeometry = new THREE.ShapeGeometry(shape, 8); - Map_QM.util.assignUVs(scanGeometry); - if(opObj.map){ - let texture = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/" + opObj.map + ".png"); - meshMaterial = new THREE.MeshPhongMaterial({ //MeshStandardMaterial MeshPhongMaterial olor: entityColor, - color: entityColor, - map: texture, - transparent: true, - opacity: alphaModle, - side: THREE.DoubleSide, - depthTest: true - }); - meshMaterial.userData.map = opObj.map; - Map_QM.util.meshMaterialArr.push(meshMaterial); - }else{ - for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { - let color2 = new THREE.Color(entityColor); - if (Map_QM.util.meshMaterialArr[e].color && Map_QM.util.meshMaterialArr[e].color.equals(color2) && Map_QM.util.meshMaterialArr[e].opacity == alphaModle && !Map_QM.util.meshMaterialArr[e].userData.map) { - meshMaterial = Map_QM.util.meshMaterialArr[e]; - } - } - if (!meshMaterial) { - meshMaterial = new THREE.MeshPhongMaterial({ - color: entityColor, - transparent: true, - opacity: alphaModle, - side: THREE.DoubleSide, - depthTest: true - }); - Map_QM.util.meshMaterialArr.push(meshMaterial); - } - if (opObj.angleY || opObj.angleZ) { - Map_QM.util.rotateYZ(scanGeometry, opObj.angleY * Math.PI / 180, opObj.angleZ * Math.PI / 180); - } - } - // 创建模型 - let mesh = new THREE.Mesh(scanGeometry, meshMaterial); - - let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); - let cubeLine = new THREE.LineSegments(cubeEdges, material); - cubeLine.renderOrder = indexOrder - 5; - mesh.add(cubeLine); - - if (opObj.name != "floor") { - mesh.position.z = parseInt(opObj.toHeight) || 0; - } - mesh.castShadow = true; - mesh.renderOrder = indexOrder; - mesh.name = opObj.name || ""; - return mesh; -} +MyModel_QM.prototype.MyPlaneShape = function (areaArr,howllowArr,opObj,entityColor = "#dadada",lineColor = "#eeeeee",indexOrder = 1) { + let len = areaArr.length; + if (len == 0) { + return; + } + let alphaModle = opObj.alphaModle / 100 || 0; + // 实例化shape对象 + let shape = new THREE.Shape(); + // 设置开始点的位置 + shape.moveTo(areaArr[0][0], -1 * areaArr[0][1]); + for (let i = 0; i < areaArr.length; i++) { + if (areaArr[i].length == 4) { + shape.lineTo(areaArr[i][2], -1*areaArr[i][3]); + } else { + shape.bezierCurveTo(areaArr[i][2], -1*areaArr[i][3], areaArr[i][4], -1*areaArr[i][5], areaArr[i][6], -1*areaArr[i][7]); + } + } + let material; + for (let k = 0; k < Map_QM.util.lineBasicMaterialArr.length; k++) { + let color2 = new THREE.Color(lineColor); + if (Map_QM.util.lineBasicMaterialArr[k].color.equals(color2)) { + material = Map_QM.util.lineBasicMaterialArr[k]; + } + } + if (!material) { + material = new THREE.LineBasicMaterial({ + color: lineColor, + opacity: 0.8, + transparent: true, + }); //材质对象lineColor + Map_QM.util.lineBasicMaterialArr.push(material); + } + if (howllowArr && howllowArr.length > 0) { + for (let n = 0; n < howllowArr.length; n++) { + let hole = new THREE.Path(); // 添加孔洞 + hole.moveTo(howllowArr[n][0][0], -1 * howllowArr[n][0][1]); + for (let k = 0; k < howllowArr[n].length; k++) { + if (howllowArr[n][k].length == 4) { + hole.lineTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3]); + } else { + hole.bezierCurveTo(howllowArr[n][k][2], -1*howllowArr[n][k][3], howllowArr[n][k][4], -1*howllowArr[n][k][5], howllowArr[n][k][6], -1*howllowArr[n][k][7]); + } + } + shape.holes.push(hole); + } + } + let scanGeometry, meshMaterial; + scanGeometry = new THREE.ShapeGeometry(shape, 8); + Map_QM.util.assignUVs(scanGeometry); + if (opObj.map) { + let texture = new THREE.TextureLoader().load( + Map_QM.util.beforPath + "static/img/map/" + opObj.map + ".png" + ); + meshMaterial = new THREE.MeshPhongMaterial({ + //MeshStandardMaterial MeshPhongMaterial olor: entityColor, + color: entityColor, + map: texture, + transparent: true, + opacity: alphaModle, + side: THREE.DoubleSide, + depthTest: true, + }); + meshMaterial.userData.map = opObj.map; + Map_QM.util.meshMaterialArr.push(meshMaterial); + } else { + for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { + let color2 = new THREE.Color(entityColor); + if ( + Map_QM.util.meshMaterialArr[e].color && + Map_QM.util.meshMaterialArr[e].color.equals(color2) && + Map_QM.util.meshMaterialArr[e].opacity == alphaModle && + !Map_QM.util.meshMaterialArr[e].userData.map + ) { + meshMaterial = Map_QM.util.meshMaterialArr[e]; + } + } + if (!meshMaterial) { + meshMaterial = new THREE.MeshPhongMaterial({ + color: entityColor, + transparent: true, + opacity: alphaModle, + side: THREE.DoubleSide, + depthTest: true, + }); + Map_QM.util.meshMaterialArr.push(meshMaterial); + } + if (opObj.angleY || opObj.angleZ) { + Map_QM.util.rotateYZ( + scanGeometry, + (opObj.angleY * Math.PI) / 180, + (opObj.angleZ * Math.PI) / 180 + ); + } + } + // 创建模型 + let mesh = new THREE.Mesh(scanGeometry, meshMaterial); + + let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60); + let cubeLine = new THREE.LineSegments(cubeEdges, material); + cubeLine.renderOrder = indexOrder - 5; + mesh.add(cubeLine); + + if (opObj.name != "floor") { + mesh.position.z = parseInt(opObj.toHeight) || 0; + } + mesh.castShadow = true; + mesh.renderOrder = indexOrder; + mesh.name = opObj.name || ""; + return mesh; +}; MyModel_QM.prototype.MyModelText = function (svgArea) { + let text = svgArea.data; + const paths = new THREE.SVGLoader().parse(text).paths; + const group = new THREE.Group(); + + group.position.x = parseInt(svgArea.xaxis); + group.position.y = -1 * parseInt(svgArea.yaxis); + group.position.z = parseInt(svgArea.site || 0); + group.rotateX((parseInt(svgArea.angleZ) * Math.PI) / 180); + group.rotateY((parseInt(svgArea.angleY) * Math.PI) / 180); + group.rotateZ((parseInt(svgArea.angle) * Math.PI) / 180); + group.scale.multiplyScalar(svgArea.scale); + group.scale.y *= -1; + + let meshMaterial; + for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { + let color2 = new THREE.Color().setHex(svgArea.entColor); + if (Map_QM.util.meshMaterialArr[e].color && + Map_QM.util.meshMaterialArr[e].color.equals(color2) && + Map_QM.util.meshMaterialArr[e].opacity == svgArea.alphaModle + ) { + meshMaterial = Map_QM.util.meshMaterialArr[e]; + } + } + if (!meshMaterial) { + meshMaterial = new THREE.MeshStandardMaterial({ + color: svgArea.entColor, + opacity: parseInt(svgArea.alphaModle) / 100, + }); + Map_QM.util.meshMaterialArr.push(meshMaterial); + } - let text = svgArea.data; - const paths = new THREE.SVGLoader().parse(text).paths; - const group = new THREE.Group(); - - group.position.x = parseInt(svgArea.xaxis); - group.position.y = -1 * parseInt(svgArea.yaxis); - group.position.z = parseInt(svgArea.site || 0); - group.rotateX(parseInt(svgArea.angleZ) * Math.PI / 180); - group.rotateY(parseInt(svgArea.angleY) * Math.PI / 180); - group.rotateZ(parseInt(svgArea.angle) * Math.PI / 180); - group.scale.multiplyScalar(svgArea.scale); - group.scale.y *= -1; - - let meshMaterial; - for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) { - let color2 = new THREE.Color().setHex(svgArea.entColor); - if (Map_QM.util.meshMaterialArr[e].color && Map_QM.util.meshMaterialArr[e].color.equals(color2) && Map_QM.util.meshMaterialArr[e].opacity == svgArea.alphaModle) { - meshMaterial = Map_QM.util.meshMaterialArr[e]; - } - } - if (!meshMaterial) { - meshMaterial = new THREE.MeshStandardMaterial({ - color: svgArea.entColor, - opacity: parseInt(svgArea.alphaModle) / 100 - }); - Map_QM.util.meshMaterialArr.push(meshMaterial); - } - - for (let i = 0; i < paths.length; i++) { - const path = paths[i]; - let shapes = path.toShapes(true); - const geometry = new THREE.ShapeGeometry(shapes, 12); - const mesh = new THREE.Mesh(geometry, meshMaterial); - mesh.renderOrder = 50; - mesh.name = svgArea.name || ""; - mesh.position.set(svgArea.width / -2, svgArea.height / -2, parseInt(svgArea.toHeight)+1); - group.add(mesh); - } - return group; -} + for (let i = 0; i < paths.length; i++) { + const path = paths[i]; + let shapes = path.toShapes(true); + const geometry = new THREE.ShapeGeometry(shapes, 36); + const mesh = new THREE.Mesh(geometry, meshMaterial); + mesh.renderOrder = 50; + mesh.name = svgArea.name || ""; + mesh.position.set( svgArea.width / -2, svgArea.height / -2, parseInt(svgArea.toHeight) + 1); + group.add(mesh); + } + return group; +}; /** * 公共设施 */ -MySprite_QM = function (spriteMaterial, obj = null) { - THREE.Sprite.call(this) +var MySprite_QM = function (spriteMaterial, obj = null) { + THREE.Sprite.call(this); if (obj) { - this.navCode = obj.navCode - this.no = obj.no - this.facCode = obj.facCode - this.floor = obj.floorOrder - this.build = obj.buildOrder - this.site = parseInt(obj.site) || Map_QM.util.shopHeight + 32 + this.navCode = obj.navCode; + this.no = obj.no; + this.facCode = obj.facCode; + this.floor = obj.floorOrder; + this.build = obj.buildOrder; + this.site = parseInt(obj.site) || Map_QM.util.shopHeight + 32; } - this.imgUrl - this.material = spriteMaterial !== undefined ? spriteMaterial : new SpriteMaterial() + this.imgUrl; + this.material = spriteMaterial !== undefined ? spriteMaterial : new SpriteMaterial(); //图标跳动 this.jumpIcon = function () { - let oldZ = this.site - let self = this - TweenMax.fromTo( - self.position, - 0.5, - { z: oldZ }, - { - z: oldZ + 20, - repeat: 1, + let oldZ = this.site; + let self = this; + TweenMax.fromTo(self.position, 0.5, { z: oldZ }, {z: oldZ + 20, repeat: 1, onComplete: function () { - TweenMax.to(self.position, 0.2, { z: oldZ }) - } + TweenMax.to(self.position, 0.2, { z: oldZ }); + }, } - ) - } + ); + }; this.reSetSite = function () { //重置位置 - this.position.z = this.site - } -} + this.position.z = this.site; + }; +}; -MySprite_QM.prototype = Object.create(THREE.Sprite.prototype) -MySprite_QM.prototype.constructor = MySprite_QM +MySprite_QM.prototype = Object.create(THREE.Sprite.prototype); +MySprite_QM.prototype.constructor = MySprite_QM; /** * 渲染公共设施 */ - Facilities_QM = function () { - this.renderIcon = function (obj, _this, isShow = true, ele = null) { - if (obj) { - let url = Map_QM.util.beforPath + "static/img/" + obj.facCode + ".png"; - let name = obj.title; - let nameEn = obj.title; - if (Map_QM.util.iconUrl.length > 0) { //使用设施库 - for (let i = 0; i < Map_QM.util.iconUrl.length; i++) { - if (Map_QM.util.iconUrl[i].abbreviation == obj.facCode) { - url = Map_QM.util.iconUrl[i].navFilePath - name = Map_QM.util.iconUrl[i].name; - nameEn = Map_QM.util.iconUrl[i].nameEn; - } - } - } - let shopDiv = document.createElement('img'); - shopDiv.src = url; - shopDiv.style.zIndex = 200; - shopDiv.style.width = "1.2vw"; - shopDiv.style.display = isShow?"":"none"; - let shopLabel = new THREE.CSS2DObject(shopDiv); - shopLabel.userData.mapShow = true; //是否永久显示 - shopLabel.userData = obj; - shopLabel.userData.type = "icon"; - shopLabel.userData.use = ele ? "2d" : "all"; - shopLabel.userData.model = ele; - shopLabel.userData.src = url; - shopLabel.userData.isShow = true; - - shopLabel.position.set(obj.x, -1 * obj.y, Math.max(30, parseInt(obj.site) || 0)); - _this.serObj.add(shopLabel); - - if (Map_QM.util.options.iconName) { - let shopDiv = document.createElement('div'); - shopDiv.style.cssText = css_LR - if(window.innerWidth>2000){ - shopDiv.style.height = "20px"; - shopDiv.style.fontSize = "18px"; - } - shopDiv.innerText = obj.title; - shopDiv.dataset.name = name; - shopDiv.dataset.nameEn = nameEn; - let shopLabel = new THREE.CSS2DObject(shopDiv); - shopLabel.position.set(obj.x, -1 * obj.y, 30); - shopLabel.userData.mapShow = true; - _this.labelObj.add(shopLabel); - } - } - } -} +var Facilities_QM = function () { + this.renderIcon = function (obj, _this, isShow = true, ele = null) { + if (obj) { + let url = Map_QM.util.beforPath + "static/img/" + obj.facCode + ".png"; + let name = obj.title; + let nameEn = obj.title; + if (Map_QM.util.iconUrl.length > 0) { + //使用设施库 + for (let i = 0; i < Map_QM.util.iconUrl.length; i++) { + if (Map_QM.util.iconUrl[i].abbreviation == obj.facCode) { + url = Map_QM.util.beforPath+"static/offline/"+Map_QM.util.iconUrl[i].filePath; + name = Map_QM.util.iconUrl[i].name; + nameEn = Map_QM.util.iconUrl[i].nameEn; + } + } + } + let shopDiv = document.createElement("img"); + shopDiv.src = url; + shopDiv.style.zIndex = 100; + shopDiv.style.width = "1.2vw"; + shopDiv.style.display = isShow ? "" : "none"; + shopDiv.dataset.name = name; + shopDiv.dataset.src = url; + shopDiv.dataset.nameEn = nameEn; + shopDiv.dataset.buildOrder = obj.buildOrder; + shopDiv.dataset.floorOrder = obj.floorOrder; + shopDiv.dataset.facCode = obj.facCode; + shopDiv.dataset.node = obj.navCode; + + shopDiv.addEventListener("click", (event) => { + /** + * @api {事件} icon 点击设施图标 + * @apiGroup 地图事件 + * @apiDescription 用户点击设施图标后触发自定义事件 + * @apiVersion 4.0.0 + * @apiSampleRequest off + * + * @apiParamExample 请求示例 + * Map_QM.addEventListener("icon",onClickIcon,false); + */ + Map_QM.dispatchEvent({ + type: "icon", + data: { + buildOrder: event.target.dataset.buildOrder, + floorOrder: event.target.dataset.floorOrder, + node: event.target.dataset.node, + src: event.target.dataset.src, + facCode: event.target.dataset.facCode, + title: event.target.dataset.name, + }, + }); + }); + let shopLabel = new THREE.CSS2DObject(shopDiv); + shopLabel.userData.mapShow = true; //是否永久显示 + shopLabel.userData = obj; + shopLabel.userData.type = "icon"; + shopLabel.userData.use = ele ? "2d" : "all"; + shopLabel.userData.model = ele; + shopLabel.userData.src = url; + shopLabel.userData.isShow = true; + shopLabel.position.set(obj.x, -1*obj.y, Math.max(30, parseInt(obj.site) || 0)); + _this.serObj.add(shopLabel); + + if (Map_QM.util.options.iconName) { + let titleDiv = document.createElement("div"); + titleDiv.style.cssText = css_LR; + if (window.innerWidth > 2000) { + titleDiv.style.fontSize = "18px"; + } + titleDiv.innerText = obj.title; + titleDiv.dataset.name = name; + titleDiv.dataset.nameEn = nameEn; + titleDiv.style.zIndex = 480; + let shopLabel = new THREE.CSS2DObject(titleDiv); + shopLabel.position.set(obj.x, -1 * obj.y, parseInt(obj.site) + 85); + shopLabel.userData.mapShow = true; + shopLabel.userData.isShow = true; + _this.labelObj.add(shopLabel); + } + } + }; +}; /** * 店铺LOGO地图展示类 */ -ShopLogo_QM = function () { +var ShopLogo_QM = function () { this.renderIcon = function (obj, _this, z) { if (obj) { - let x = obj.xaxis >> 0 - let y = (-1 * obj.yaxis) >> 0 - let imgW = obj.imgW >> 0 - let imgH = obj.imgH >> 0 + let x = obj.xaxis >> 0; + let y = (-1 * obj.yaxis) >> 0; + let imgW = obj.imgW >> 0; + let imgH = obj.imgH >> 0; - new THREE.TextureLoader().load(obj.logoUrl, textu => { + new THREE.TextureLoader().load(obj.logoUrl, (textu) => { let planeMaterial = new THREE.MeshPhongMaterial({ map: textu, depthTest: true, transparent: true, - alphaTest:0.01 - }) - let planeGeometry = new THREE.PlaneGeometry(imgW, imgH) - let plane = new THREE.Mesh(planeGeometry, planeMaterial) - plane.center = new THREE.Vector2(0, 0) - plane.position.set(x, y, obj.site || z) - plane.userData.rot = 0 - plane.userData.type = 'logo' - plane.renderOrder = 70 - _this.add(plane) - }) + alphaTest: 0.01, + }); + let planeGeometry = new THREE.PlaneGeometry(imgW, imgH); + let plane = new THREE.Mesh(planeGeometry, planeMaterial); + plane.center = new THREE.Vector2(0, 0); + plane.position.set(x, y, obj.site || z); + plane.userData.rot = 0; + plane.userData.type = "logo"; + plane.renderOrder = 70; + _this.add(plane); + }); } - } -} - -var _selfFindPath -FindPath_QM = function () { - this.pathArr = [] - this.lineDashed_old + }; +}; + +var _selfFindPath; +var FindPath_QM = function () { + this.pathArr = []; + this.lineDashed; + this.lineDashed_old; //路线指引箭头皮肤 - this.planeGeometry = new THREE.PlaneGeometry(128, 128) - this.stop = null - this._index = 0 //寻路用 - this.pathState = 'init' + this.planeGeometry = new THREE.PlaneGeometry(128, 128); + this.morePath = false; + this.stop = null; + this._index = 0; //寻路用 + this.pathState = "init"; this.pathPlay = { _isPlay: false, get isPlay() { - return this._isPlay + return this._isPlay; }, set isPlay(val) { - this._isPlay = val + this._isPlay = val; if (_selfFindPath && _selfFindPath.stop) { - window.cancelAnimationFrame(_selfFindPath.stop) - _selfFindPath.stop = null + window.cancelAnimationFrame(_selfFindPath.stop); + _selfFindPath.stop = null; } - if (_selfFindPath && _selfFindPath.pathState == 'isPlay' && _selfFindPath._index < _selfFindPath.pathArr.length) { - _selfFindPath.playMoveGuide() + if (_selfFindPath && _selfFindPath.pathState == "isPlay" && _selfFindPath._index < _selfFindPath.pathArr.length) { + _selfFindPath.playMoveGuide(); } - } - } -} + }, + }; +}; FindPath_QM.prototype.clearPath = function () { - this.pathArr = [] + this.pathArr = []; + if (this.lineDashed) { + if (Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) { + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.remove(this.lineDashed); + } + this.lineDashed.destroy(); + this.lineDashed = null; + } if (this.lineDashed_old) { if (Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) { - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.remove(this.lineDashed_old) + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.remove(this.lineDashed_old); } - this.lineDashed_old.destroy() - this.lineDashed_old = null + this.lineDashed_old.destroy(); + this.lineDashed_old = null; } if (Map_QM.guide) { - Map_QM.guide.visible = false + Map_QM.guide.visible = false; if (Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor]) { - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.remove(Map_QM.man_2d) - Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.remove(Map_QM.man_3d) + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.remove(Map_QM.man_2d); + Map_QM.mapArr[Map_QM.util.selectBuild][Map_QM.util.selectFloor].allObj.remove(Map_QM.man_3d); } } if (_selfFindPath && _selfFindPath.stop) { - window.cancelAnimationFrame(_selfFindPath.stop) + window.cancelAnimationFrame(_selfFindPath.stop); } - this._index = 0 - this.pathState = 'init' -} + this._index = 0; + this.pathState = "init"; +}; /** * @param {Object} startNade * @param {Object} toNade * @param {Object} callBack 回调函数 */ -FindPath_QM.prototype.onFindPathAnimation = function (pathArray, floorOrder = -1) { +FindPath_QM.prototype.onFindPathAnimation = function (pathArray,morePath = false,floorOrder = -1) { + this.morePath = morePath; if (pathArray && pathArray.length > 0) { - this.pathArr = [] - for (let j = 0; j < pathArray.length; j++) { - this.pathArr.push(pathArray[j]) - } - this.pathState = 'isPlay' - this._index = 0 + this.pathState = "isPlay"; + this._index = 0; + this.pathArr = []; if (floorOrder === -1) { - floorOrder = Map_QM.util.selectFloor + floorOrder = Map_QM.util.selectFloor; + } + if (morePath) { + for (let j = 0; j < pathArray.length; j++) { + this.drawPath(floorOrder,pathArray[j], parseInt(Map_QM.util.buildHeight) + j); + } + } else { + for (let j = 0; j < pathArray.length; j++) { + this.pathArr.push(pathArray[j]); + } + this.drawPath(floorOrder); } - this.drawPath(floorOrder) } -} - -FindPath_QM.prototype.drawPath = function (floorOrder) { - let linePath = [] - for (let i = 0; i < this.pathArr.length; i++) { - if (i < this.pathArr.length) { - linePath.push([this.pathArr[i].x, -1 * this.pathArr[i].y]) +}; + +FindPath_QM.prototype.drawPath = function (floorOrder, pathArr = null, height = 1) { + let linePath = []; + if (!pathArr) { + for (let i = 0; i < this.pathArr.length; i++) { + if (i < this.pathArr.length) { + linePath.push([this.pathArr[i].x, -1 * this.pathArr[i].y]); + } + } + } else { + for (let i = 0; i < pathArr.length; i++) { + if (i < pathArr.length) { + linePath.push([pathArr[i].x, -1 * pathArr[i].y]); + } } } - this.lineDashed_old = new PathLine(12, linePath, parseInt(Map_QM.util.buildHeight) + 1, Map_QM.util.options.pathColor, Map_QM.util.options.pathColor2, true) - this.lineDashed_old.name = 'lineDash' - this.lineDashed_old.renderOrder = 128 - Map_QM.mapArr[Map_QM.util.selectBuild][floorOrder].allObj.add(this.lineDashed_old) - - //////////////////////////////////////////////////////// -} - - - + if (this.morePath) { + this.lineDashed_old = new PathLine(12,linePath,height,Map_QM.util.options.pathColor,Map_QM.util.options.pathColor2,true); + } else { + this.lineDashed_old = new PathLine(12,linePath,parseInt(Map_QM.util.buildHeight) + 1,Map_QM.util.options.pathColor,Map_QM.util.options.pathColor2,true); + } + this.lineDashed_old.name = "lineDash"; + this.lineDashed_old.renderOrder = 128; + Map_QM.mapArr[Map_QM.util.selectBuild][floorOrder].allObj.add(this.lineDashed_old); +}; FindPath_QM.prototype.guidePathPlay = function (paths) { if (Map_QM.guide) { - Map_QM.guide.renderOrder = 99 + Map_QM.guide.renderOrder = 99; if (paths.PathPoint) { - Map_QM.guide.position.x = paths.PathPoint[0].x - Map_QM.guide.position.y = -1 * paths.PathPoint[0].y - Map_QM.moveCameraBy2D(paths.PathPoint[0]) - Map_QM.man_2d.position.z = parseInt(Map_QM.util.buildHeight) + 120 - Map_QM.man_3d.position.z = parseInt(Map_QM.util.buildHeight) + 5 - Map_QM.guide.visible = true - Map_QM.mapArr[Map_QM.util.selectBuild][paths.floor].allObj.add(Map_QM.man_2d) - Map_QM.mapArr[Map_QM.util.selectBuild][paths.floor].allObj.add(Map_QM.man_3d) + Map_QM.guide.position.x = paths.PathPoint[0].x; + Map_QM.guide.position.y = -1 * paths.PathPoint[0].y; + Map_QM.moveCameraBy2D(paths.PathPoint[0]); + Map_QM.man_2d.position.z = parseInt(Map_QM.util.buildHeight) + 120; + Map_QM.man_3d.position.z = parseInt(Map_QM.util.buildHeight) + 5; + Map_QM.guide.visible = true; + Map_QM.mapArr[Map_QM.util.selectBuild][paths.floor].allObj.add(Map_QM.man_2d); + Map_QM.mapArr[Map_QM.util.selectBuild][paths.floor].allObj.add(Map_QM.man_3d); } } - this.pathArr = paths.PathPoint - _selfFindPath = this + this.pathArr = paths.PathPoint; + _selfFindPath = this; if (Map_QM.util.pathStateObj.isPathPlay) { - this.pathPlay.isPlay = true + this.pathPlay.isPlay = true; } -} +}; /** * 播放图标指引动画 */ FindPath_QM.prototype.playMoveGuide = function () { if (!Map_QM.guide) { - return + return; } - let px = Map_QM.guide.position.x - let py = Map_QM.guide.position.y - let targetX = _selfFindPath.pathArr[_selfFindPath._index].x - px - let targetY = -1 * _selfFindPath.pathArr[_selfFindPath._index].y - py - let dist = Math.sqrt(targetX * targetX + targetY * targetY) - let df = Math.ceil(dist / Map_QM.util.options.playSpeed) - let dx = (_selfFindPath.pathArr[_selfFindPath._index].x - px) / df - let dy = (-1 * _selfFindPath.pathArr[_selfFindPath._index].y - py) / df - let ang = 0 + let px = Map_QM.guide.position.x; + let py = Map_QM.guide.position.y; + let targetX = _selfFindPath.pathArr[_selfFindPath._index].x - px; + let targetY = -1 * _selfFindPath.pathArr[_selfFindPath._index].y - py; + let dist = Math.sqrt(targetX * targetX + targetY * targetY); + let df = Math.ceil(dist / (Map_QM.util.options.playSpeed * Map_QM.util.options.speedMult)); + let dx = (_selfFindPath.pathArr[_selfFindPath._index].x - px) / df; + let dy = (-1 * _selfFindPath.pathArr[_selfFindPath._index].y - py) / df; + let ang = 0; if (df < 2) { - Map_QM.guide.position.x = _selfFindPath.pathArr[_selfFindPath._index].x - Map_QM.guide.position.y = -1 * _selfFindPath.pathArr[_selfFindPath._index].y - Map_QM.moveCameraBy2D({ x: _selfFindPath.pathArr[_selfFindPath._index].x, y: _selfFindPath.pathArr[_selfFindPath._index].y }) - - _selfFindPath._index++ + Map_QM.guide.position.x = _selfFindPath.pathArr[_selfFindPath._index].x; + Map_QM.guide.position.y = -1 * _selfFindPath.pathArr[_selfFindPath._index].y; + Map_QM.moveCameraBy2D({x: _selfFindPath.pathArr[_selfFindPath._index].x, y: _selfFindPath.pathArr[_selfFindPath._index].y }); + _selfFindPath._index++; if (_selfFindPath._index > 0 && _selfFindPath._index < _selfFindPath.pathArr.length) { - Map_QM.man_3d.rotation.z = Map_QM.man_2d.rotation.z = 0 //180; + Map_QM.man_3d.rotation.z = Map_QM.man_2d.rotation.z = 0; //180; let s = Math.sqrt( (_selfFindPath.pathArr[_selfFindPath._index].x - _selfFindPath.pathArr[_selfFindPath._index - 1].x) * - (_selfFindPath.pathArr[_selfFindPath._index].x - _selfFindPath.pathArr[_selfFindPath._index - 1].x) + - (_selfFindPath.pathArr[_selfFindPath._index].y - _selfFindPath.pathArr[_selfFindPath._index - 1].y) * - (_selfFindPath.pathArr[_selfFindPath._index].y - _selfFindPath.pathArr[_selfFindPath._index - 1].y) - ) - ang = Math.acos((_selfFindPath.pathArr[_selfFindPath._index].y - _selfFindPath.pathArr[_selfFindPath._index - 1].y) / s) - if (_selfFindPath.pathArr[_selfFindPath._index].x < _selfFindPath.pathArr[_selfFindPath._index - 1].x) { - Map_QM.man_3d.rotation.z = Map_QM.man_2d.rotation.z = Math.PI - ang + (_selfFindPath.pathArr[_selfFindPath._index].x - _selfFindPath.pathArr[_selfFindPath._index - 1].x) + + (_selfFindPath.pathArr[_selfFindPath._index].y - _selfFindPath.pathArr[_selfFindPath._index - 1].y) * + (_selfFindPath.pathArr[_selfFindPath._index].y - _selfFindPath.pathArr[_selfFindPath._index - 1].y) + ); + ang = Math.acos((_selfFindPath.pathArr[_selfFindPath._index].y - _selfFindPath.pathArr[_selfFindPath._index - 1].y) /s); + if ( _selfFindPath.pathArr[_selfFindPath._index].x < _selfFindPath.pathArr[_selfFindPath._index - 1].x) { + Map_QM.man_3d.rotation.z = Map_QM.man_2d.rotation.z = Math.PI - ang; } else { - Map_QM.man_3d.rotation.z = Map_QM.man_2d.rotation.z = Math.PI + ang + Map_QM.man_3d.rotation.z = Map_QM.man_2d.rotation.z = Math.PI + ang; } } - let pathShop = '' + let pathShop = ""; for (let t = 0; t < Map_QM.forShopArr[Map_QM.util._indexPathFloor].wayShop.length; t++) { - if (Map_QM.forShopArr[Map_QM.util._indexPathFloor].wayShop[t].pathIndex == _selfFindPath._index) { - let shop_ = Map_QM.forShopArr[Map_QM.util._indexPathFloor].wayShop[t].shop - pathShop = shop_.houseNumber - let shops = Map_QM.mapArr[Map_QM.util.selectBuild][parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].wayShop[t].shop.floorOrder)].allObj.children + if (Map_QM.forShopArr[Map_QM.util._indexPathFloor].wayShop[t].pathIndex ==_selfFindPath._index) { + let shop_ = Map_QM.forShopArr[Map_QM.util._indexPathFloor].wayShop[t].shop; + pathShop = shop_.houseNumber; + let shops = Map_QM.mapArr[Map_QM.util.selectBuild][parseInt(Map_QM.forShopArr[Map_QM.util._indexPathFloor].wayShop[t].shop.floorOrder)].shopObj.children; for (let i = 0; i < shops.length; i++) { - let _shop = shops[i].userData.shopData - if (_shop && _shop.houseNumber === pathShop) { - let shopModel = shops[i] - let material = shopModel.material - shopModel.material = new THREE.MeshBasicMaterial({ color: Map_QM.util.options.navColor }) - TweenMax.to(shopModel.scale, 0.8, { - z: 3, - yoyo: true, - ease: Cubic.easeIn, + let _shop = shops[i].userData.shopData; + if (_shop && _shop.houseNumber == pathShop) { + let shopModel = shops[i]; + let material = shopModel.material; + shopModel.material = new THREE.MeshBasicMaterial({ + color: Map_QM.util.options.navColor, + }); + TweenMax.to(shopModel.scale, 0.8, { z: 3, yoyo: true, ease: Cubic.easeIn, onComplete: function () { if (shopModel) { - TweenMax.to(shopModel.scale, 0.5, { z: 1 }) - shopModel.material = material + TweenMax.to(shopModel.scale, 0.5, { z: 1 }); + shopModel.material = material; } - } - }) - break + }, + }); + break; } } - break + break; } } Map_QM.dispatchEvent({ //寻路中返回小人当前所在点位 - type: 'PathPlaying', - data: { shopNum: pathShop } - }) + type: "PathPlaying", + data: { houseNumber: pathShop }, + }); } else { - px += dx - py += dy - Map_QM.guide.position.x = px - Map_QM.guide.position.y = py - Map_QM.moveCameraBy2D({ x: px, y: -1 * py }) + px += dx; + py += dy; + Map_QM.guide.position.x = px; + Map_QM.guide.position.y = py; + Map_QM.moveCameraBy2D({ x: px, y: -1 * py }); } if (_selfFindPath.pathPlay.isPlay && Map_QM.guide) { if (_selfFindPath._index < _selfFindPath.pathArr.length) { - _selfFindPath.stop = requestAnimationFrame(_selfFindPath.playMoveGuide) + _selfFindPath.stop = requestAnimationFrame(_selfFindPath.playMoveGuide); } else { if (_selfFindPath && _selfFindPath.stop) { - window.cancelAnimationFrame(_selfFindPath.stop) - _selfFindPath.stop = null + window.cancelAnimationFrame(_selfFindPath.stop); + _selfFindPath.stop = null; } - _selfFindPath._index = 0 + _selfFindPath._index = 0; if (Map_QM.guide) { - Map_QM.guide.visible = false + Map_QM.guide.visible = false; } - let myEvent = new CustomEvent('pathOver', { - detail: { dx: dx, dy: dy } - }) - document.dispatchEvent(myEvent) //触发导航完成事件 - _selfFindPath.pathState = 'pathOver' + let myEvent = new CustomEvent("pathOver", { + detail: { dx: dx, dy: dy }, + }); + document.dispatchEvent(myEvent); //触发导航完成事件 + _selfFindPath.pathState = "pathOver"; } } -} +}; diff --git a/public/static/qm/three.js b/public/static/qm/three.js index e29f597..3828f85 100644 --- a/public/static/qm/three.js +++ b/public/static/qm/three.js @@ -31593,97 +31593,124 @@ */ THREE.CSS2DObject = function ( element ) { THREE.Object3D.call( this ); + this.isCSS2DObject = true; this.element = element; this.element.style.position = 'absolute'; + this.element.style.userSelect = 'none'; }; THREE.CSS2DObject.prototype = Object.create( THREE.Object3D.prototype ); THREE.CSS2DObject.prototype.constructor = THREE.CSS2DObject; + // THREE.CSS2DRenderer = function () { - //console.log( 'THREE.CSS2DRenderer', THREE.REVISION ); - var _width, _height; - var _widthHalf, _heightHalf; - var perc_H = "-50%"; //自定义横向和纵向移动百分比 - var vector = new THREE.Vector3(); - var viewMatrix = new THREE.Matrix4(); - var viewProjectionMatrix = new THREE.Matrix4(); - var cache = { - objects: new WeakMap() - }; - var domElement = document.createElement( 'div' ); - domElement.style.overflow = 'hidden'; - this.domElement = domElement; - this.getSize = function () { - return { - width: _width, - height: _height - }; - }; - this.setSize = function ( width, height,perc_h="-50%") { - _width = width; - _height = height; - perc_H = perc_h; - _widthHalf = _width / 2; - _heightHalf = _height / 2; - domElement.style.width = width + 'px'; - domElement.style.height = height + 'px'; - }; - this.renderObject = function ( object, camera ) { - if ( object instanceof THREE.CSS2DObject) { - vector.setFromMatrixPosition( object.matrixWorld ); - vector.applyMatrix4( viewProjectionMatrix ); - var element = object.element; - var style = 'translate('+perc_H+',-100%) translate(' + ( vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - vector.y * _heightHalf + _heightHalf ) + 'px)'; - element.style.WebkitTransform = style; - element.style.MozTransform = style; - element.style.oTransform = style; - element.style.transform = style; - var objectData = { - distanceToCameraSquared: getDistanceToSquared( camera, object ) + const _vector = new THREE.Vector3(); + const _viewMatrix = new THREE.Matrix4(); + const _viewProjectionMatrix = new THREE.Matrix4(); + const _a = new THREE.Vector3(); + const _b = new THREE.Vector3(); + const _this = this; + let _width, _height; + let _widthHalf, _heightHalf; + let perc_H = "-50%"; //自定义横向和纵向移动百分比 + var cache = { + objects: new WeakMap() + }; + const domElement = document.createElement( 'div' ); + domElement.style.overflow = 'hidden'; + this.domElement = domElement; + this.getSize = function () { + return { + width: _width, + height: _height }; - cache.objects.set( object, objectData ); - if ( element.parentNode !== domElement ) { - domElement.appendChild( element ); + }; + this.setSize = function ( width, height,perc_h="-50%") { + _width = width; + _height = height; + perc_H = perc_h; + _widthHalf = _width / 2; + _heightHalf = _height / 2; + domElement.style.width = width + 'px'; + domElement.style.height = height + 'px'; + }; + + this.render = function ( scene, camera ) { + if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld(); + if ( camera.parent === null && camera.matrixWorldAutoUpdate === true ) camera.updateMatrixWorld(); + _viewMatrix.copy( camera.matrixWorldInverse ); + _viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix ); + //renderObject( scene, scene, camera ); + //zOrder( scene ); + }; + + function hideObject( object ) { + if ( object.isCSS2DObject ) object.element.style.display = 'none'; + for ( let i = 0, l = object.children.length; i < l; i ++ ) { + hideObject( object.children[ i ] ); } } - for ( var i = 0, l = object.children.length; i < l; i ++ ) { - this.renderObject( object.children[ i ], camera ); + + this.renderObject = function( object, scene, camera ) { + if ( object.visible === false ) { + hideObject( object ); + return; + } + if ( object.isCSS2DObject ) { + _vector.setFromMatrixPosition( object.matrixWorld ); + _vector.applyMatrix4( _viewProjectionMatrix ); + const visible = ( _vector.z >= - 1 && _vector.z <= 1 ) ; + const element = object.element; + //element.style.display = visible === true ? '' : 'none'; + + if ( visible === true ) { + object.onBeforeRender( _this, scene, camera ); + let style = 'translate('+perc_H+',-100%) translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)'; + element.style.transform = style; + if ( element.parentNode !== domElement ) { + domElement.appendChild( element ); + } + object.onAfterRender( _this, scene, camera ); + } + const objectData = { + distanceToCameraSquared: getDistanceToSquared( camera, object ) + }; + cache.objects.set( object, objectData ); + } + for ( let i = 0, l = object.children.length; i < l; i ++ ) { + this.renderObject( object.children[ i ], scene, camera ); + } } - }; - var getDistanceToSquared = function () { - var a = new THREE.Vector3(); - var b = new THREE.Vector3(); - return function ( object1, object2 ) { - a.setFromMatrixPosition( object1.matrixWorld ); - b.setFromMatrixPosition( object2.matrixWorld ); - return a.distanceToSquared( b ); - }; - }(); - var filterAndFlatten = function ( scene ) { - var result = []; - scene.traverse( function ( object ) { - if ( object instanceof THREE.CSS2DObject ) result.push( object ); - } ); - return result; - }; - this.zOrder = function ( scene ) { - var sorted = filterAndFlatten( scene ).sort( function ( a, b ) { - var distanceA = cache.objects.get( a ).distanceToCameraSquared; - var distanceB = cache.objects.get( b ).distanceToCameraSquared; - return distanceA - distanceB; - } ); - var zMax = sorted.length; - for ( var i = 0, l = sorted.length; i < l; i ++ ) { - sorted[ i ].element.style.zIndex = sorted[ i ].element.style.zIndex || zMax - i; + + function getDistanceToSquared( object1, object2 ) { + _a.setFromMatrixPosition( object1.matrixWorld ); + _b.setFromMatrixPosition( object2.matrixWorld ); + return _a.distanceToSquared( _b ); } - }; - this.render = function ( scene, camera ) { - scene.updateMatrixWorld(); - if ( camera.parent === null ) camera.updateMatrixWorld(); - viewMatrix.copy( camera.matrixWorldInverse ); - viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, viewMatrix ); - }; -}; + + function filterAndFlatten( scene ) { + const result = []; + scene.traverseVisible( function ( object ) { + if ( object.isCSS2DObject ) result.push( object ); + } ); + return result; + } + + this.zOrder = function ( scene ) { + const sorted = filterAndFlatten( scene ).sort( function ( a, b ) { + if ( a.renderOrder !== b.renderOrder ) { + return b.renderOrder - a.renderOrder; + } + const distanceA = cache.objects.get( a ).distanceToCameraSquared; + const distanceB = cache.objects.get( b ).distanceToCameraSquared; + return distanceA - distanceB; + } ); + const zMax = sorted.length; + for ( let i = 0, l = sorted.length; i < l; i ++ ) { + sorted[ i ].element.style.zIndex = zMax - i; + } + } + } + THREE.GLTFLoader = ( function () { function GLTFLoader( manager ) { THREE.Loader.call( this, manager ); @@ -35505,7 +35532,7 @@ THREE.OrbitControls = function(object, domElement) { // This option actually enables dollying in and out; left as "zoom" for backwards compatibility. // Set to false to disable zooming this.enableZoom = true; - this.zoomSpeed = 1.0; + this.zoomSpeed = 0.4; // Set to false to disable rotating this.enableRotate = true; @@ -35590,7 +35617,6 @@ THREE.OrbitControls = function(object, domElement) { scope.object.updateProjectionMatrix(); zoomChanged = true; } - this.getPolarAngle = function() { return spherical.phi; @@ -36014,20 +36040,6 @@ THREE.OrbitControls = function(object, domElement) { } else if (event.deltaY > 0) { dollyIn(getZoomScale()); } - - // let mX = (event.clientX / scope.domElement.clientWidth) * 2 - 1; - // let mY = -(event.clientY / scope.domElement.clientHeight) * 2 + 1; - // let vector = new THREE.Vector3(mX, mY, 0); - // vector.unproject(scope.object); - // vector.sub(scope.object.position).setLength(15); - // if (event.deltaY < 0) { - // scope.object.position.add(vector); - // scope.target.add(vector); - // }else { - // scope.object.position.sub(vector); - // scope.target.sub(vector); - // } - scope.update(); } @@ -36347,16 +36359,15 @@ THREE.OrbitControls = function(object, domElement) { document.removeEventListener("mouseup", onMouseUp, false); scope.dispatchEvent(endEvent); - + if(Map_QM){ + Map_QM.collLabel(); + Map_QM.disPlayEvent(); + } state = STATE.NONE; } function onMouseWheel(event) { - if ( - scope.enabled === false || - scope.enableZoom === false || - (state !== STATE.NONE && state !== STATE.ROTATE) - ) + if (scope.enabled === false || scope.enableZoom === false || (state !== STATE.NONE && state !== STATE.ROTATE)) return; event.preventDefault(); @@ -36367,6 +36378,10 @@ THREE.OrbitControls = function(object, domElement) { handleMouseWheel(event); scope.dispatchEvent(endEvent); + if(Map_QM){ + Map_QM.collLabel(); + Map_QM.disPlayEvent(); + } } function onKeyDown(event) { @@ -36494,6 +36509,9 @@ THREE.OrbitControls = function(object, domElement) { default: state = STATE.NONE; } + if(Map_QM){ + Map_QM.disPlayEvent(); + } } function onTouchEnd(event) { @@ -36502,7 +36520,10 @@ THREE.OrbitControls = function(object, domElement) { handleTouchEnd(event); scope.dispatchEvent(endEvent); - + if(Map_QM){ + Map_QM.collLabel(); + Map_QM.disPlayEvent(); + } state = STATE.NONE; } @@ -36515,7 +36536,6 @@ THREE.OrbitControls = function(object, domElement) { // scope.domElement.addEventListener("contextmenu", onContextMenu, false); - scope.domElement.addEventListener("mousedown", onMouseDown, false); scope.domElement.addEventListener("wheel", onMouseWheel, false); @@ -36530,13 +36550,11 @@ THREE.OrbitControls = function(object, domElement) { THREE.OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype); THREE.OrbitControls.prototype.constructor = THREE.OrbitControls; +//////////////////////////////// TweenMax ///////////////// var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(a,b,c){var d=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},e=function(a,b,c){var d,e,f=a.cycle;for(d in f)e=f[d],a[d]="function"==typeof e?e(c,b[c],b):e[c%e.length];delete a.cycle},f=function(a){if("function"==typeof a)return a;var b="object"==typeof a?a:{each:a},c=b.ease,d=b.from||0,e=b.base||0,f={},g=isNaN(d),h=b.axis,i={center:.5,end:1}[d]||0;return function(a,j,k){var l,m,n,o,p,q,r,s,t,u=(k||b).length,v=f[u];if(!v){if(t="auto"===b.grid?0:(b.grid||[1/0])[0],!t){for(r=-(1/0);r<(r=k[t++].getBoundingClientRect().left)&&u>t;);t--}for(v=f[u]=[],l=g?Math.min(t,u)*i-.5:d%t,m=g?u*i/t-.5:d/t|0,r=0,s=1/0,q=0;u>q;q++)n=q%t-l,o=m-(q/t|0),v[q]=p=h?Math.abs("y"===h?o:n):Math.sqrt(n*n+o*o),p>r&&(r=p),s>p&&(s=p);v.max=r-s,v.min=s,v.v=u=b.amount||b.each*(t>u?u:h?"y"===h?u/t:t:Math.max(t,u/t))||0,v.b=0>u?e-u:e}return u=(v[a]-v.min)/v.max,v.b+(c?c.getRatio(u):u)*v.v}},g=function(a,b,d){c.call(this,a,b,d),this._cycle=0,this._yoyo=this.vars.yoyo===!0||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._repeat&&this._uncache(!0),this.render=g.prototype.render},h=1e-8,i=c._internals,j=i.isSelector,k=i.isArray,l=g.prototype=c.to({},.1,{}),m=[];g.version="2.1.2",l.constructor=g,l.kill()._gc=!1,g.killTweensOf=g.killDelayedCallsTo=c.killTweensOf,g.getTweensOf=c.getTweensOf,g.lagSmoothing=c.lagSmoothing,g.ticker=c.ticker,g.render=c.render,g.distribute=f,l.invalidate=function(){return this._yoyo=this.vars.yoyo===!0||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._yoyoEase=null,this._uncache(!0),c.prototype.invalidate.call(this)},l.updateTo=function(a,b){var d,e=this,f=e.ratio,g=e.vars.immediateRender||a.immediateRender;b&&e._startTime.998){var h=e._totalTime;e.render(0,!0,!1),e._initted=!1,e.render(h,!0,!1)}else if(e._initted=!1,e._init(),e._time>0||g)for(var i,j=1/(1-f),k=e._firstPT;k;)i=k.s+k.c,k.c*=j,k.s=i-k.c,k=k._next;return e},l.render=function(a,b,d){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var e,f,g,j,k,l,m,n,o,p=this,q=p._dirty?p.totalDuration():p._totalDuration,r=p._time,s=p._totalTime,t=p._cycle,u=p._duration,v=p._rawPrevTime;if(a>=q-h&&a>=0?(p._totalTime=q,p._cycle=p._repeat,p._yoyo&&0!==(1&p._cycle)?(p._time=0,p.ratio=p._ease._calcEnd?p._ease.getRatio(0):0):(p._time=u,p.ratio=p._ease._calcEnd?p._ease.getRatio(1):1),p._reversed||(e=!0,f="onComplete",d=d||p._timeline.autoRemoveChildren),0===u&&(p._initted||!p.vars.lazy||d)&&(p._startTime===p._timeline._duration&&(a=0),(0>v||0>=a&&a>=-h||v===h&&"isPause"!==p.data)&&v!==a&&(d=!0,v>h&&(f="onReverseComplete")),p._rawPrevTime=n=!b||a||v===a?a:h)):h>a?(p._totalTime=p._time=p._cycle=0,p.ratio=p._ease._calcEnd?p._ease.getRatio(0):0,(0!==s||0===u&&v>0)&&(f="onReverseComplete",e=p._reversed),a>-h?a=0:0>a&&(p._active=!1,0===u&&(p._initted||!p.vars.lazy||d)&&(v>=0&&(d=!0),p._rawPrevTime=n=!b||a||v===a?a:h)),p._initted||(d=!0)):(p._totalTime=p._time=a,0!==p._repeat&&(j=u+p._repeatDelay,p._cycle=p._totalTime/j>>0,0!==p._cycle&&p._cycle===p._totalTime/j&&a>=s&&p._cycle--,p._time=p._totalTime-p._cycle*j,p._yoyo&&0!==(1&p._cycle)&&(p._time=u-p._time,o=p._yoyoEase||p.vars.yoyoEase,o&&(p._yoyoEase||(o!==!0||p._initted?p._yoyoEase=o=o===!0?p._ease:o instanceof Ease?o:Ease.map[o]:(o=p.vars.ease,p._yoyoEase=o=o?o instanceof Ease?o:"function"==typeof o?new Ease(o,p.vars.easeParams):Ease.map[o]||c.defaultEase:c.defaultEase)),p.ratio=o?1-o.getRatio((u-p._time)/u):0)),p._time>u?p._time=u:p._time<0&&(p._time=0)),p._easeType&&!o?(k=p._time/u,l=p._easeType,m=p._easePower,(1===l||3===l&&k>=.5)&&(k=1-k),3===l&&(k*=2),1===m?k*=k:2===m?k*=k*k:3===m?k*=k*k*k:4===m&&(k*=k*k*k*k),p.ratio=1===l?1-k:2===l?k:p._time/u<.5?k/2:1-k/2):o||(p.ratio=p._ease.getRatio(p._time/u))),r===p._time&&!d&&t===p._cycle)return void(s!==p._totalTime&&p._onUpdate&&(b||p._callback("onUpdate")));if(!p._initted){if(p._init(),!p._initted||p._gc)return;if(!d&&p._firstPT&&(p.vars.lazy!==!1&&p._duration||p.vars.lazy&&!p._duration))return p._time=r,p._totalTime=s,p._rawPrevTime=v,p._cycle=t,i.lazyTweens.push(p),void(p._lazy=[a,b]);!p._time||e||o?e&&this._ease._calcEnd&&!o&&(p.ratio=p._ease.getRatio(0===p._time?0:1)):p.ratio=p._ease.getRatio(p._time/u)}for(p._lazy!==!1&&(p._lazy=!1),p._active||!p._paused&&p._time!==r&&a>=0&&(p._active=!0),0===s&&(2===p._initted&&a>0&&p._init(),p._startAt&&(a>=0?p._startAt.render(a,!0,d):f||(f="_dummyGS")),p.vars.onStart&&(0!==p._totalTime||0===u)&&(b||p._callback("onStart"))),g=p._firstPT;g;)g.f?g.t[g.p](g.c*p.ratio+g.s):g.t[g.p]=g.c*p.ratio+g.s,g=g._next;p._onUpdate&&(0>a&&p._startAt&&p._startTime&&p._startAt.render(a,!0,d),b||(p._totalTime!==s||f)&&p._callback("onUpdate")),p._cycle!==t&&(b||p._gc||p.vars.onRepeat&&p._callback("onRepeat")),f&&(!p._gc||d)&&(0>a&&p._startAt&&!p._onUpdate&&p._startTime&&p._startAt.render(a,!0,d),e&&(p._timeline.autoRemoveChildren&&p._enabled(!1,!1),p._active=!1),!b&&p.vars[f]&&p._callback(f),0===u&&p._rawPrevTime===h&&n!==h&&(p._rawPrevTime=0))},g.to=function(a,b,c){return new g(a,b,c)},g.from=function(a,b,c){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,new g(a,b,c)},g.fromTo=function(a,b,c,d){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,new g(a,b,d)},g.staggerTo=g.allTo=function(a,b,h,i,l,n,o){var p,q,r,s,t=[],u=f(h.stagger||i),v=h.cycle,w=(h.startAt||m).cycle;for(k(a)||("string"==typeof a&&(a=c.selector(a)||a),j(a)&&(a=d(a))),a=a||[],p=a.length-1,r=0;p>=r;r++){q={};for(s in h)q[s]=h[s];if(v&&(e(q,a,r),null!=q.duration&&(b=q.duration,delete q.duration)),w){w=q.startAt={};for(s in h.startAt)w[s]=h.startAt[s];e(q.startAt,a,r)}q.delay=u(r,a[r],a)+(q.delay||0),r===p&&l&&(q.onComplete=function(){h.onComplete&&h.onComplete.apply(h.onCompleteScope||this,arguments),l.apply(o||h.callbackScope||this,n||m)}),t[r]=new g(a[r],b,q)}return t},g.staggerFrom=g.allFrom=function(a,b,c,d,e,f,h){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,g.staggerTo(a,b,c,d,e,f,h)},g.staggerFromTo=g.allFromTo=function(a,b,c,d,e,f,h,i){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,g.staggerTo(a,b,d,e,f,h,i)},g.delayedCall=function(a,b,c,d,e){return new g(b,0,{delay:a,onComplete:b,onCompleteParams:c,callbackScope:d,onReverseComplete:b,onReverseCompleteParams:c,immediateRender:!1,useFrames:e,overwrite:0})},g.set=function(a,b){return new g(a,0,b)},g.isTweening=function(a){return c.getTweensOf(a,!0).length>0};var n=function(a,b){for(var d=[],e=0,f=a._first;f;)f instanceof c?d[e++]=f:(b&&(d[e++]=f),d=d.concat(n(f,b)),e=d.length),f=f._next;return d},o=g.getAllTweens=function(b){return n(a._rootTimeline,b).concat(n(a._rootFramesTimeline,b))};g.killAll=function(a,c,d,e){null==c&&(c=!0),null==d&&(d=!0);var f,g,h,i=o(0!=e),j=i.length,k=c&&d&&e;for(h=0;j>h;h++)g=i[h],(k||g instanceof b||(f=g.target===g.vars.onComplete)&&d||c&&!f)&&(a?g.totalTime(g._reversed?0:g.totalDuration()):g._enabled(!1,!1))},g.killChildTweensOf=function(a,b){if(null!=a){var e,f,h,l,m,n=i.tweenLookup;if("string"==typeof a&&(a=c.selector(a)||a),j(a)&&(a=d(a)),k(a))for(l=a.length;--l>-1;)g.killChildTweensOf(a[l],b);else{e=[];for(h in n)for(f=n[h].target.parentNode;f;)f===a&&(e=e.concat(n[h].tweens)),f=f.parentNode;for(m=e.length,l=0;m>l;l++)b&&e[l].totalTime(e[l].totalDuration()),e[l]._enabled(!1,!1)}}};var p=function(a,c,d,e){c=c!==!1,d=d!==!1,e=e!==!1;for(var f,g,h=o(e),i=c&&d&&e,j=h.length;--j>-1;)g=h[j],(i||g instanceof b||(f=g.target===g.vars.onComplete)&&d||c&&!f)&&g.paused(a)};return g.pauseAll=function(a,b,c){p(!0,a,b,c)},g.resumeAll=function(a,b,c){p(!1,a,b,c)},g.globalTimeScale=function(b){var d=a._rootTimeline,e=c.ticker.time;return arguments.length?(b=b||h,d._startTime=e-(e-d._startTime)*d._timeScale/b,d=a._rootFramesTimeline,e=c.ticker.frame,d._startTime=e-(e-d._startTime)*d._timeScale/b,d._timeScale=a._rootTimeline._timeScale=b,b):d._timeScale},l.progress=function(a,b){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!==(1&this._cycle)?1-a:a)+this._cycle*(this._duration+this._repeatDelay),b):this._time/this.duration()},l.totalProgress=function(a,b){return arguments.length?this.totalTime(this.totalDuration()*a,b):this._totalTime/this.totalDuration()},l.time=function(a,b){if(!arguments.length)return this._time;this._dirty&&this.totalDuration();var c=this._duration,d=this._cycle,e=d*(c+this._repeatDelay);return a>c&&(a=c),this.totalTime(this._yoyo&&1&d?c-a+e:this._repeat?a+e:a,b)},l.duration=function(b){return arguments.length?a.prototype.duration.call(this,b):this._duration},l.totalDuration=function(a){return arguments.length?-1===this._repeat?this:this.duration((a-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},l.repeat=function(a){return arguments.length?(this._repeat=a,this._uncache(!0)):this._repeat},l.repeatDelay=function(a){return arguments.length?(this._repeatDelay=a,this._uncache(!0)):this._repeatDelay},l.yoyo=function(a){return arguments.length?(this._yoyo=a,this):this._yoyo},g},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(a,b,c){var d=function(a){b.call(this,a);var c,d,e=this,f=e.vars;e._labels={},e.autoRemoveChildren=!!f.autoRemoveChildren,e.smoothChildTiming=!!f.smoothChildTiming,e._sortChildren=!0,e._onUpdate=f.onUpdate;for(d in f)c=f[d],i(c)&&-1!==c.join("").indexOf("{self}")&&(f[d]=e._swapSelfInParams(c));i(f.tweens)&&e.add(f.tweens,0,f.align,f.stagger)},e=1e-8,f=c._internals,g=d._internals={},h=f.isSelector,i=f.isArray,j=f.lazyTweens,k=f.lazyRender,l=_gsScope._gsDefine.globals,m=function(a){var b,c={};for(b in a)c[b]=a[b];return c},n=function(a,b,c){var d,e,f=a.cycle;for(d in f)e=f[d],a[d]="function"==typeof e?e(c,b[c],b):e[c%e.length];delete a.cycle},o=g.pauseCallback=function(){},p=function(a){var b,c=[],d=a.length;for(b=0;b!==d;c.push(a[b++]));return c},q=function(a,b,c,d){var e="immediateRender";return e in b||(b[e]=!(c&&c[e]===!1||d)),b},r=function(a){if("function"==typeof a)return a;var b="object"==typeof a?a:{each:a},c=b.ease,d=b.from||0,e=b.base||0,f={},g=isNaN(d),h=b.axis,i={center:.5,end:1}[d]||0;return function(a,j,k){var l,m,n,o,p,q,r,s,t,u=(k||b).length,v=f[u];if(!v){if(t="auto"===b.grid?0:(b.grid||[1/0])[0],!t){for(r=-(1/0);r<(r=k[t++].getBoundingClientRect().left)&&u>t;);t--}for(v=f[u]=[],l=g?Math.min(t,u)*i-.5:d%t,m=g?u*i/t-.5:d/t|0,r=0,s=1/0,q=0;u>q;q++)n=q%t-l,o=m-(q/t|0),v[q]=p=h?Math.abs("y"===h?o:n):Math.sqrt(n*n+o*o),p>r&&(r=p),s>p&&(s=p);v.max=r-s,v.min=s,v.v=u=b.amount||b.each*(t>u?u:h?"y"===h?u/t:t:Math.max(t,u/t))||0,v.b=0>u?e-u:e}return u=(v[a]-v.min)/v.max,v.b+(c?c.getRatio(u):u)*v.v}},s=d.prototype=new b;return d.version="2.1.2",d.distribute=r,s.constructor=d,s.kill()._gc=s._forcingPlayhead=s._hasPause=!1,s.to=function(a,b,d,e){var f=d.repeat&&l.TweenMax||c;return b?this.add(new f(a,b,d),e):this.set(a,d,e)},s.from=function(a,b,d,e){return this.add((d.repeat&&l.TweenMax||c).from(a,b,q(this,d)),e)},s.fromTo=function(a,b,d,e,f){var g=e.repeat&&l.TweenMax||c;return e=q(this,e,d),b?this.add(g.fromTo(a,b,d,e),f):this.set(a,e,f)},s.staggerTo=function(a,b,e,f,g,i,j,k){var l,o,q=new d({onComplete:i,onCompleteParams:j,callbackScope:k,smoothChildTiming:this.smoothChildTiming}),s=r(e.stagger||f),t=e.startAt,u=e.cycle;for("string"==typeof a&&(a=c.selector(a)||a),a=a||[],h(a)&&(a=p(a)),o=0;of&&(e=1),i.add(g,f)),g=h;return j.add(i,0),e&&i.totalDuration(),i},s.add=function(e,f,g,h){var j,k,l,m,n,o,p=this;if("number"!=typeof f&&(f=p._parseTimeOrLabel(f,0,!0,e)),!(e instanceof a)){if(e instanceof Array||e&&e.push&&i(e)){for(g=g||"normal",h=h||0,j=f,k=e.length,l=0;k>l;l++)i(m=e[l])&&(m=new d({tweens:m})),p.add(m,j),"string"!=typeof m&&"function"!=typeof m&&("sequence"===g?j=m._startTime+m.totalDuration()/m._timeScale:"start"===g&&(m._startTime-=m.delay())),j+=h;return p._uncache(!0)}if("string"==typeof e)return p.addLabel(e,f);if("function"!=typeof e)throw"Cannot add "+e+" into the timeline; it is not a tween, timeline, function, or string.";e=c.delayedCall(0,e)}if(b.prototype.add.call(p,e,f),(e._time||!e._duration&&e._initted)&&(j=(p.rawTime()-e._startTime)*e._timeScale,(!e._duration||Math.abs(Math.max(0,Math.min(e.totalDuration(),j)))-e._totalTime>1e-5)&&e.render(j,!1,!1)),(p._gc||p._time===p._duration)&&!p._paused&&p._duratione._startTime;n._timeline;)o&&n._timeline.smoothChildTiming?n.totalTime(n._totalTime,!0):n._gc&&n._enabled(!0,!1),n=n._timeline;return p},s.remove=function(b){if(b instanceof a){this._remove(b,!1);var c=b._timeline=b.vars.useFrames?a._rootFramesTimeline:a._rootTimeline;return b._startTime=(b._paused?b._pauseTime:c._time)-(b._reversed?b.totalDuration()-b._totalTime:b._totalTime)/b._timeScale,this}if(b instanceof Array||b&&b.push&&i(b)){for(var d=b.length;--d>-1;)this.remove(b[d]);return this}return"string"==typeof b?this.removeLabel(b):this.kill(null,b)},s._remove=function(a,c){b.prototype._remove.call(this,a,c);var d=this._last;return d?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},s.append=function(a,b){return this.add(a,this._parseTimeOrLabel(null,b,!0,a))},s.insert=s.insertMultiple=function(a,b,c,d){return this.add(a,b||0,c,d)},s.appendMultiple=function(a,b,c,d){return this.add(a,this._parseTimeOrLabel(null,b,!0,a),c,d)},s.addLabel=function(a,b){return this._labels[a]=this._parseTimeOrLabel(b),this},s.addPause=function(a,b,d,e){var f=c.delayedCall(0,o,d,e||this);return f.vars.onComplete=f.vars.onReverseComplete=b,f.data="isPause",this._hasPause=!0,this.add(f,a)},s.removeLabel=function(a){return delete this._labels[a],this},s.getLabelTime=function(a){return null!=this._labels[a]?this._labels[a]:-1},s._parseTimeOrLabel=function(b,c,d,e){var f,g;if(e instanceof a&&e.timeline===this)this.remove(e);else if(e&&(e instanceof Array||e.push&&i(e)))for(g=e.length;--g>-1;)e[g]instanceof a&&e[g].timeline===this&&this.remove(e[g]);if(f="number"!=typeof b||c?this.duration()>99999999999?this.recent().endTime(!1):this._duration:0,"string"==typeof c)return this._parseTimeOrLabel(c,d&&"number"==typeof b&&null==this._labels[c]?b-f:0,d);if(c=c||0,"string"!=typeof b||!isNaN(b)&&null==this._labels[b])null==b&&(b=f);else{if(g=b.indexOf("="),-1===g)return null==this._labels[b]?d?this._labels[b]=f+c:c:this._labels[b]+c;c=parseInt(b.charAt(g-1)+"1",10)*Number(b.substr(g+1)),b=g>1?this._parseTimeOrLabel(b.substr(0,g-1),0,d):f}return Number(b)+c},s.seek=function(a,b){return this.totalTime("number"==typeof a?a:this._parseTimeOrLabel(a),b!==!1)},s.stop=function(){return this.paused(!0)},s.gotoAndPlay=function(a,b){return this.play(a,b)},s.gotoAndStop=function(a,b){return this.pause(a,b)},s.render=function(a,b,c){this._gc&&this._enabled(!0,!1);var d,f,g,h,i,l,m,n,o=this,p=o._time,q=o._dirty?o.totalDuration():o._totalDuration,r=o._startTime,s=o._timeScale,t=o._paused;if(p!==o._time&&(a+=o._time-p),a>=q-e&&a>=0)o._totalTime=o._time=q,o._reversed||o._hasPausedChild()||(f=!0,h="onComplete",i=!!o._timeline.autoRemoveChildren,0===o._duration&&(0>=a&&a>=-e||o._rawPrevTime<0||o._rawPrevTime===e)&&o._rawPrevTime!==a&&o._first&&(i=!0,o._rawPrevTime>e&&(h="onReverseComplete"))),o._rawPrevTime=o._duration||!b||a||o._rawPrevTime===a?a:e,a=q+1e-4;else if(e>a)if(o._totalTime=o._time=0,a>-e&&(a=0),(0!==p||0===o._duration&&o._rawPrevTime!==e&&(o._rawPrevTime>0||0>a&&o._rawPrevTime>=0))&&(h="onReverseComplete",f=o._reversed),0>a)o._active=!1,o._timeline.autoRemoveChildren&&o._reversed?(i=f=!0,h="onReverseComplete"):o._rawPrevTime>=0&&o._first&&(i=!0),o._rawPrevTime=a;else{if(o._rawPrevTime=o._duration||!b||a||o._rawPrevTime===a?a:e,0===a&&f)for(d=o._first;d&&0===d._startTime;)d._duration||(f=!1),d=d._next;a=0,o._initted||(i=!0)}else{if(o._hasPause&&!o._forcingPlayhead&&!b){if(a>=p)for(d=o._first;d&&d._startTime<=a&&!l;)d._duration||"isPause"!==d.data||d.ratio||0===d._startTime&&0===o._rawPrevTime||(l=d),d=d._next;else for(d=o._last;d&&d._startTime>=a&&!l;)d._duration||"isPause"===d.data&&d._rawPrevTime>0&&(l=d),d=d._prev;l&&(o._time=o._totalTime=a=l._startTime,n=o._startTime+a/o._timeScale)}o._totalTime=o._time=o._rawPrevTime=a}if(o._time!==p&&o._first||c||i||l){if(o._initted||(o._initted=!0),o._active||!o._paused&&o._time!==p&&a>0&&(o._active=!0),0===p&&o.vars.onStart&&(0===o._time&&o._duration||b||o._callback("onStart")),m=o._time,m>=p)for(d=o._first;d&&(g=d._next,m===o._time&&(!o._paused||t));)(d._active||d._startTime<=m&&!d._paused&&!d._gc)&&(l===d&&(o.pause(),o._pauseTime=n),d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)),d=g;else for(d=o._last;d&&(g=d._prev,m===o._time&&(!o._paused||t));){if(d._active||d._startTime<=p&&!d._paused&&!d._gc){if(l===d){for(l=d._prev;l&&l.endTime()>o._time;)l.render(l._reversed?l.totalDuration()-(a-l._startTime)*l._timeScale:(a-l._startTime)*l._timeScale,b,c),l=l._prev;l=null,o.pause(),o._pauseTime=n}d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)}d=g}o._onUpdate&&(b||(j.length&&k(),o._callback("onUpdate"))),h&&(o._gc||(r===o._startTime||s!==o._timeScale)&&(0===o._time||q>=o.totalDuration())&&(f&&(j.length&&k(),o._timeline.autoRemoveChildren&&o._enabled(!1,!1),o._active=!1),!b&&o.vars[h]&&o._callback(h)))}},s._hasPausedChild=function(){for(var a=this._first;a;){if(a._paused||a instanceof d&&a._hasPausedChild())return!0;a=a._next}return!1},s.getChildren=function(a,b,d,e){e=e||-9999999999;for(var f=[],g=this._first,h=0;g;)g._startTime-1;)(d[e].timeline===this||b&&this._contains(d[e]))&&(g[h++]=d[e]);return f&&this._enabled(!1,!0),g},s.recent=function(){return this._recent},s._contains=function(a){for(var b=a.timeline;b;){if(b===this)return!0;b=b.timeline}return!1},s.shiftChildren=function(a,b,c){c=c||0;for(var d,e=this._first,f=this._labels;e;)e._startTime>=c&&(e._startTime+=a),e=e._next;if(b)for(d in f)f[d]>=c&&(f[d]+=a);return this._uncache(!0)},s._kill=function(a,b){if(!a&&!b)return this._enabled(!1,!1);for(var c=b?this.getTweensOf(b):this.getChildren(!0,!0,!1),d=c.length,e=!1;--d>-1;)c[d]._kill(a,b)&&(e=!0);return e},s.clear=function(a){var b=this.getChildren(!1,!0,!0),c=b.length;for(this._time=this._totalTime=0;--c>-1;)b[c]._enabled(!1,!1);return a!==!1&&(this._labels={}),this._uncache(!0)},s.invalidate=function(){for(var b=this._first;b;)b.invalidate(),b=b._next;return a.prototype.invalidate.call(this)},s._enabled=function(a,c){if(a===this._gc)for(var d=this._first;d;)d._enabled(a,!0),d=d._next;return b.prototype._enabled.call(this,a,c)},s.totalTime=function(b,c,d){this._forcingPlayhead=!0;var e=a.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,e},s.duration=function(a){return arguments.length?(0!==this.duration()&&0!==a&&this.timeScale(this._duration/a),this):(this._dirty&&this.totalDuration(),this._duration)},s.totalDuration=function(a){if(!arguments.length){if(this._dirty){for(var b,c,d=0,e=this,f=e._last,g=999999999999;f;)b=f._prev,f._dirty&&f.totalDuration(),f._startTime>g&&e._sortChildren&&!f._paused&&!e._calculatingDuration?(e._calculatingDuration=1,e.add(f,f._startTime-f._delay),e._calculatingDuration=0):g=f._startTime,f._startTime<0&&!f._paused&&(d-=f._startTime,e._timeline.smoothChildTiming&&(e._startTime+=f._startTime/e._timeScale,e._time-=f._startTime,e._totalTime-=f._startTime,e._rawPrevTime-=f._startTime),e.shiftChildren(-f._startTime,!1,-9999999999),g=0),c=f._startTime+f._totalDuration/f._timeScale,c>d&&(d=c),f=b;e._duration=e._totalDuration=d,e._dirty=!1}return this._totalDuration}return a&&this.totalDuration()?this.timeScale(this._totalDuration/a):this},s.paused=function(b){if(b===!1&&this._paused)for(var c=this._first;c;)c._startTime===this._time&&"isPause"===c.data&&(c._rawPrevTime=0),c=c._next;return a.prototype.paused.apply(this,arguments)},s.usesFrames=function(){for(var b=this._timeline;b._timeline;)b=b._timeline;return b===a._rootFramesTimeline},s.rawTime=function(a){return a&&(this._paused||this._repeat&&this.time()>0&&this.totalProgress()<1)?this._totalTime%(this._duration+this._repeatDelay):this._paused?this._totalTime:(this._timeline.rawTime(a)-this._startTime)*this._timeScale},d},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(a,b,c){var d=function(b){a.call(this,b),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=!!this.vars.yoyo,this._dirty=!0},e=1e-8,f=b._internals,g=f.lazyTweens,h=f.lazyRender,i=_gsScope._gsDefine.globals,j=new c(null,null,1,0),k=d.prototype=new a;return k.constructor=d,k.kill()._gc=!1,d.version="2.1.2",k.invalidate=function(){return this._yoyo=!!this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),a.prototype.invalidate.call(this)},k.addCallback=function(a,c,d,e){return this.add(b.delayedCall(0,a,d,e),c)},k.removeCallback=function(a,b){if(a)if(null==b)this._kill(null,a);else for(var c=this.getTweensOf(a,!1),d=c.length,e=this._parseTimeOrLabel(b);--d>-1;)c[d]._startTime===e&&c[d]._enabled(!1,!1);return this},k.removePause=function(b){return this.removeCallback(a._internals.pauseCallback,b)},k.tweenTo=function(a,c){c=c||{};var d,e,f,g={ease:j,useFrames:this.usesFrames(),immediateRender:!1,lazy:!1},h=c.repeat&&i.TweenMax||b;for(e in c)g[e]=c[e];return g.time=this._parseTimeOrLabel(a),d=Math.abs(Number(g.time)-this._time)/this._timeScale||.001,f=new h(this,d,g),g.onStart=function(){f.target.paused(!0),f.vars.time===f.target.time()||d!==f.duration()||f.isFromTo||f.duration(Math.abs(f.vars.time-f.target.time())/f.target._timeScale).render(f.time(),!0,!0),c.onStart&&c.onStart.apply(c.onStartScope||c.callbackScope||f,c.onStartParams||[])},f},k.tweenFromTo=function(a,b,c){c=c||{},a=this._parseTimeOrLabel(a),c.startAt={onComplete:this.seek,onCompleteParams:[a],callbackScope:this},c.immediateRender=c.immediateRender!==!1;var d=this.tweenTo(b,c);return d.isFromTo=1,d.duration(Math.abs(d.vars.time-a)/this._timeScale||.001)},k.render=function(a,b,c){this._gc&&this._enabled(!0,!1);var d,f,i,j,k,l,m,n,o,p=this,q=p._time,r=p._dirty?p.totalDuration():p._totalDuration,s=p._duration,t=p._totalTime,u=p._startTime,v=p._timeScale,w=p._rawPrevTime,x=p._paused,y=p._cycle;if(q!==p._time&&(a+=p._time-q),a>=r-e&&a>=0)p._locked||(p._totalTime=r,p._cycle=p._repeat),p._reversed||p._hasPausedChild()||(f=!0,j="onComplete",k=!!p._timeline.autoRemoveChildren,0===p._duration&&(0>=a&&a>=-e||0>w||w===e)&&w!==a&&p._first&&(k=!0,w>e&&(j="onReverseComplete"))),p._rawPrevTime=p._duration||!b||a||p._rawPrevTime===a?a:e,p._yoyo&&1&p._cycle?p._time=a=0:(p._time=s,a=s+1e-4);else if(e>a)if(p._locked||(p._totalTime=p._cycle=0),p._time=0,a>-e&&(a=0),(0!==q||0===s&&w!==e&&(w>0||0>a&&w>=0)&&!p._locked)&&(j="onReverseComplete",f=p._reversed),0>a)p._active=!1,p._timeline.autoRemoveChildren&&p._reversed?(k=f=!0,j="onReverseComplete"):w>=0&&p._first&&(k=!0),p._rawPrevTime=a;else{if(p._rawPrevTime=s||!b||a||p._rawPrevTime===a?a:e,0===a&&f)for(d=p._first;d&&0===d._startTime;)d._duration||(f=!1),d=d._next;a=0,p._initted||(k=!0)}else if(0===s&&0>w&&(k=!0),p._time=p._rawPrevTime=a,p._locked||(p._totalTime=a,0!==p._repeat&&(l=s+p._repeatDelay,p._cycle=p._totalTime/l>>0,p._cycle&&p._cycle===p._totalTime/l&&a>=t&&p._cycle--,p._time=p._totalTime-p._cycle*l,p._yoyo&&1&p._cycle&&(p._time=s-p._time),p._time>s?(p._time=s,a=s+1e-4):p._time<0?p._time=a=0:a=p._time)),p._hasPause&&!p._forcingPlayhead&&!b){if(a=p._time,a>=q||p._repeat&&y!==p._cycle)for(d=p._first;d&&d._startTime<=a&&!m;)d._duration||"isPause"!==d.data||d.ratio||0===d._startTime&&0===p._rawPrevTime||(m=d),d=d._next;else for(d=p._last;d&&d._startTime>=a&&!m;)d._duration||"isPause"===d.data&&d._rawPrevTime>0&&(m=d),d=d._prev;m&&(o=p._startTime+m._startTime/p._timeScale,m._startTime0&&(p._active=!0),0===t&&p.vars.onStart&&(0===p._totalTime&&p._totalDuration||b||p._callback("onStart")),n=p._time,n>=q)for(d=p._first;d&&(i=d._next,n===p._time&&(!p._paused||x));)(d._active||d._startTime<=p._time&&!d._paused&&!d._gc)&&(m===d&&(p.pause(),p._pauseTime=o),d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)),d=i;else for(d=p._last;d&&(i=d._prev,n===p._time&&(!p._paused||x));){if(d._active||d._startTime<=q&&!d._paused&&!d._gc){if(m===d){for(m=d._prev;m&&m.endTime()>p._time;)m.render(m._reversed?m.totalDuration()-(a-m._startTime)*m._timeScale:(a-m._startTime)*m._timeScale,b,c),m=m._prev;m=null,p.pause(),p._pauseTime=o}d._reversed?d.render((d._dirty?d.totalDuration():d._totalDuration)-(a-d._startTime)*d._timeScale,b,c):d.render((a-d._startTime)*d._timeScale,b,c)}d=i}p._onUpdate&&(b||(g.length&&h(),p._callback("onUpdate"))),j&&(p._locked||p._gc||(u===p._startTime||v!==p._timeScale)&&(0===p._time||r>=p.totalDuration())&&(f&&(g.length&&h(),p._timeline.autoRemoveChildren&&p._enabled(!1,!1),p._active=!1),!b&&p.vars[j]&&p._callback(j)))},k.getActive=function(a,b,c){var d,e,f=[],g=this.getChildren(a||null==a,b||null==a,!!c),h=0,i=g.length;for(d=0;i>d;d++)e=g[d],e.isActive()&&(f[h++]=e);return f},k.getLabelAfter=function(a){a||0!==a&&(a=this._time);var b,c=this.getLabelsArray(),d=c.length;for(b=0;d>b;b++)if(c[b].time>a)return c[b].name;return null},k.getLabelBefore=function(a){null==a&&(a=this._time);for(var b=this.getLabelsArray(),c=b.length;--c>-1;)if(b[c].timec&&(a=c),this.totalTime(this._yoyo&&1&d?c-a+e:this._repeat?a+e:a,b)},k.repeat=function(a){return arguments.length?(this._repeat=a,this._uncache(!0)):this._repeat},k.repeatDelay=function(a){return arguments.length?(this._repeatDelay=a,this._uncache(!0)):this._repeatDelay},k.yoyo=function(a){return arguments.length?(this._yoyo=a,this):this._yoyo},k.currentLabel=function(a){return arguments.length?this.seek(a,!0):this.getLabelBefore(this._time+e)},d},!0),function(){var a=180/Math.PI,b=[],c=[],d=[],e={},f=_gsScope._gsDefine.globals,g=function(a,b,c,d){c===d&&(c=d-(d-b)/1e6),a===b&&(b=a+(c-a)/1e6),this.a=a,this.b=b,this.c=c,this.d=d,this.da=d-a,this.ca=c-a,this.ba=b-a},h=",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",i=function(a,b,c,d){var e={a:a},f={},g={},h={c:d},i=(a+b)/2,j=(b+c)/2,k=(c+d)/2,l=(i+j)/2,m=(j+k)/2,n=(m-l)/8;return e.b=i+(a-i)/4,f.b=l+n,e.c=f.a=(e.b+f.b)/2,f.c=g.a=(l+m)/2,g.b=m-n,h.b=k+(d-k)/4,g.c=h.a=(g.b+h.b)/2,[e,f,g,h]},j=function(a,e,f,g,h){var j,k,l,m,n,o,p,q,r,s,t,u,v,w=a.length-1,x=0,y=a[0].a;for(j=0;w>j;j++)n=a[x],k=n.a,l=n.d,m=a[x+1].d,h?(t=b[j],u=c[j],v=(u+t)*e*.25/(g?.5:d[j]||.5),o=l-(l-k)*(g?.5*e:0!==t?v/t:0),p=l+(m-l)*(g?.5*e:0!==u?v/u:0),q=l-(o+((p-o)*(3*t/(t+u)+.5)/4||0))):(o=l-(l-k)*e*.5,p=l+(m-l)*e*.5,q=l-(o+p)/2),o+=q,p+=q,n.c=r=o,0!==j?n.b=y:n.b=y=n.a+.6*(n.c-n.a),n.da=l-k,n.ca=r-k,n.ba=y-k,f?(s=i(k,y,r,l),a.splice(x,1,s[0],s[1],s[2],s[3]),x+=4):x++,y=p;n=a[x],n.b=y,n.c=y+.4*(n.d-y),n.da=n.d-n.a,n.ca=n.c-n.a,n.ba=y-n.a,f&&(s=i(n.a,y,n.c,n.d),a.splice(x,1,s[0],s[1],s[2],s[3]))},k=function(a,d,e,f){var h,i,j,k,l,m,n=[];if(f)for(a=[f].concat(a),i=a.length;--i>-1;)"string"==typeof(m=a[i][d])&&"="===m.charAt(1)&&(a[i][d]=f[d]+Number(m.charAt(0)+m.substr(2)));if(h=a.length-2,0>h)return n[0]=new g(a[0][d],0,0,a[0][d]),n;for(i=0;h>i;i++)j=a[i][d],k=a[i+1][d],n[i]=new g(j,0,0,k),e&&(l=a[i+2][d],b[i]=(b[i]||0)+(k-j)*(k-j),c[i]=(c[i]||0)+(l-k)*(l-k));return n[i]=new g(a[i][d],0,0,a[i+1][d]),n},l=function(a,f,g,i,l,m){var n,o,p,q,r,s,t,u,v={},w=[],x=m||a[0];l="string"==typeof l?","+l+",":h,null==f&&(f=1);for(o in a[0])w.push(o);if(a.length>1){for(u=a[a.length-1],t=!0,n=w.length;--n>-1;)if(o=w[n],Math.abs(x[o]-u[o])>.05){t=!1;break}t&&(a=a.concat(),m&&a.unshift(m),a.push(a[1]),m=a[a.length-3])}for(b.length=c.length=d.length=0,n=w.length;--n>-1;)o=w[n],e[o]=-1!==l.indexOf(","+o+","),v[o]=k(a,o,e[o],m);for(n=b.length;--n>-1;)b[n]=Math.sqrt(b[n]),c[n]=Math.sqrt(c[n]);if(!i){for(n=w.length;--n>-1;)if(e[o])for(p=v[w[n]],s=p.length-1,q=0;s>q;q++)r=p[q+1].da/c[q]+p[q].da/b[q]||0,d[q]=(d[q]||0)+r*r;for(n=d.length;--n>-1;)d[n]=Math.sqrt(d[n]); }for(n=w.length,q=g?4:1;--n>-1;)o=w[n],p=v[o],j(p,f,g,i,e[o]),t&&(p.splice(0,q),p.splice(p.length-q,q));return v},m=function(a,b,c){b=b||"soft";var d,e,f,h,i,j,k,l,m,n,o,p={},q="cubic"===b?3:2,r="soft"===b,s=[];if(r&&c&&(a=[c].concat(a)),null==a||a.length-1;){for(m=s[j],p[m]=i=[],n=0,l=a.length,k=0;l>k;k++)d=null==c?a[k][m]:"string"==typeof(o=a[k][m])&&"="===o.charAt(1)?c[m]+Number(o.charAt(0)+o.substr(2)):Number(o),r&&k>1&&l-1>k&&(i[n++]=(d+i[n-2])/2),i[n++]=d;for(l=n-q+1,n=0,k=0;l>k;k+=q)d=i[k],e=i[k+1],f=i[k+2],h=2===q?0:i[k+3],i[n++]=o=3===q?new g(d,e,f,h):new g(d,(2*e+d)/3,(2*e+f)/3,f);i.length=n}return p},n=function(a,b,c){for(var d,e,f,g,h,i,j,k,l,m,n,o=1/c,p=a.length;--p>-1;)for(m=a[p],f=m.a,g=m.d-f,h=m.c-f,i=m.b-f,d=e=0,k=1;c>=k;k++)j=o*k,l=1-j,d=e-(e=(j*j*g+3*l*(j*h+l*i))*j),n=p*c+k-1,b[n]=(b[n]||0)+d*d},o=function(a,b){b=b>>0||6;var c,d,e,f,g=[],h=[],i=0,j=0,k=b-1,l=[],m=[];for(c in a)n(a[c],g,b);for(e=g.length,d=0;e>d;d++)i+=Math.sqrt(g[d]),f=d%b,m[f]=i,f===k&&(j+=i,f=d/b>>0,l[f]=m,h[f]=j,i=0,m=[]);return{length:j,lengths:h,segments:l}},p=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.8",API:2,global:!0,init:function(a,b,c){this._target=a,b instanceof Array&&(b={values:b}),this._func={},this._mod={},this._props=[],this._timeRes=null==b.timeResolution?6:parseInt(b.timeResolution,10);var d,e,f,g,h,i=b.values||[],j={},k=i[0],n=b.autoRotate||c.vars.orientToBezier;this._autoRotate=n?n instanceof Array?n:[["x","y","rotation",n===!0?0:Number(n)||0]]:null;for(d in k)this._props.push(d);for(f=this._props.length;--f>-1;)d=this._props[f],this._overwriteProps.push(d),e=this._func[d]="function"==typeof a[d],j[d]=e?a[d.indexOf("set")||"function"!=typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]():parseFloat(a[d]),h||j[d]!==i[0][d]&&(h=j);if(this._beziers="cubic"!==b.type&&"quadratic"!==b.type&&"soft"!==b.type?l(i,isNaN(b.curviness)?1:b.curviness,!1,"thruBasic"===b.type,b.correlate,h):m(i,b.type,j),this._segCount=this._beziers[d].length,this._timeRes){var p=o(this._beziers,this._timeRes);this._length=p.length,this._lengths=p.lengths,this._segments=p.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(n=this._autoRotate)for(this._initialRotations=[],n[0]instanceof Array||(this._autoRotate=n=[n]),f=n.length;--f>-1;){for(g=0;3>g;g++)d=n[f][g],this._func[d]="function"==typeof a[d]?a[d.indexOf("set")||"function"!=typeof a["get"+d.substr(3)]?d:"get"+d.substr(3)]:!1;d=n[f][2],this._initialRotations[f]=(this._func[d]?this._func[d].call(this._target):this._target[d])||0,this._overwriteProps.push(d)}return this._startRatio=c.vars.runBackwards?1:0,!0},set:function(b){var c,d,e,f,g,h,i,j,k,l,m=this._segCount,n=this._func,o=this._target,p=b!==this._startRatio;if(this._timeRes){if(k=this._lengths,l=this._curSeg,b*=this._length,e=this._li,b>this._l2&&m-1>e){for(j=m-1;j>e&&(this._l2=k[++e])<=b;);this._l1=k[e-1],this._li=e,this._curSeg=l=this._segments[e],this._s2=l[this._s1=this._si=0]}else if(b0){for(;e>0&&(this._l1=k[--e])>=b;);0===e&&bthis._s2&&ee&&(this._s2=l[++e])<=b;);this._s1=l[e-1],this._si=e}else if(b0){for(;e>0&&(this._s1=l[--e])>=b;);0===e&&bb?0:b>=1?m-1:m*b>>0,h=(b-c*(1/m))*m;for(d=1-h,e=this._props.length;--e>-1;)f=this._props[e],g=this._beziers[f][c],i=(h*h*g.da+3*d*(h*g.ca+d*g.ba))*h+g.a,this._mod[f]&&(i=this._mod[f](i,o)),n[f]?o[f](i):o[f]=i;if(this._autoRotate){var q,r,s,t,u,v,w,x=this._autoRotate;for(e=x.length;--e>-1;)f=x[e][2],v=x[e][3]||0,w=x[e][4]===!0?1:a,g=this._beziers[x[e][0]],q=this._beziers[x[e][1]],g&&q&&(g=g[c],q=q[c],r=g.a+(g.b-g.a)*h,t=g.b+(g.c-g.b)*h,r+=(t-r)*h,t+=(g.c+(g.d-g.c)*h-t)*h,s=q.a+(q.b-q.a)*h,u=q.b+(q.c-q.b)*h,s+=(u-s)*h,u+=(q.c+(q.d-q.c)*h-u)*h,i=p?Math.atan2(u-s,t-r)*w+v:this._initialRotations[e],this._mod[f]&&(i=this._mod[f](i,o)),n[f]?o[f](i):o[f]=i)}}}),q=p.prototype;p.bezierThrough=l,p.cubicToQuadratic=i,p._autoCSS=!0,p.quadraticToCubic=function(a,b,c){return new g(a,(2*b+a)/3,(2*b+c)/3,c)},p._cssRegister=function(){var a=f.CSSPlugin;if(a){var b=a._internals,c=b._parseToProxy,d=b._setPluginRatio,e=b.CSSPropTween;b._registerComplexSpecialProp("bezier",{parser:function(a,b,f,g,h,i){b instanceof Array&&(b={values:b}),i=new p;var j,k,l,m=b.values,n=m.length-1,o=[],q={};if(0>n)return h;for(j=0;n>=j;j++)l=c(a,m[j],g,h,i,n!==j),o[j]=l.end;for(k in b)q[k]=b[k];return q.values=o,h=new e(a,"bezier",0,0,l.pt,2),h.data=l,h.plugin=i,h.setRatio=d,0===q.autoRotate&&(q.autoRotate=!0),!q.autoRotate||q.autoRotate instanceof Array||(j=q.autoRotate===!0?0:Number(q.autoRotate),q.autoRotate=null!=l.end.left?[["left","top","rotation",j,!1]]:null!=l.end.x?[["x","y","rotation",j,!1]]:!1),q.autoRotate&&(g._transform||g._enableTransforms(!1),l.autoRotate=g._target._gsTransform,l.proxy.rotation=l.autoRotate.rotation||0,g._overwriteProps.push("rotation")),i._onInitTween(l.proxy,q,g._tween),h}})}},q._mod=function(a){for(var b,c=this._overwriteProps,d=c.length;--d>-1;)b=a[c[d]],b&&"function"==typeof b&&(this._mod[c[d]]=b)},q._kill=function(a){var b,c,d=this._props;for(b in this._beziers)if(b in a)for(delete this._beziers[b],delete this._func[b],c=d.length;--c>-1;)d[c]===b&&d.splice(c,1);if(d=this._autoRotate)for(c=d.length;--c>-1;)a[d[c][2]]&&d.splice(c,1);return this._super._kill.call(this,a)}}(),_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(a,b){var c,d,e,f,g=function(){a.call(this,"css"),this._overwriteProps.length=0,this.setRatio=g.prototype.setRatio},h=_gsScope._gsDefine.globals,i={},j=g.prototype=new a("css");j.constructor=g,g.version="2.1.0",g.API=2,g.defaultTransformPerspective=0,g.defaultSkewType="compensated",g.defaultSmoothOrigin=!0,j="px",g.suffixMap={top:j,right:j,bottom:j,left:j,width:j,height:j,fontSize:j,padding:j,margin:j,perspective:j,lineHeight:""};var k,l,m,n,o,p,q,r,s=/(?:\-|\.|\b)(\d|\.|e\-)+/g,t=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,u=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,v=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,w=/(?:\d|\-|\+|=|#|\.)*/g,x=/opacity *= *([^)]*)/i,y=/opacity:([^;]*)/i,z=/alpha\(opacity *=.+?\)/i,A=/^(rgb|hsl)/,B=/([A-Z])/g,C=/-([a-z])/gi,D=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,E=function(a,b){return b.toUpperCase()},F=/(?:Left|Right|Width)/i,G=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,H=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,I=/,(?=[^\)]*(?:\(|$))/gi,J=/[\s,\(]/i,K=Math.PI/180,L=180/Math.PI,M={},N={style:{}},O=_gsScope.document||{createElement:function(){return N}},P=function(a,b){return b&&O.createElementNS?O.createElementNS(b,a):O.createElement(a)},Q=P("div"),R=P("img"),S=g._internals={_specialProps:i},T=(_gsScope.navigator||{}).userAgent||"",U=function(){var a=T.indexOf("Android"),b=P("a");return m=-1!==T.indexOf("Safari")&&-1===T.indexOf("Chrome")&&(-1===a||parseFloat(T.substr(a+8,2))>3),o=m&&parseFloat(T.substr(T.indexOf("Version/")+8,2))<6,n=-1!==T.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T))&&(p=parseFloat(RegExp.$1)),b?(b.style.cssText="top:1px;opacity:.55;",/^0.55/.test(b.style.opacity)):!1}(),V=function(a){return x.test("string"==typeof a?a:(a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100:1},W=function(a){_gsScope.console&&console.log(a)},X="",Y="",Z=function(a,b){b=b||Q;var c,d,e=b.style;if(void 0!==e[a])return a;for(a=a.charAt(0).toUpperCase()+a.substr(1),c=["O","Moz","ms","Ms","Webkit"],d=5;--d>-1&&void 0===e[c[d]+a];);return d>=0?(Y=3===d?"ms":c[d],X="-"+Y.toLowerCase()+"-",Y+a):null},$="undefined"!=typeof window?window:O.defaultView||{getComputedStyle:function(){}},_=function(a){return $.getComputedStyle(a)},aa=g.getStyle=function(a,b,c,d,e){var f;return U||"opacity"!==b?(!d&&a.style[b]?f=a.style[b]:(c=c||_(a))?f=c[b]||c.getPropertyValue(b)||c.getPropertyValue(b.replace(B,"-$1").toLowerCase()):a.currentStyle&&(f=a.currentStyle[b]),null==e||f&&"none"!==f&&"auto"!==f&&"auto auto"!==f?f:e):V(a)},ba=S.convertToPixels=function(a,c,d,e,f){if("px"===e||!e&&"lineHeight"!==c)return d;if("auto"===e||!d)return 0;var h,i,j,k=F.test(c),l=a,m=Q.style,n=0>d,o=1===d;if(n&&(d=-d),o&&(d*=100),"lineHeight"!==c||e)if("%"===e&&-1!==c.indexOf("border"))h=d/100*(k?a.clientWidth:a.clientHeight);else{if(m.cssText="border:0 solid red;position:"+aa(a,"position")+";line-height:0;","%"!==e&&l.appendChild&&"v"!==e.charAt(0)&&"rem"!==e)m[k?"borderLeftWidth":"borderTopWidth"]=d+e;else{if(l=a.parentNode||O.body,-1!==aa(l,"display").indexOf("flex")&&(m.position="absolute"),i=l._gsCache,j=b.ticker.frame,i&&k&&i.time===j)return i.width*d/100;m[k?"width":"height"]=d+e}l.appendChild(Q),h=parseFloat(Q[k?"offsetWidth":"offsetHeight"]),l.removeChild(Q),k&&"%"===e&&g.cacheWidths!==!1&&(i=l._gsCache=l._gsCache||{},i.time=j,i.width=h/d*100),0!==h||f||(h=ba(a,c,d,e,!0))}else i=_(a).lineHeight,a.style.lineHeight=d,h=parseFloat(_(a).lineHeight),a.style.lineHeight=i;return o&&(h/=100),n?-h:h},ca=S.calculateOffset=function(a,b,c){if("absolute"!==aa(a,"position",c))return 0;var d="left"===b?"Left":"Top",e=aa(a,"margin"+d,c);return a["offset"+d]-(ba(a,b,parseFloat(e),e.replace(w,""))||0)},da=function(a,b){var c,d,e,f={};if(b=b||_(a,null))if(c=b.length)for(;--c>-1;)e=b[c],(-1===e.indexOf("-transform")||Ea===e)&&(f[e.replace(C,E)]=b.getPropertyValue(e));else for(c in b)(-1===c.indexOf("Transform")||Da===c)&&(f[c]=b[c]);else if(b=a.currentStyle||a.style)for(c in b)"string"==typeof c&&void 0===f[c]&&(f[c.replace(C,E)]=b[c]);return U||(f.opacity=V(a)),d=Sa(a,b,!1),f.rotation=d.rotation,f.skewX=d.skewX,f.scaleX=d.scaleX,f.scaleY=d.scaleY,f.x=d.x,f.y=d.y,Ga&&(f.z=d.z,f.rotationX=d.rotationX,f.rotationY=d.rotationY,f.scaleZ=d.scaleZ),f.filters&&delete f.filters,f},ea=function(a,b,c,d,e){var f,g,h,i={},j=a.style;for(g in c)"cssText"!==g&&"length"!==g&&isNaN(g)&&(b[g]!==(f=c[g])||e&&e[g])&&-1===g.indexOf("Origin")&&("number"==typeof f||"string"==typeof f)&&(i[g]="auto"!==f||"left"!==g&&"top"!==g?""!==f&&"auto"!==f&&"none"!==f||"string"!=typeof b[g]||""===b[g].replace(v,"")?f:0:ca(a,g),void 0!==j[g]&&(h=new ta(j,g,j[g],h)));if(d)for(g in d)"className"!==g&&(i[g]=d[g]);return{difs:i,firstMPT:h}},fa={width:["Left","Right"],height:["Top","Bottom"]},ga=["marginLeft","marginRight","marginTop","marginBottom"],ha=function(a,b,c){if("svg"===(a.nodeName+"").toLowerCase())return(c||_(a))[b]||0;if(a.getCTM&&Pa(a))return a.getBBox()[b]||0;var d=parseFloat("width"===b?a.offsetWidth:a.offsetHeight),e=fa[b],f=e.length;for(c=c||_(a,null);--f>-1;)d-=parseFloat(aa(a,"padding"+e[f],c,!0))||0,d-=parseFloat(aa(a,"border"+e[f]+"Width",c,!0))||0;return d},ia=function(a,b){if("contain"===a||"auto"===a||"auto auto"===a)return a+" ";(null==a||""===a)&&(a="0 0");var c,d=a.split(" "),e=-1!==a.indexOf("left")?"0%":-1!==a.indexOf("right")?"100%":d[0],f=-1!==a.indexOf("top")?"0%":-1!==a.indexOf("bottom")?"100%":d[1];if(d.length>3&&!b){for(d=a.split(", ").join(",").split(","),a=[],c=0;c2?" "+d[2]:""),b&&(b.oxp=-1!==e.indexOf("%"),b.oyp=-1!==f.indexOf("%"),b.oxr="="===e.charAt(1),b.oyr="="===f.charAt(1),b.ox=parseFloat(e.replace(v,"")),b.oy=parseFloat(f.replace(v,"")),b.v=a),b||a},ja=function(a,b){return"function"==typeof a&&(a=a(r,q)),"string"==typeof a&&"="===a.charAt(1)?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2)):parseFloat(a)-parseFloat(b)||0},ka=function(a,b){"function"==typeof a&&(a=a(r,q));var c="string"==typeof a&&"="===a.charAt(1);return"string"==typeof a&&"v"===a.charAt(a.length-2)&&(a=(c?a.substr(0,2):0)+window["inner"+("vh"===a.substr(-2)?"Height":"Width")]*(parseFloat(c?a.substr(2):a)/100)),null==a?b:c?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2))+b:parseFloat(a)||0},la=function(a,b,c,d){var e,f,g,h,i,j=1e-6;return"function"==typeof a&&(a=a(r,q)),null==a?h=b:"number"==typeof a?h=a:(e=360,f=a.split("_"),i="="===a.charAt(1),g=(i?parseInt(a.charAt(0)+"1",10)*parseFloat(f[0].substr(2)):parseFloat(f[0]))*(-1===a.indexOf("rad")?1:L)-(i?0:b),f.length&&(d&&(d[c]=b+g),-1!==a.indexOf("short")&&(g%=e,g!==g%(e/2)&&(g=0>g?g+e:g-e)),-1!==a.indexOf("_cw")&&0>g?g=(g+9999999999*e)%e-(g/e|0)*e:-1!==a.indexOf("ccw")&&g>0&&(g=(g-9999999999*e)%e-(g/e|0)*e)),h=b+g),j>h&&h>-j&&(h=0),h},ma={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},na=function(a,b,c){return a=0>a?a+1:a>1?a-1:a,255*(1>6*a?b+(c-b)*a*6:.5>a?c:2>3*a?b+(c-b)*(2/3-a)*6:b)+.5|0},oa=g.parseColor=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;if(a)if("number"==typeof a)c=[a>>16,a>>8&255,255&a];else{if(","===a.charAt(a.length-1)&&(a=a.substr(0,a.length-1)),ma[a])c=ma[a];else if("#"===a.charAt(0))4===a.length&&(d=a.charAt(1),e=a.charAt(2),f=a.charAt(3),a="#"+d+d+e+e+f+f),a=parseInt(a.substr(1),16),c=[a>>16,a>>8&255,255&a];else if("hsl"===a.substr(0,3))if(c=m=a.match(s),b){if(-1!==a.indexOf("="))return a.match(t)}else g=Number(c[0])%360/360,h=Number(c[1])/100,i=Number(c[2])/100,e=.5>=i?i*(h+1):i+h-i*h,d=2*i-e,c.length>3&&(c[3]=Number(c[3])),c[0]=na(g+1/3,d,e),c[1]=na(g,d,e),c[2]=na(g-1/3,d,e);else c=a.match(s)||ma.transparent;c[0]=Number(c[0]),c[1]=Number(c[1]),c[2]=Number(c[2]),c.length>3&&(c[3]=Number(c[3]))}else c=ma.black;return b&&!m&&(d=c[0]/255,e=c[1]/255,f=c[2]/255,j=Math.max(d,e,f),k=Math.min(d,e,f),i=(j+k)/2,j===k?g=h=0:(l=j-k,h=i>.5?l/(2-j-k):l/(j+k),g=j===d?(e-f)/l+(f>e?6:0):j===e?(f-d)/l+2:(d-e)/l+4,g*=60),c[0]=g+.5|0,c[1]=100*h+.5|0,c[2]=100*i+.5|0),c},pa=function(a,b){var c,d,e,f=a.match(qa)||[],g=0,h="";if(!f.length)return a;for(c=0;c0?g[0].replace(s,""):"";return k?e=b?function(a){var b,m,n,o;if("number"==typeof a)a+=l;else if(d&&I.test(a)){for(o=a.replace(I,"|").split("|"),n=0;nn--)for(;++nm--)for(;++mi;i++)h[a[i]]=j[i]=j[i]||j[(i-1)/2>>0];return e.parse(b,h,f,g)}},ta=(S._setPluginRatio=function(a){this.plugin.setRatio(a);for(var b,c,d,e,f,g=this.data,h=g.proxy,i=g.firstMPT,j=1e-6;i;)b=h[i.v],i.r?b=i.r(b):j>b&&b>-j&&(b=0),i.t[i.p]=b,i=i._next;if(g.autoRotate&&(g.autoRotate.rotation=g.mod?g.mod.call(this._tween,h.rotation,this.t,this._tween):h.rotation),1===a||0===a)for(i=g.firstMPT,f=1===a?"e":"b";i;){if(c=i.t,c.type){if(1===c.type){for(e=c.xs0+c.s+c.xs1,d=1;d0;)i="xn"+g,h=d.p+"_"+i,n[h]=d.data[i],m[h]=d[i],f||(j=new ta(d,i,h,j,d.rxp[i]));d=d._next}return{proxy:m,end:n,firstMPT:j,pt:k}},S.CSSPropTween=function(a,b,d,e,g,h,i,j,k,l,m){this.t=a,this.p=b,this.s=d,this.c=e,this.n=i||b,a instanceof ua||f.push(this.n),this.r=j?"function"==typeof j?j:Math.round:j,this.type=h||0,k&&(this.pr=k,c=!0),this.b=void 0===l?d:l,this.e=void 0===m?d+e:m,g&&(this._next=g,g._prev=this)}),va=function(a,b,c,d,e,f){var g=new ua(a,b,c,d-c,e,-1,f);return g.b=c,g.e=g.xs0=d,g},wa=g.parseComplex=function(a,b,c,d,e,f,h,i,j,l){c=c||f||"","function"==typeof d&&(d=d(r,q)),h=new ua(a,b,0,0,h,l?2:1,null,!1,i,c,d),d+="",e&&qa.test(d+c)&&(d=[c,d],g.colorStringFilter(d),c=d[0],d=d[1]);var m,n,o,p,u,v,w,x,y,z,A,B,C,D=c.split(", ").join(",").split(" "),E=d.split(", ").join(",").split(" "),F=D.length,G=k!==!1;for((-1!==d.indexOf(",")||-1!==c.indexOf(","))&&(-1!==(d+c).indexOf("rgb")||-1!==(d+c).indexOf("hsl")?(D=D.join(" ").replace(I,", ").split(" "),E=E.join(" ").replace(I,", ").split(" ")):(D=D.join(" ").split(",").join(", ").split(" "),E=E.join(" ").split(",").join(", ").split(" ")),F=D.length),F!==E.length&&(D=(f||"").split(" "),F=D.length),h.plugin=j,h.setRatio=l,qa.lastIndex=0,m=0;F>m;m++)if(p=D[m],u=E[m]+"",x=parseFloat(p),x||0===x)h.appendXtra("",x,ja(u,x),u.replace(t,""),G&&-1!==u.indexOf("px")?Math.round:!1,!0);else if(e&&qa.test(p))B=u.indexOf(")")+1,B=")"+(B?u.substr(B):""),C=-1!==u.indexOf("hsl")&&U,z=u,p=oa(p,C),u=oa(u,C),y=p.length+u.length>6,y&&!U&&0===u[3]?(h["xs"+h.l]+=h.l?" transparent":"transparent",h.e=h.e.split(E[m]).join("transparent")):(U||(y=!1),C?h.appendXtra(z.substr(0,z.indexOf("hsl"))+(y?"hsla(":"hsl("),p[0],ja(u[0],p[0]),",",!1,!0).appendXtra("",p[1],ja(u[1],p[1]),"%,",!1).appendXtra("",p[2],ja(u[2],p[2]),y?"%,":"%"+B,!1):h.appendXtra(z.substr(0,z.indexOf("rgb"))+(y?"rgba(":"rgb("),p[0],u[0]-p[0],",",Math.round,!0).appendXtra("",p[1],u[1]-p[1],",",Math.round).appendXtra("",p[2],u[2]-p[2],y?",":B,Math.round),y&&(p=p.length<4?1:p[3],h.appendXtra("",p,(u.length<4?1:u[3])-p,B,!1))),qa.lastIndex=0;else if(v=p.match(s)){if(w=u.match(t),!w||w.length!==v.length)return h;for(o=0,n=0;n0;)j["xn"+xa]=0,j["xs"+xa]="";j.xs0="",j._next=j._prev=j.xfirst=j.data=j.plugin=j.setRatio=j.rxp=null,j.appendXtra=function(a,b,c,d,e,f){var g=this,h=g.l;return g["xs"+h]+=f&&(h||g["xs"+h])?" "+a:a||"",c||0===h||g.plugin?(g.l++,g.type=g.setRatio?2:1,g["xs"+g.l]=d||"",h>0?(g.data["xn"+h]=b+c,g.rxp["xn"+h]=e,g["xn"+h]=b,g.plugin||(g.xfirst=new ua(g,"xn"+h,b,c,g.xfirst||g,0,g.n,e,g.pr),g.xfirst.xs0=0),g):(g.data={s:b+c},g.rxp={},g.s=b,g.c=c,g.r=e,g)):(g["xs"+h]+=b+(d||""),g)};var ya=function(a,b){b=b||{},this.p=b.prefix?Z(a)||a:a,i[a]=i[this.p]=this,this.format=b.formatter||ra(b.defaultValue,b.color,b.collapsible,b.multi),b.parser&&(this.parse=b.parser),this.clrs=b.color,this.multi=b.multi,this.keyword=b.keyword,this.dflt=b.defaultValue,this.allowFunc=b.allowFunc,this.pr=b.priority||0},za=S._registerComplexSpecialProp=function(a,b,c){"object"!=typeof b&&(b={parser:c});var d,e,f=a.split(","),g=b.defaultValue;for(c=c||[g],d=0;dh.length?i.length:h.length,g=0;j>g;g++)b=h[g]=h[g]||this.dflt,c=i[g]=i[g]||this.dflt,m&&(k=b.indexOf(m),l=c.indexOf(m),k!==l&&(-1===l?h[g]=h[g].split(m).join(""):-1===k&&(h[g]+=" "+m)));b=h.join(", "),c=i.join(", ")}return wa(a,this.p,b,c,this.clrs,this.dflt,d,this.pr,e,f)},j.parse=function(a,b,c,d,f,g,h){return this.parseComplex(a.style,this.format(aa(a,this.p,e,!1,this.dflt)),this.format(b),f,g)},g.registerSpecialProp=function(a,b,c){za(a,{parser:function(a,d,e,f,g,h,i){var j=new ua(a,e,0,0,g,2,e,!1,c);return j.plugin=h,j.setRatio=b(a,d,f._tween,e),j},priority:c})},g.useSVGTransformAttr=!0;var Ba,Ca="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),Da=Z("transform"),Ea=X+"transform",Fa=Z("transformOrigin"),Ga=null!==Z("perspective"),Ha=S.Transform=function(){this.perspective=parseFloat(g.defaultTransformPerspective)||0,this.force3D=g.defaultForce3D!==!1&&Ga?g.defaultForce3D||"auto":!1},Ia=_gsScope.SVGElement,Ja=function(a,b,c){var d,e=O.createElementNS("http://www.w3.org/2000/svg",a),f=/([a-z])([A-Z])/g;for(d in c)e.setAttributeNS(null,d.replace(f,"$1-$2").toLowerCase(),c[d]);return b.appendChild(e),e},Ka=O.documentElement||{},La=function(){var a,b,c,d=p||/Android/i.test(T)&&!_gsScope.chrome;return O.createElementNS&&!d&&(a=Ja("svg",Ka),b=Ja("rect",a,{width:100,height:50,x:100}),c=b.getBoundingClientRect().width,b.style[Fa]="50% 50%",b.style[Da]="scaleX(0.5)",d=c===b.getBoundingClientRect().width&&!(n&&Ga),Ka.removeChild(a)),d}(),Ma=function(a,b,c,d,e,f){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v=a._gsTransform,w=Ra(a,!0);v&&(t=v.xOrigin,u=v.yOrigin),(!d||(h=d.split(" ")).length<2)&&(n=a.getBBox(),0===n.x&&0===n.y&&n.width+n.height===0&&(n={x:parseFloat(a.hasAttribute("x")?a.getAttribute("x"):a.hasAttribute("cx")?a.getAttribute("cx"):0)||0,y:parseFloat(a.hasAttribute("y")?a.getAttribute("y"):a.hasAttribute("cy")?a.getAttribute("cy"):0)||0,width:0,height:0}),b=ia(b).split(" "),h=[(-1!==b[0].indexOf("%")?parseFloat(b[0])/100*n.width:parseFloat(b[0]))+n.x,(-1!==b[1].indexOf("%")?parseFloat(b[1])/100*n.height:parseFloat(b[1]))+n.y]),c.xOrigin=k=parseFloat(h[0]),c.yOrigin=l=parseFloat(h[1]),d&&w!==Qa&&(m=w[0],n=w[1],o=w[2],p=w[3],q=w[4],r=w[5],s=m*p-n*o,s&&(i=k*(p/s)+l*(-o/s)+(o*r-p*q)/s,j=k*(-n/s)+l*(m/s)-(m*r-n*q)/s,k=c.xOrigin=h[0]=i,l=c.yOrigin=h[1]=j)),v&&(f&&(c.xOffset=v.xOffset,c.yOffset=v.yOffset,v=c),e||e!==!1&&g.defaultSmoothOrigin!==!1?(i=k-t,j=l-u,v.xOffset+=i*w[0]+j*w[2]-i,v.yOffset+=i*w[1]+j*w[3]-j):v.xOffset=v.yOffset=0),f||a.setAttribute("data-svg-origin",h.join(" "))},Na=function(a){var b,c=P("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),d=this.parentNode,e=this.nextSibling,f=this.style.cssText;if(Ka.appendChild(c),c.appendChild(this),this.style.display="block",a)try{b=this.getBBox(),this._originalGetBBox=this.getBBox,this.getBBox=Na}catch(g){}else this._originalGetBBox&&(b=this._originalGetBBox());return e?d.insertBefore(this,e):d.appendChild(this),Ka.removeChild(c),this.style.cssText=f,b},Oa=function(a){try{return a.getBBox()}catch(b){return Na.call(a,!0)}},Pa=function(a){return!(!Ia||!a.getCTM||a.parentNode&&!a.ownerSVGElement||!Oa(a))},Qa=[1,0,0,1,0,0],Ra=function(a,b){var c,d,e,f,g,h,i,j=a._gsTransform||new Ha,k=1e5,l=a.style;if(Da?d=aa(a,Ea,null,!0):a.currentStyle&&(d=a.currentStyle.filter.match(G),d=d&&4===d.length?[d[0].substr(4),Number(d[2].substr(4)),Number(d[1].substr(4)),d[3].substr(4),j.x||0,j.y||0].join(","):""),c=!d||"none"===d||"matrix(1, 0, 0, 1, 0, 0)"===d,Da&&c&&!a.offsetParent&&(f=l.display,l.display="block",i=a.parentNode,i&&a.offsetParent||(g=1,h=a.nextSibling,Ka.appendChild(a)),d=aa(a,Ea,null,!0),c=!d||"none"===d||"matrix(1, 0, 0, 1, 0, 0)"===d,f?l.display=f:Wa(l,"display"),g&&(h?i.insertBefore(a,h):i?i.appendChild(a):Ka.removeChild(a))),(j.svg||a.getCTM&&Pa(a))&&(c&&-1!==(l[Da]+"").indexOf("matrix")&&(d=l[Da],c=0),e=a.getAttribute("transform"),c&&e&&(e=a.transform.baseVal.consolidate().matrix,d="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")",c=0)),c)return Qa;for(e=(d||"").match(s)||[],xa=e.length;--xa>-1;)f=Number(e[xa]),e[xa]=(g=f-(f|=0))?(g*k+(0>g?-.5:.5)|0)/k+f:f;return b&&e.length>6?[e[0],e[1],e[4],e[5],e[12],e[13]]:e},Sa=S.getTransform=function(a,c,d,e){if(a._gsTransform&&d&&!e)return a._gsTransform;var f,h,i,j,k,l,m=d?a._gsTransform||new Ha:new Ha,n=m.scaleX<0,o=2e-5,p=1e5,q=Ga?parseFloat(aa(a,Fa,c,!1,"0 0 0").split(" ")[2])||m.zOrigin||0:0,r=parseFloat(g.defaultTransformPerspective)||0;if(m.svg=!(!a.getCTM||!Pa(a)),m.svg&&(Ma(a,aa(a,Fa,c,!1,"50% 50%")+"",m,a.getAttribute("data-svg-origin")),Ba=g.useSVGTransformAttr||La),f=Ra(a),f!==Qa){if(16===f.length){var s,t,u,v,w,x=f[0],y=f[1],z=f[2],A=f[3],B=f[4],C=f[5],D=f[6],E=f[7],F=f[8],G=f[9],H=f[10],I=f[12],J=f[13],K=f[14],M=f[11],N=Math.atan2(D,H);m.zOrigin&&(K=-m.zOrigin,I=F*K-f[12],J=G*K-f[13],K=H*K+m.zOrigin-f[14]),m.rotationX=N*L,N&&(v=Math.cos(-N),w=Math.sin(-N),s=B*v+F*w,t=C*v+G*w,u=D*v+H*w,F=B*-w+F*v,G=C*-w+G*v,H=D*-w+H*v,M=E*-w+M*v,B=s,C=t,D=u),N=Math.atan2(-z,H),m.rotationY=N*L,N&&(v=Math.cos(-N),w=Math.sin(-N),s=x*v-F*w,t=y*v-G*w,u=z*v-H*w,G=y*w+G*v,H=z*w+H*v,M=A*w+M*v,x=s,y=t,z=u),N=Math.atan2(y,x),m.rotation=N*L,N&&(v=Math.cos(N),w=Math.sin(N),s=x*v+y*w,t=B*v+C*w,u=F*v+G*w,y=y*v-x*w,C=C*v-B*w,G=G*v-F*w,x=s,B=t,F=u),m.rotationX&&Math.abs(m.rotationX)+Math.abs(m.rotation)>359.9&&(m.rotationX=m.rotation=0,m.rotationY=180-m.rotationY),N=Math.atan2(B,C),m.scaleX=(Math.sqrt(x*x+y*y+z*z)*p+.5|0)/p,m.scaleY=(Math.sqrt(C*C+D*D)*p+.5|0)/p,m.scaleZ=(Math.sqrt(F*F+G*G+H*H)*p+.5|0)/p,x/=m.scaleX,B/=m.scaleY,y/=m.scaleX,C/=m.scaleY,Math.abs(N)>o?(m.skewX=N*L,B=0,"simple"!==m.skewType&&(m.scaleY*=1/Math.cos(N))):m.skewX=0,m.perspective=M?1/(0>M?-M:M):0,m.x=I,m.y=J,m.z=K,m.svg&&(m.x-=m.xOrigin-(m.xOrigin*x-m.yOrigin*B),m.y-=m.yOrigin-(m.yOrigin*y-m.xOrigin*C))}else if(!Ga||e||!f.length||m.x!==f[4]||m.y!==f[5]||!m.rotationX&&!m.rotationY){var O=f.length>=6,P=O?f[0]:1,Q=f[1]||0,R=f[2]||0,S=O?f[3]:1;m.x=f[4]||0,m.y=f[5]||0,i=Math.sqrt(P*P+Q*Q),j=Math.sqrt(S*S+R*R),k=P||Q?Math.atan2(Q,P)*L:m.rotation||0,l=R||S?Math.atan2(R,S)*L+k:m.skewX||0,m.scaleX=i,m.scaleY=j,m.rotation=k,m.skewX=l,Ga&&(m.rotationX=m.rotationY=m.z=0,m.perspective=r,m.scaleZ=1),m.svg&&(m.x-=m.xOrigin-(m.xOrigin*P+m.yOrigin*R),m.y-=m.yOrigin-(m.xOrigin*Q+m.yOrigin*S))}Math.abs(m.skewX)>90&&Math.abs(m.skewX)<270&&(n?(m.scaleX*=-1,m.skewX+=m.rotation<=0?180:-180,m.rotation+=m.rotation<=0?180:-180):(m.scaleY*=-1,m.skewX+=m.skewX<=0?180:-180)),m.zOrigin=q;for(h in m)m[h]-o&&(m[h]=0)}return d&&(a._gsTransform=m,m.svg&&(Ba&&a.style[Da]?b.delayedCall(.001,function(){Wa(a.style,Da)}):!Ba&&a.getAttribute("transform")&&b.delayedCall(.001,function(){a.removeAttribute("transform")}))),m},Ta=function(a){var b,c,d=this.data,e=-d.rotation*K,f=e+d.skewX*K,g=1e5,h=(Math.cos(e)*d.scaleX*g|0)/g,i=(Math.sin(e)*d.scaleX*g|0)/g,j=(Math.sin(f)*-d.scaleY*g|0)/g,k=(Math.cos(f)*d.scaleY*g|0)/g,l=this.t.style,m=this.t.currentStyle;if(m){c=i,i=-j,j=-c,b=m.filter,l.filter="";var n,o,q=this.t.offsetWidth,r=this.t.offsetHeight,s="absolute"!==m.position,t="progid:DXImageTransform.Microsoft.Matrix(M11="+h+", M12="+i+", M21="+j+", M22="+k,u=d.x+q*d.xPercent/100,v=d.y+r*d.yPercent/100;if(null!=d.ox&&(n=(d.oxp?q*d.ox*.01:d.ox)-q/2,o=(d.oyp?r*d.oy*.01:d.oy)-r/2,u+=n-(n*h+o*i),v+=o-(n*j+o*k)),s?(n=q/2,o=r/2,t+=", Dx="+(n-(n*h+o*i)+u)+", Dy="+(o-(n*j+o*k)+v)+")"):t+=", sizingMethod='auto expand')",-1!==b.indexOf("DXImageTransform.Microsoft.Matrix(")?l.filter=b.replace(H,t):l.filter=t+" "+b,(0===a||1===a)&&1===h&&0===i&&0===j&&1===k&&(s&&-1===t.indexOf("Dx=0, Dy=0")||x.test(b)&&100!==parseFloat(RegExp.$1)||-1===b.indexOf(b.indexOf("Alpha"))&&l.removeAttribute("filter")),!s){var y,z,A,B=8>p?1:-1;for(n=d.ieOffsetX||0,o=d.ieOffsetY||0,d.ieOffsetX=Math.round((q-((0>h?-h:h)*q+(0>i?-i:i)*r))/2+u),d.ieOffsetY=Math.round((r-((0>k?-k:k)*r+(0>j?-j:j)*q))/2+v),xa=0;4>xa;xa++)z=ga[xa],y=m[z],c=-1!==y.indexOf("px")?parseFloat(y):ba(this.t,z,parseFloat(y),y.replace(w,""))||0,A=c!==d[z]?2>xa?-d.ieOffsetX:-d.ieOffsetY:2>xa?n-d.ieOffsetX:o-d.ieOffsetY,l[z]=(d[z]=Math.round(c-A*(0===xa||2===xa?1:B)))+"px"}}},Ua=S.set3DTransformRatio=S.setTransformRatio=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,o,p,q,r,s,t,u,v,w,x,y,z=this.data,A=this.t.style,B=z.rotation,C=z.rotationX,D=z.rotationY,E=z.scaleX,F=z.scaleY,G=z.scaleZ,H=z.x,I=z.y,J=z.z,L=z.svg,M=z.perspective,N=z.force3D,O=z.skewY,P=z.skewX;if(O&&(P+=O,B+=O),((1===a||0===a)&&"auto"===N&&(this.tween._totalTime===this.tween._totalDuration||!this.tween._totalTime)||!N)&&!J&&!M&&!D&&!C&&1===G||Ba&&L||!Ga)return void(B||P||L?(B*=K,x=P*K,y=1e5,c=Math.cos(B)*E,f=Math.sin(B)*E,d=Math.sin(B-x)*-F,g=Math.cos(B-x)*F,x&&"simple"===z.skewType&&(b=Math.tan(x-O*K),b=Math.sqrt(1+b*b),d*=b,g*=b,O&&(b=Math.tan(O*K),b=Math.sqrt(1+b*b),c*=b,f*=b)),L&&(H+=z.xOrigin-(z.xOrigin*c+z.yOrigin*d)+z.xOffset,I+=z.yOrigin-(z.xOrigin*f+z.yOrigin*g)+z.yOffset,Ba&&(z.xPercent||z.yPercent)&&(q=this.t.getBBox(),H+=.01*z.xPercent*q.width,I+=.01*z.yPercent*q.height),q=1e-6,q>H&&H>-q&&(H=0),q>I&&I>-q&&(I=0)),u=(c*y|0)/y+","+(f*y|0)/y+","+(d*y|0)/y+","+(g*y|0)/y+","+H+","+I+")",L&&Ba?this.t.setAttribute("transform","matrix("+u):A[Da]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix(":"matrix(")+u):A[Da]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix(":"matrix(")+E+",0,0,"+F+","+H+","+I+")");if(n&&(q=1e-4,q>E&&E>-q&&(E=G=2e-5),q>F&&F>-q&&(F=G=2e-5),!M||z.z||z.rotationX||z.rotationY||(M=0)),B||P)B*=K,r=c=Math.cos(B),s=f=Math.sin(B),P&&(B-=P*K,r=Math.cos(B),s=Math.sin(B),"simple"===z.skewType&&(b=Math.tan((P-O)*K),b=Math.sqrt(1+b*b),r*=b,s*=b,z.skewY&&(b=Math.tan(O*K),b=Math.sqrt(1+b*b),c*=b,f*=b))),d=-s,g=r;else{if(!(D||C||1!==G||M||L))return void(A[Da]=(z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) translate3d(":"translate3d(")+H+"px,"+I+"px,"+J+"px)"+(1!==E||1!==F?" scale("+E+","+F+")":""));c=g=1,d=f=0}k=1,e=h=i=j=l=m=0,o=M?-1/M:0,p=z.zOrigin,q=1e-6,v=",",w="0",B=D*K,B&&(r=Math.cos(B),s=Math.sin(B),i=-s,l=o*-s,e=c*s,h=f*s,k=r,o*=r,c*=r,f*=r),B=C*K,B&&(r=Math.cos(B),s=Math.sin(B),b=d*r+e*s,t=g*r+h*s,j=k*s,m=o*s,e=d*-s+e*r,h=g*-s+h*r,k*=r,o*=r,d=b,g=t),1!==G&&(e*=G,h*=G,k*=G,o*=G),1!==F&&(d*=F,g*=F,j*=F,m*=F),1!==E&&(c*=E,f*=E,i*=E,l*=E),(p||L)&&(p&&(H+=e*-p,I+=h*-p,J+=k*-p+p),L&&(H+=z.xOrigin-(z.xOrigin*c+z.yOrigin*d)+z.xOffset,I+=z.yOrigin-(z.xOrigin*f+z.yOrigin*g)+z.yOffset),q>H&&H>-q&&(H=w),q>I&&I>-q&&(I=w),q>J&&J>-q&&(J=0)),u=z.xPercent||z.yPercent?"translate("+z.xPercent+"%,"+z.yPercent+"%) matrix3d(":"matrix3d(",u+=(q>c&&c>-q?w:c)+v+(q>f&&f>-q?w:f)+v+(q>i&&i>-q?w:i),u+=v+(q>l&&l>-q?w:l)+v+(q>d&&d>-q?w:d)+v+(q>g&&g>-q?w:g),C||D||1!==G?(u+=v+(q>j&&j>-q?w:j)+v+(q>m&&m>-q?w:m)+v+(q>e&&e>-q?w:e),u+=v+(q>h&&h>-q?w:h)+v+(q>k&&k>-q?w:k)+v+(q>o&&o>-q?w:o)+v):u+=",0,0,0,0,1,0,",u+=H+v+I+v+J+v+(M?1+-J/M:1)+")",A[Da]=u};j=Ha.prototype,j.x=j.y=j.z=j.skewX=j.skewY=j.rotation=j.rotationX=j.rotationY=j.zOrigin=j.xPercent=j.yPercent=j.xOffset=j.yOffset=0, j.scaleX=j.scaleY=j.scaleZ=1,za("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(a,b,c,d,f,h,i){if(d._lastParsedTransform===i)return f;d._lastParsedTransform=i;var j=i.scale&&"function"==typeof i.scale?i.scale:0;j&&(i.scale=j(r,a));var k,l,m,n,o,p,s,t,u,v=a._gsTransform,w=a.style,x=1e-6,y=Ca.length,z=i,A={},B="transformOrigin",C=Sa(a,e,!0,z.parseTransform),D=z.transform&&("function"==typeof z.transform?z.transform(r,q):z.transform);if(C.skewType=z.skewType||C.skewType||g.defaultSkewType,d._transform=C,"rotationZ"in z&&(z.rotation=z.rotationZ),D&&"string"==typeof D&&Da)l=Q.style,l[Da]=D,l.display="block",l.position="absolute",-1!==D.indexOf("%")&&(l.width=aa(a,"width"),l.height=aa(a,"height")),O.body.appendChild(Q),k=Sa(Q,null,!1),"simple"===C.skewType&&(k.scaleY*=Math.cos(k.skewX*K)),C.svg&&(p=C.xOrigin,s=C.yOrigin,k.x-=C.xOffset,k.y-=C.yOffset,(z.transformOrigin||z.svgOrigin)&&(D={},Ma(a,ia(z.transformOrigin),D,z.svgOrigin,z.smoothOrigin,!0),p=D.xOrigin,s=D.yOrigin,k.x-=D.xOffset-C.xOffset,k.y-=D.yOffset-C.yOffset),(p||s)&&(t=Ra(Q,!0),k.x-=p-(p*t[0]+s*t[2]),k.y-=s-(p*t[1]+s*t[3]))),O.body.removeChild(Q),k.perspective||(k.perspective=C.perspective),null!=z.xPercent&&(k.xPercent=ka(z.xPercent,C.xPercent)),null!=z.yPercent&&(k.yPercent=ka(z.yPercent,C.yPercent));else if("object"==typeof z){if(k={scaleX:ka(null!=z.scaleX?z.scaleX:z.scale,C.scaleX),scaleY:ka(null!=z.scaleY?z.scaleY:z.scale,C.scaleY),scaleZ:ka(z.scaleZ,C.scaleZ),x:ka(z.x,C.x),y:ka(z.y,C.y),z:ka(z.z,C.z),xPercent:ka(z.xPercent,C.xPercent),yPercent:ka(z.yPercent,C.yPercent),perspective:ka(z.transformPerspective,C.perspective)},o=z.directionalRotation,null!=o)if("object"==typeof o)for(l in o)z[l]=o[l];else z.rotation=o;"string"==typeof z.x&&-1!==z.x.indexOf("%")&&(k.x=0,k.xPercent=ka(z.x,C.xPercent)),"string"==typeof z.y&&-1!==z.y.indexOf("%")&&(k.y=0,k.yPercent=ka(z.y,C.yPercent)),k.rotation=la("rotation"in z?z.rotation:"shortRotation"in z?z.shortRotation+"_short":C.rotation,C.rotation,"rotation",A),Ga&&(k.rotationX=la("rotationX"in z?z.rotationX:"shortRotationX"in z?z.shortRotationX+"_short":C.rotationX||0,C.rotationX,"rotationX",A),k.rotationY=la("rotationY"in z?z.rotationY:"shortRotationY"in z?z.shortRotationY+"_short":C.rotationY||0,C.rotationY,"rotationY",A)),k.skewX=la(z.skewX,C.skewX),k.skewY=la(z.skewY,C.skewY)}for(Ga&&null!=z.force3D&&(C.force3D=z.force3D,n=!0),m=C.force3D||C.z||C.rotationX||C.rotationY||k.z||k.rotationX||k.rotationY||k.perspective,m||null==z.scale||(k.scaleZ=1);--y>-1;)u=Ca[y],D=k[u]-C[u],(D>x||-x>D||null!=z[u]||null!=M[u])&&(n=!0,f=new ua(C,u,C[u],D,f),u in A&&(f.e=A[u]),f.xs0=0,f.plugin=h,d._overwriteProps.push(f.n));return D="function"==typeof z.transformOrigin?z.transformOrigin(r,q):z.transformOrigin,C.svg&&(D||z.svgOrigin)&&(p=C.xOffset,s=C.yOffset,Ma(a,ia(D),k,z.svgOrigin,z.smoothOrigin),f=va(C,"xOrigin",(v?C:k).xOrigin,k.xOrigin,f,B),f=va(C,"yOrigin",(v?C:k).yOrigin,k.yOrigin,f,B),(p!==C.xOffset||s!==C.yOffset)&&(f=va(C,"xOffset",v?p:C.xOffset,C.xOffset,f,B),f=va(C,"yOffset",v?s:C.yOffset,C.yOffset,f,B)),D="0px 0px"),(D||Ga&&m&&C.zOrigin)&&(Da?(n=!0,u=Fa,D||(D=(aa(a,u,e,!1,"50% 50%")+"").split(" "),D=D[0]+" "+D[1]+" "+C.zOrigin+"px"),D+="",f=new ua(w,u,0,0,f,-1,B),f.b=w[u],f.plugin=h,Ga?(l=C.zOrigin,D=D.split(" "),C.zOrigin=(D.length>2?parseFloat(D[2]):l)||0,f.xs0=f.e=D[0]+" "+(D[1]||"50%")+" 0px",f=new ua(C,"zOrigin",0,0,f,-1,f.n),f.b=l,f.xs0=f.e=C.zOrigin):f.xs0=f.e=D):ia(D+"",C)),n&&(d._transformType=C.svg&&Ba||!m&&3!==this._transformType?2:3),j&&(i.scale=j),f},allowFunc:!0,prefix:!0}),za("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),za("clipPath",{defaultValue:"inset(0px)",prefix:!0,multi:!0,formatter:ra("inset(0px 0px 0px 0px)",!1,!0)}),za("borderRadius",{defaultValue:"0px",parser:function(a,b,c,f,g,h){b=this.format(b);var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],z=a.style;for(q=parseFloat(a.offsetWidth),r=parseFloat(a.offsetHeight),i=b.split(" "),j=0;jp?1:0))||""):(p=parseFloat(n),s=n.substr((p+"").length)),""===s&&(s=d[c]||t),s!==t&&(v=ba(a,"borderLeft",o,t),w=ba(a,"borderTop",o,t),"%"===s?(m=v/q*100+"%",l=w/r*100+"%"):"em"===s?(x=ba(a,"borderLeft",1,"em"),m=v/x+"em",l=w/x+"em"):(m=v+"px",l=w+"px"),u&&(n=parseFloat(m)+p+s,k=parseFloat(l)+p+s)),g=wa(z,y[j],m+" "+l,n+" "+k,!1,"0px",g);return g},prefix:!0,formatter:ra("0px 0px 0px 0px",!1,!0)}),za("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius",{defaultValue:"0px",parser:function(a,b,c,d,f,g){return wa(a.style,c,this.format(aa(a,c,e,!1,"0px 0px")),this.format(b),!1,"0px",f)},prefix:!0,formatter:ra("0px 0px",!1,!0)}),za("backgroundPosition",{defaultValue:"0 0",parser:function(a,b,c,d,f,g){var h,i,j,k,l,m,n="background-position",o=e||_(a,null),q=this.format((o?p?o.getPropertyValue(n+"-x")+" "+o.getPropertyValue(n+"-y"):o.getPropertyValue(n):a.currentStyle.backgroundPositionX+" "+a.currentStyle.backgroundPositionY)||"0 0"),r=this.format(b);if(-1!==q.indexOf("%")!=(-1!==r.indexOf("%"))&&r.split(",").length<2&&(m=aa(a,"backgroundImage").replace(D,""),m&&"none"!==m)){for(h=q.split(" "),i=r.split(" "),R.setAttribute("src",m),j=2;--j>-1;)q=h[j],k=-1!==q.indexOf("%"),k!==(-1!==i[j].indexOf("%"))&&(l=0===j?a.offsetWidth-R.width:a.offsetHeight-R.height,h[j]=k?parseFloat(q)/100*l+"px":parseFloat(q)/l*100+"%");q=h.join(" ")}return this.parseComplex(a.style,q,r,f,g)},formatter:ia}),za("backgroundSize",{defaultValue:"0 0",formatter:function(a){return a+="","co"===a.substr(0,2)?a:ia(-1===a.indexOf(" ")?a+" "+a:a)}}),za("perspective",{defaultValue:"0px",prefix:!0}),za("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),za("transformStyle",{prefix:!0}),za("backfaceVisibility",{prefix:!0}),za("userSelect",{prefix:!0}),za("margin",{parser:sa("marginTop,marginRight,marginBottom,marginLeft")}),za("padding",{parser:sa("paddingTop,paddingRight,paddingBottom,paddingLeft")}),za("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(a,b,c,d,f,g){var h,i,j;return 9>p?(i=a.currentStyle,j=8>p?" ":",",h="rect("+i.clipTop+j+i.clipRight+j+i.clipBottom+j+i.clipLeft+")",b=this.format(b).split(",").join(j)):(h=this.format(aa(a,this.p,e,!1,this.dflt)),b=this.format(b)),this.parseComplex(a.style,h,b,f,g)}}),za("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),za("autoRound,strictUnits",{parser:function(a,b,c,d,e){return e}}),za("border",{defaultValue:"0px solid #000",parser:function(a,b,c,d,f,g){var h=aa(a,"borderTopWidth",e,!1,"0px"),i=this.format(b).split(" "),j=i[0].replace(w,"");return"px"!==j&&(h=parseFloat(h)/ba(a,"borderTopWidth",1,j)+j),this.parseComplex(a.style,this.format(h+" "+aa(a,"borderTopStyle",e,!1,"solid")+" "+aa(a,"borderTopColor",e,!1,"#000")),i.join(" "),f,g)},color:!0,formatter:function(a){var b=a.split(" ");return b[0]+" "+(b[1]||"solid")+" "+(a.match(qa)||["#000"])[0]}}),za("borderWidth",{parser:sa("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),za("float,cssFloat,styleFloat",{parser:function(a,b,c,d,e,f){var g=a.style,h="cssFloat"in g?"cssFloat":"styleFloat";return new ua(g,h,0,0,e,-1,c,!1,0,g[h],b)}});var Va=function(a){var b,c=this.t,d=c.filter||aa(this.data,"filter")||"",e=this.s+this.c*a|0;100===e&&(-1===d.indexOf("atrix(")&&-1===d.indexOf("radient(")&&-1===d.indexOf("oader(")?(c.removeAttribute("filter"),b=!aa(this.data,"filter")):(c.filter=d.replace(z,""),b=!0)),b||(this.xn1&&(c.filter=d=d||"alpha(opacity="+e+")"),-1===d.indexOf("pacity")?0===e&&this.xn1||(c.filter=d+" alpha(opacity="+e+")"):c.filter=d.replace(x,"opacity="+e))};za("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(a,b,c,d,f,g){var h=parseFloat(aa(a,"opacity",e,!1,"1")),i=a.style,j="autoAlpha"===c;return"string"==typeof b&&"="===b.charAt(1)&&(b=("-"===b.charAt(0)?-1:1)*parseFloat(b.substr(2))+h),j&&1===h&&"hidden"===aa(a,"visibility",e)&&0!==b&&(h=0),U?f=new ua(i,"opacity",h,b-h,f):(f=new ua(i,"opacity",100*h,100*(b-h),f),f.xn1=j?1:0,i.zoom=1,f.type=2,f.b="alpha(opacity="+f.s+")",f.e="alpha(opacity="+(f.s+f.c)+")",f.data=a,f.plugin=g,f.setRatio=Va),j&&(f=new ua(i,"visibility",0,0,f,-1,null,!1,0,0!==h?"inherit":"hidden",0===b?"hidden":"inherit"),f.xs0="inherit",d._overwriteProps.push(f.n),d._overwriteProps.push(c)),f}});var Wa=function(a,b){b&&(a.removeProperty?(("ms"===b.substr(0,2)||"webkit"===b.substr(0,6))&&(b="-"+b),a.removeProperty(b.replace(B,"-$1").toLowerCase())):a.removeAttribute(b))},Xa=function(a){if(this.t._gsClassPT=this,1===a||0===a){this.t.setAttribute("class",0===a?this.b:this.e);for(var b=this.data,c=this.t.style;b;)b.v?c[b.p]=b.v:Wa(c,b.p),b=b._next;1===a&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};za("className",{parser:function(a,b,d,f,g,h,i){var j,k,l,m,n,o=a.getAttribute("class")||"",p=a.style.cssText;if(g=f._classNamePT=new ua(a,d,0,0,g,2),g.setRatio=Xa,g.pr=-11,c=!0,g.b=o,k=da(a,e),l=a._gsClassPT){for(m={},n=l.data;n;)m[n.p]=1,n=n._next;l.setRatio(1)}return a._gsClassPT=g,g.e="="!==b.charAt(1)?b:o.replace(new RegExp("(?:\\s|^)"+b.substr(2)+"(?![\\w-])"),"")+("+"===b.charAt(0)?" "+b.substr(2):""),a.setAttribute("class",g.e),j=ea(a,k,da(a),i,m),a.setAttribute("class",o),g.data=j.firstMPT,a.style.cssText=p,g=g.xfirst=f.parse(a,j.difs,g,h)}});var Ya=function(a){if((1===a||0===a)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var b,c,d,e,f,g=this.t.style,h=i.transform.parse;if("all"===this.e)g.cssText="",e=!0;else for(b=this.e.split(" ").join("").split(","),d=b.length;--d>-1;)c=b[d],i[c]&&(i[c].parse===h?e=!0:c="transformOrigin"===c?Fa:i[c].p),Wa(g,c);e&&(Wa(g,Da),f=this.t._gsTransform,f&&(f.svg&&(this.t.removeAttribute("data-svg-origin"),this.t.removeAttribute("transform")),delete this.t._gsTransform))}};for(za("clearProps",{parser:function(a,b,d,e,f){return f=new ua(a,d,0,0,f,2),f.setRatio=Ya,f.e=b,f.pr=-10,f.data=e._tween,c=!0,f}}),j="bezier,throwProps,physicsProps,physics2D".split(","),xa=j.length;xa--;)Aa(j[xa]);j=g.prototype,j._firstPT=j._lastParsedTransform=j._transform=null,j._onInitTween=function(a,b,h,j){if(!a.nodeType)return!1;this._target=q=a,this._tween=h,this._vars=b,r=j,k=b.autoRound,c=!1,d=b.suffixMap||g.suffixMap,e=_(a,""),f=this._overwriteProps;var n,p,s,t,u,v,w,x,z,A=a.style;if(l&&""===A.zIndex&&(n=aa(a,"zIndex",e),("auto"===n||""===n)&&this._addLazySet(A,"zIndex",0)),"string"==typeof b&&(t=A.cssText,n=da(a,e),A.cssText=t+";"+b,n=ea(a,n,da(a)).difs,!U&&y.test(b)&&(n.opacity=parseFloat(RegExp.$1)),b=n,A.cssText=t),b.className?this._firstPT=p=i.className.parse(a,b.className,"className",this,null,null,b):this._firstPT=p=this.parse(a,b,null),this._transformType){for(z=3===this._transformType,Da?m&&(l=!0,""===A.zIndex&&(w=aa(a,"zIndex",e),("auto"===w||""===w)&&this._addLazySet(A,"zIndex",0)),o&&this._addLazySet(A,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(z?"visible":"hidden"))):A.zoom=1,s=p;s&&s._next;)s=s._next;x=new ua(a,"transform",0,0,null,2),this._linkCSSP(x,null,s),x.setRatio=Da?Ua:Ta,x.data=this._transform||Sa(a,e,!0),x.tween=h,x.pr=-1,f.pop()}if(c){for(;p;){for(v=p._next,s=t;s&&s.pr>p.pr;)s=s._next;(p._prev=s?s._prev:u)?p._prev._next=p:t=p,(p._next=s)?s._prev=p:u=p,p=v}this._firstPT=t}return!0},j.parse=function(a,b,c,f){var g,h,j,l,m,n,o,p,s,t,u=a.style;for(g in b){if(n=b[g],h=i[g],"function"!=typeof n||h&&h.allowFunc||(n=n(r,q)),h)c=h.parse(a,n,g,this,c,f,b);else{if("--"===g.substr(0,2)){this._tween._propLookup[g]=this._addTween.call(this._tween,a.style,"setProperty",_(a).getPropertyValue(g)+"",n+"",g,!1,g);continue}m=aa(a,g,e)+"",s="string"==typeof n,"color"===g||"fill"===g||"stroke"===g||-1!==g.indexOf("Color")||s&&A.test(n)?(s||(n=oa(n),n=(n.length>3?"rgba(":"rgb(")+n.join(",")+")"),c=wa(u,g,m,n,!0,"transparent",c,0,f)):s&&J.test(n)?c=wa(u,g,m,n,!0,null,c,0,f):(j=parseFloat(m),o=j||0===j?m.substr((j+"").length):"",(""===m||"auto"===m)&&("width"===g||"height"===g?(j=ha(a,g,e),o="px"):"left"===g||"top"===g?(j=ca(a,g,e),o="px"):(j="opacity"!==g?0:1,o="")),t=s&&"="===n.charAt(1),t?(l=parseInt(n.charAt(0)+"1",10),n=n.substr(2),l*=parseFloat(n),p=n.replace(w,"")):(l=parseFloat(n),p=s?n.replace(w,""):""),""===p&&(p=g in d?d[g]:o),n=l||0===l?(t?l+j:l)+p:b[g],o!==p&&(""!==p||"lineHeight"===g)&&(l||0===l)&&j&&(j=ba(a,g,j,o),"%"===p?(j/=ba(a,g,100,"%")/100,b.strictUnits!==!0&&(m=j+"%")):"em"===p||"rem"===p||"vw"===p||"vh"===p?j/=ba(a,g,1,p):"px"!==p&&(l=ba(a,g,l,p),p="px"),t&&(l||0===l)&&(n=l+j+p)),t&&(l+=j),!j&&0!==j||!l&&0!==l?void 0!==u[g]&&(n||n+""!="NaN"&&null!=n)?(c=new ua(u,g,l||j||0,0,c,-1,g,!1,0,m,n),c.xs0="none"!==n||"display"!==g&&-1===g.indexOf("Style")?n:m):W("invalid "+g+" tween value: "+b[g]):(c=new ua(u,g,j,l-j,c,0,g,k!==!1&&("px"===p||"zIndex"===g),0,m,n),c.xs0=p))}f&&c&&!c.plugin&&(c.plugin=f)}return c},j.setRatio=function(a){var b,c,d,e=this._firstPT,f=1e-6;if(1!==a||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(a||this._tween._time!==this._tween._duration&&0!==this._tween._time||this._tween._rawPrevTime===-1e-6)for(;e;){if(b=e.c*a+e.s,e.r?b=e.r(b):f>b&&b>-f&&(b=0),e.type)if(1===e.type)if(d=e.l,2===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2;else if(3===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3;else if(4===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3+e.xn3+e.xs4;else if(5===d)e.t[e.p]=e.xs0+b+e.xs1+e.xn1+e.xs2+e.xn2+e.xs3+e.xn3+e.xs4+e.xn4+e.xs5;else{for(c=e.xs0+b+e.xs1,d=1;d-1;)$a(a[e],b,c);else for(d=a.childNodes,e=d.length;--e>-1;)f=d[e],g=f.type,f.style&&(b.push(da(f)),c&&c.push(f)),1!==g&&9!==g&&11!==g||!f.childNodes.length||$a(f,b,c)};return g.cascadeTo=function(a,c,d){var e,f,g,h,i=b.to(a,c,d),j=[i],k=[],l=[],m=[],n=b._internals.reservedProps;for(a=i._targets||i.target,$a(a,k,m),i.render(c,!0,!0),$a(a,l),i.render(0,!0,!0),i._enabled(!0),e=m.length;--e>-1;)if(f=ea(m[e],k[e],l[e]),f.firstMPT){f=f.difs;for(g in d)n[g]&&(f[g]=d[g]);h={};for(g in f)h[g]=k[e][g];j.push(b.fromTo(m[e],c,h,f))}return j},a.activate([g]),g},!0),function(){var a=_gsScope._gsDefine.plugin({propName:"roundProps",version:"1.7.0",priority:-1,API:2,init:function(a,b,c){return this._tween=c,!0}}),b=function(a){var b=1>a?Math.pow(10,(a+"").length-2):1;return function(c){return(Math.round(c/a)*a*b|0)/b}},c=function(a,b){for(;a;)a.f||a.blob||(a.m=b||Math.round),a=a._next},d=a.prototype;d._onInitAllProps=function(){var a,d,e,f,g=this._tween,h=g.vars.roundProps,i={},j=g._propLookup.roundProps;if("object"!=typeof h||h.push)for("string"==typeof h&&(h=h.split(",")),e=h.length;--e>-1;)i[h[e]]=Math.round;else for(f in h)i[f]=b(h[f]);for(f in i)for(a=g._firstPT;a;)d=a._next,a.pg?a.t._mod(i):a.n===f&&(2===a.f&&a.t?c(a.t._firstPT,i[f]):(this._add(a.t,f,a.s,a.c,i[f]),d&&(d._prev=a._prev),a._prev?a._prev._next=d:g._firstPT===a&&(g._firstPT=d),a._next=a._prev=null,g._propLookup[f]=j)),a=d;return!1},d._add=function(a,b,c,d,e){this._addTween(a,b,c,c+d,b,e||Math.round),this._overwriteProps.push(b)}}(),function(){_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.6.1",init:function(a,b,c,d){var e,f;if("function"!=typeof a.setAttribute)return!1;for(e in b)f=b[e],"function"==typeof f&&(f=f(d,a)),this._addTween(a,"setAttribute",a.getAttribute(e)+"",f+"",e,!1,e),this._overwriteProps.push(e);return!0}})}(),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.3.1",API:2,init:function(a,b,c,d){"object"!=typeof b&&(b={rotation:b}),this.finals={};var e,f,g,h,i,j,k=b.useRadians===!0?2*Math.PI:360,l=1e-6;for(e in b)"useRadians"!==e&&(h=b[e],"function"==typeof h&&(h=h(d,a)),j=(h+"").split("_"),f=j[0],g=parseFloat("function"!=typeof a[e]?a[e]:a[e.indexOf("set")||"function"!=typeof a["get"+e.substr(3)]?e:"get"+e.substr(3)]()),h=this.finals[e]="string"==typeof f&&"="===f.charAt(1)?g+parseInt(f.charAt(0)+"1",10)*Number(f.substr(2)):Number(f)||0,i=h-g,j.length&&(f=j.join("_"),-1!==f.indexOf("short")&&(i%=k,i!==i%(k/2)&&(i=0>i?i+k:i-k)),-1!==f.indexOf("_cw")&&0>i?i=(i+9999999999*k)%k-(i/k|0)*k:-1!==f.indexOf("ccw")&&i>0&&(i=(i-9999999999*k)%k-(i/k|0)*k)),(i>l||-l>i)&&(this._addTween(a,e,g,g+i,e),this._overwriteProps.push(e)));return!0},set:function(a){var b;if(1!==a)this._super.setRatio.call(this,a);else for(b=this._firstPT;b;)b.f?b.t[b.p](this.finals[b.p]):b.t[b.p]=this.finals[b.p],b=b._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(a){var b,c,d,e,f=_gsScope.GreenSockGlobals||_gsScope,g=f.com.greensock,h=2*Math.PI,i=Math.PI/2,j=g._class,k=function(b,c){var d=j("easing."+b,function(){},!0),e=d.prototype=new a;return e.constructor=d,e.getRatio=c,d},l=a.register||function(){},m=function(a,b,c,d,e){var f=j("easing."+a,{easeOut:new b,easeIn:new c,easeInOut:new d},!0);return l(f,a),f},n=function(a,b,c){this.t=a,this.v=b,c&&(this.next=c,c.prev=this,this.c=c.v-b,this.gap=c.t-a)},o=function(b,c){var d=j("easing."+b,function(a){this._p1=a||0===a?a:1.70158,this._p2=1.525*this._p1},!0),e=d.prototype=new a;return e.constructor=d,e.getRatio=c,e.config=function(a){return new d(a)},d},p=m("Back",o("BackOut",function(a){return(a-=1)*a*((this._p1+1)*a+this._p1)+1}),o("BackIn",function(a){return a*a*((this._p1+1)*a-this._p1)}),o("BackInOut",function(a){return(a*=2)<1?.5*a*a*((this._p2+1)*a-this._p2):.5*((a-=2)*a*((this._p2+1)*a+this._p2)+2)})),q=j("easing.SlowMo",function(a,b,c){b=b||0===b?b:.7,null==a?a=.7:a>1&&(a=1),this._p=1!==a?b:0,this._p1=(1-a)/2,this._p2=a,this._p3=this._p1+this._p2,this._calcEnd=c===!0},!0),r=q.prototype=new a;return r.constructor=q,r.getRatio=function(a){var b=a+(.5-a)*this._p;return athis._p3?this._calcEnd?1===a?0:1-(a=(a-this._p3)/this._p1)*a:b+(a-b)*(a=(a-this._p3)/this._p1)*a*a*a:this._calcEnd?1:b},q.ease=new q(.7,.7),r.config=q.config=function(a,b,c){return new q(a,b,c)},b=j("easing.SteppedEase",function(a,b){a=a||1,this._p1=1/a,this._p2=a+(b?0:1),this._p3=b?1:0},!0),r=b.prototype=new a,r.constructor=b,r.getRatio=function(a){return 0>a?a=0:a>=1&&(a=.999999999),((this._p2*a|0)+this._p3)*this._p1},r.config=b.config=function(a,c){return new b(a,c)},c=j("easing.ExpoScaleEase",function(a,b,c){this._p1=Math.log(b/a),this._p2=b-a,this._p3=a,this._ease=c},!0),r=c.prototype=new a,r.constructor=c,r.getRatio=function(a){return this._ease&&(a=this._ease.getRatio(a)),(this._p3*Math.exp(this._p1*a)-this._p3)/this._p2},r.config=c.config=function(a,b,d){return new c(a,b,d)},d=j("easing.RoughEase",function(b){b=b||{};for(var c,d,e,f,g,h,i=b.taper||"none",j=[],k=0,l=0|(b.points||20),m=l,o=b.randomize!==!1,p=b.clamp===!0,q=b.template instanceof a?b.template:null,r="number"==typeof b.strength?.4*b.strength:.4;--m>-1;)c=o?Math.random():1/l*m,d=q?q.getRatio(c):c,"none"===i?e=r:"out"===i?(f=1-c,e=f*f*r):"in"===i?e=c*c*r:.5>c?(f=2*c,e=f*f*.5*r):(f=2*(1-c),e=f*f*.5*r),o?d+=Math.random()*e-.5*e:m%2?d+=.5*e:d-=.5*e,p&&(d>1?d=1:0>d&&(d=0)),j[k++]={x:c,y:d};for(j.sort(function(a,b){return a.x-b.x}),h=new n(1,1,null),m=l;--m>-1;)g=j[m],h=new n(g.x,g.y,h);this._prev=new n(0,0,0!==h.t?h:h.next)},!0),r=d.prototype=new a,r.constructor=d,r.getRatio=function(a){var b=this._prev;if(a>b.t){for(;b.next&&a>=b.t;)b=b.next;b=b.prev}else for(;b.prev&&a<=b.t;)b=b.prev;return this._prev=b,b.v+(a-b.t)/b.gap*b.c},r.config=function(a){return new d(a)},d.ease=new d,m("Bounce",k("BounceOut",function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}),k("BounceIn",function(a){return(a=1-a)<1/2.75?1-7.5625*a*a:2/2.75>a?1-(7.5625*(a-=1.5/2.75)*a+.75):2.5/2.75>a?1-(7.5625*(a-=2.25/2.75)*a+.9375):1-(7.5625*(a-=2.625/2.75)*a+.984375)}),k("BounceInOut",function(a){var b=.5>a;return a=b?1-2*a:2*a-1,a=1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375,b?.5*(1-a):.5*a+.5})),m("Circ",k("CircOut",function(a){return Math.sqrt(1-(a-=1)*a)}),k("CircIn",function(a){return-(Math.sqrt(1-a*a)-1)}),k("CircInOut",function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)})),e=function(b,c,d){var e=j("easing."+b,function(a,b){this._p1=a>=1?a:1,this._p2=(b||d)/(1>a?a:1),this._p3=this._p2/h*(Math.asin(1/this._p1)||0),this._p2=h/this._p2},!0),f=e.prototype=new a;return f.constructor=e,f.getRatio=c,f.config=function(a,b){return new e(a,b)},e},m("Elastic",e("ElasticOut",function(a){return this._p1*Math.pow(2,-10*a)*Math.sin((a-this._p3)*this._p2)+1},.3),e("ElasticIn",function(a){return-(this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*this._p2))},.3),e("ElasticInOut",function(a){return(a*=2)<1?-.5*(this._p1*Math.pow(2,10*(a-=1))*Math.sin((a-this._p3)*this._p2)):this._p1*Math.pow(2,-10*(a-=1))*Math.sin((a-this._p3)*this._p2)*.5+1},.45)),m("Expo",k("ExpoOut",function(a){return 1-Math.pow(2,-10*a)}),k("ExpoIn",function(a){return Math.pow(2,10*(a-1))-.001}),k("ExpoInOut",function(a){return(a*=2)<1?.5*Math.pow(2,10*(a-1)):.5*(2-Math.pow(2,-10*(a-1)))})),m("Sine",k("SineOut",function(a){return Math.sin(a*i)}),k("SineIn",function(a){return-Math.cos(a*i)+1}),k("SineInOut",function(a){return-.5*(Math.cos(Math.PI*a)-1)})),j("easing.EaseLookup",{find:function(b){return a.map[b]}},!0),l(f.SlowMo,"SlowMo","ease,"),l(d,"RoughEase","ease,"),l(b,"SteppedEase","ease,"),p},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(a,b){"use strict";var c={},d=a.document,e=a.GreenSockGlobals=a.GreenSockGlobals||a,f=e[b];if(f)return"undefined"!=typeof module&&module.exports&&(module.exports=f),f;var g,h,i,j,k,l=function(a){var b,c=a.split("."),d=e;for(b=0;b-1;)(k=r[f[p]]||new s(f[p],[])).gsClass?(i[p]=k.gsClass,q--):j&&k.sc.push(this);if(0===q&&g){if(m=("com.greensock."+d).split("."),n=m.pop(),o=l(m.join("."))[n]=this.gsClass=g.apply(g,i),h)if(e[n]=c[n]=o,"undefined"!=typeof module&&module.exports)if(d===b){module.exports=c[b]=o;for(p in c)o[p]=c[p]}else c[b]&&(c[b][n]=o);else"function"==typeof define&&define.amd&&define((a.GreenSockAMDPath?a.GreenSockAMDPath+"/":"")+d.split(".").pop(),[],function(){return o});for(p=0;p-1;)for(f=i[j],e=d?u("easing."+f,null,!0):m.easing[f]||{},g=k.length;--g>-1;)h=k[g],x[f+"."+h]=x[h+f]=e[h]=a.getRatio?a:a[h]||new a};for(i=w.prototype,i._calcEnd=!1,i.getRatio=function(a){if(this._func)return this._params[0]=a,this._func.apply(null,this._params);var b=this._type,c=this._power,d=1===b?1-a:2===b?a:.5>a?2*a:2*(1-a);return 1===c?d*=d:2===c?d*=d*d:3===c?d*=d*d*d:4===c&&(d*=d*d*d*d),1===b?1-d:2===b?d:.5>a?d/2:1-d/2},g=["Linear","Quad","Cubic","Quart","Quint,Strong"],h=g.length;--h>-1;)i=g[h]+",Power"+h,y(new w(null,null,1,h),i,"easeOut",!0),y(new w(null,null,2,h),i,"easeIn"+(0===h?",easeNone":"")),y(new w(null,null,3,h),i,"easeInOut");x.linear=m.easing.Linear.easeIn,x.swing=m.easing.Quad.easeInOut;var z=u("events.EventDispatcher",function(a){this._listeners={},this._eventTarget=a||this});i=z.prototype,i.addEventListener=function(a,b,c,d,e){e=e||0;var f,g,h=this._listeners[a],i=0;for(this!==j||k||j.wake(),null==h&&(this._listeners[a]=h=[]),g=h.length;--g>-1;)f=h[g],f.c===b&&f.s===c?h.splice(g,1):0===i&&f.pr-1;)if(d[c].c===b)return void d.splice(c,1)},i.dispatchEvent=function(a){var b,c,d,e=this._listeners[a];if(e)for(b=e.length,b>1&&(e=e.slice(0)),c=this._eventTarget;--b>-1;)d=e[b],d&&(d.up?d.c.call(d.s||c,{type:a,target:c}):d.c.call(d.s||c))};var A=a.requestAnimationFrame,B=a.cancelAnimationFrame,C=Date.now||function(){return(new Date).getTime()},D=C();for(g=["ms","moz","webkit","o"],h=g.length;--h>-1&&!A;)A=a[g[h]+"RequestAnimationFrame"],B=a[g[h]+"CancelAnimationFrame"]||a[g[h]+"CancelRequestAnimationFrame"];u("Ticker",function(a,b){var c,e,f,g,h,i=this,l=C(),m=b!==!1&&A?"auto":!1,o=500,q=33,r="tick",s=function(a){var b,d,j=C()-D;j>o&&(l+=j-q),D+=j,i.time=(D-l)/1e3,b=i.time-h,(!c||b>0||a===!0)&&(i.frame++,h+=b+(b>=g?.004:g-b),d=!0),a!==!0&&(f=e(s)),d&&i.dispatchEvent(r)};z.call(i),i.time=i.frame=0,i.tick=function(){s(!0)},i.lagSmoothing=function(a,b){return arguments.length?(o=a||1/n,void(q=Math.min(b,o,0))):1/n>o},i.sleep=function(){null!=f&&(m&&B?B(f):clearTimeout(f),e=p,f=null,i===j&&(k=!1))},i.wake=function(a){null!==f?i.sleep():a?l+=-D+(D=C()):i.frame>10&&(D=C()-o+5),e=0===c?p:m&&A?A:function(a){return setTimeout(a,1e3*(h-i.time)+1|0)},i===j&&(k=!0),s(2)},i.fps=function(a){return arguments.length?(c=a,g=1/(c||60),h=this.time+g,void i.wake()):c},i.useRAF=function(a){return arguments.length?(i.sleep(),m=a,void i.fps(c)):m},i.fps(a),setTimeout(function(){"auto"===m&&i.frame<5&&"hidden"!==(d||{}).visibilityState&&i.useRAF(!1)},1500)}),i=m.Ticker.prototype=new m.events.EventDispatcher,i.constructor=m.Ticker;var E=u("core.Animation",function(a,b){if(this.vars=b=b||{},this._duration=this._totalDuration=a||0,this._delay=Number(b.delay)||0,this._timeScale=1,this._active=!!b.immediateRender,this.data=b.data,this._reversed=!!b.reversed,Z){k||j.wake();var c=this.vars.useFrames?Y:Z;c.add(this,c._time),this.vars.paused&&this.paused(!0)}});j=E.ticker=new m.Ticker,i=E.prototype,i._dirty=i._gc=i._initted=i._paused=!1,i._totalTime=i._time=0,i._rawPrevTime=-1,i._next=i._last=i._onUpdate=i._timeline=i.timeline=null,i._paused=!1;var F=function(){k&&C()-D>2e3&&("hidden"!==(d||{}).visibilityState||!j.lagSmoothing())&&j.wake();var a=setTimeout(F,2e3);a.unref&&a.unref()};F(),i.play=function(a,b){return null!=a&&this.seek(a,b),this.reversed(!1).paused(!1)},i.pause=function(a,b){return null!=a&&this.seek(a,b),this.paused(!0)},i.resume=function(a,b){return null!=a&&this.seek(a,b),this.paused(!1)},i.seek=function(a,b){return this.totalTime(Number(a),b!==!1)},i.restart=function(a,b){return this.reversed(!1).paused(!1).totalTime(a?-this._delay:0,b!==!1,!0)},i.reverse=function(a,b){return null!=a&&this.seek(a||this.totalDuration(),b),this.reversed(!0).paused(!1)},i.render=function(a,b,c){},i.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},i.isActive=function(){var a,b=this._timeline,c=this._startTime;return!b||!this._gc&&!this._paused&&b.isActive()&&(a=b.rawTime(!0))>=c&&a-1;)"{self}"===a[b]&&(c[b]=this);return c},i._callback=function(a){var b=this.vars,c=b[a],d=b[a+"Params"],e=b[a+"Scope"]||b.callbackScope||this,f=d?d.length:0;switch(f){case 0:c.call(e);break;case 1:c.call(e,d[0]);break;case 2:c.call(e,d[0],d[1]);break;default:c.apply(e,d)}},i.eventCallback=function(a,b,c,d){if("on"===(a||"").substr(0,2)){var e=this.vars;if(1===arguments.length)return e[a];null==b?delete e[a]:(e[a]=b,e[a+"Params"]=q(c)&&-1!==c.join("").indexOf("{self}")?this._swapSelfInParams(c):c,e[a+"Scope"]=d),"onUpdate"===a&&(this._onUpdate=b)}return this},i.delay=function(a){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+a-this._delay),this._delay=a,this):this._delay},i.duration=function(a){return arguments.length?(this._duration=this._totalDuration=a,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._timethis._duration?this._duration:a,b)):this._time},i.totalTime=function(a,b,c){if(k||j.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(0>a&&!c&&(a+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var d=this._totalDuration,e=this._timeline;if(a>d&&!c&&(a=d),this._startTime=(this._paused?this._pauseTime:e._time)-(this._reversed?d-a:a)/this._timeScale,e._dirty||this._uncache(!1),e._timeline)for(;e._timeline;)e._timeline._time!==(e._startTime+e._totalTime)/e._timeScale&&e.totalTime(e._totalTime,!0),e=e._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==a||0===this._duration)&&(K.length&&_(),this.render(a,b,!1),K.length&&_())}return this},i.progress=i.totalProgress=function(a,b){var c=this.duration();return arguments.length?this.totalTime(c*a,b):c?this._time/c:this.ratio; },i.startTime=function(a){return arguments.length?(a!==this._startTime&&(this._startTime=a,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,a-this._delay)),this):this._startTime},i.endTime=function(a){return this._startTime+(0!=a?this.totalDuration():this.duration())/this._timeScale},i.timeScale=function(a){if(!arguments.length)return this._timeScale;var b,c;for(a=a||n,this._timeline&&this._timeline.smoothChildTiming&&(b=this._pauseTime,c=b||0===b?b:this._timeline.totalTime(),this._startTime=c-(c-this._startTime)*this._timeScale/a),this._timeScale=a,c=this.timeline;c&&c.timeline;)c._dirty=!0,c.totalDuration(),c=c.timeline;return this},i.reversed=function(a){return arguments.length?(a!=this._reversed&&(this._reversed=a,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},i.paused=function(a){if(!arguments.length)return this._paused;var b,c,d=this._timeline;return a!=this._paused&&d&&(k||a||j.wake(),b=d.rawTime(),c=b-this._pauseTime,!a&&d.smoothChildTiming&&(this._startTime+=c,this._uncache(!1)),this._pauseTime=a?b:null,this._paused=a,this._active=this.isActive(),!a&&0!==c&&this._initted&&this.duration()&&(b=d.smoothChildTiming?this._totalTime:(b-this._startTime)/this._timeScale,this.render(b,b===this._totalTime,!0))),this._gc&&!a&&this._enabled(!0,!1),this};var G=u("core.SimpleTimeline",function(a){E.call(this,0,a),this.autoRemoveChildren=this.smoothChildTiming=!0});i=G.prototype=new E,i.constructor=G,i.kill()._gc=!1,i._first=i._last=i._recent=null,i._sortChildren=!1,i.add=i.insert=function(a,b,c,d){var e,f;if(a._startTime=Number(b||0)+a._delay,a._paused&&this!==a._timeline&&(a._pauseTime=this.rawTime()-(a._timeline.rawTime()-a._pauseTime)),a.timeline&&a.timeline._remove(a,!0),a.timeline=a._timeline=this,a._gc&&a._enabled(!0,!0),e=this._last,this._sortChildren)for(f=a._startTime;e&&e._startTime>f;)e=e._prev;return e?(a._next=e._next,e._next=a):(a._next=this._first,this._first=a),a._next?a._next._prev=a:this._last=a,a._prev=e,this._recent=a,this._timeline&&this._uncache(!0),this},i._remove=function(a,b){return a.timeline===this&&(b||a._enabled(!1,!0),a._prev?a._prev._next=a._next:this._first===a&&(this._first=a._next),a._next?a._next._prev=a._prev:this._last===a&&(this._last=a._prev),a._next=a._prev=a.timeline=null,a===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},i.render=function(a,b,c){var d,e=this._first;for(this._totalTime=this._time=this._rawPrevTime=a;e;)d=e._next,(e._active||a>=e._startTime&&!e._paused&&!e._gc)&&(e._reversed?e.render((e._dirty?e.totalDuration():e._totalDuration)-(a-e._startTime)*e._timeScale,b,c):e.render((a-e._startTime)*e._timeScale,b,c)),e=d},i.rawTime=function(){return k||j.wake(),this._totalTime};var H=u("TweenLite",function(b,c,d){if(E.call(this,c,d),this.render=H.prototype.render,null==b)throw"Cannot tween a null target.";this.target=b="string"!=typeof b?b:H.selector(b)||b;var e,f,g,h=b.jquery||b.length&&b!==a&&b[0]&&(b[0]===a||b[0].nodeType&&b[0].style&&!b.nodeType),i=this.vars.overwrite;if(this._overwrite=i=null==i?X[H.defaultOverwrite]:"number"==typeof i?i>>0:X[i],(h||b instanceof Array||b.push&&q(b))&&"number"!=typeof b[0])for(this._targets=g=o(b),this._propLookup=[],this._siblings=[],e=0;e1&&ca(f,this,null,1,this._siblings[e])):(f=g[e--]=H.selector(f),"string"==typeof f&&g.splice(e+1,1)):g.splice(e--,1);else this._propLookup={},this._siblings=aa(b,this,!1),1===i&&this._siblings.length>1&&ca(b,this,null,1,this._siblings);(this.vars.immediateRender||0===c&&0===this._delay&&this.vars.immediateRender!==!1)&&(this._time=-n,this.render(Math.min(0,-this._delay)))},!0),I=function(b){return b&&b.length&&b!==a&&b[0]&&(b[0]===a||b[0].nodeType&&b[0].style&&!b.nodeType)},J=function(a,b){var c,d={};for(c in a)W[c]||c in b&&"transform"!==c&&"x"!==c&&"y"!==c&&"width"!==c&&"height"!==c&&"className"!==c&&"border"!==c||!(!T[c]||T[c]&&T[c]._autoCSS)||(d[c]=a[c],delete a[c]);a.css=d};i=H.prototype=new E,i.constructor=H,i.kill()._gc=!1,i.ratio=0,i._firstPT=i._targets=i._overwrittenProps=i._startAt=null,i._notifyPluginsOfEnabled=i._lazy=!1,H.version="2.1.2",H.defaultEase=i._ease=new w(null,null,1,1),H.defaultOverwrite="auto",H.ticker=j,H.autoSleep=120,H.lagSmoothing=function(a,b){j.lagSmoothing(a,b)},H.selector=a.$||a.jQuery||function(b){var c=a.$||a.jQuery;return c?(H.selector=c,c(b)):(d||(d=a.document),d?d.querySelectorAll?d.querySelectorAll(b):d.getElementById("#"===b.charAt(0)?b.substr(1):b):b)};var K=[],L={},M=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,N=/[\+-]=-?[\.\d]/,O=function(a){for(var b,c=this._firstPT,d=1e-6;c;)b=c.blob?1===a&&null!=this.end?this.end:a?this.join(""):this.start:c.c*a+c.s,c.m?b=c.m.call(this._tween,b,this._target||c.t,this._tween):d>b&&b>-d&&!c.blob&&(b=0),c.f?c.fp?c.t[c.p](c.fp,b):c.t[c.p](b):c.t[c.p]=b,c=c._next},P=function(a){return(1e3*a|0)/1e3+""},Q=function(a,b,c,d){var e,f,g,h,i,j,k,l=[],m=0,n="",o=0;for(l.start=a,l.end=b,a=l[0]=a+"",b=l[1]=b+"",c&&(c(l),a=l[0],b=l[1]),l.length=0,e=a.match(M)||[],f=b.match(M)||[],d&&(d._next=null,d.blob=1,l._firstPT=l._applyPT=d),i=f.length,h=0;i>h;h++)k=f[h],j=b.substr(m,b.indexOf(k,m)-m),n+=j||!h?j:",",m+=j.length,o?o=(o+1)%5:"rgba("===j.substr(-5)&&(o=1),k===e[h]||e.length<=h?n+=k:(n&&(l.push(n),n=""),g=parseFloat(e[h]),l.push(g),l._firstPT={_next:l._firstPT,t:l,p:l.length-1,s:g,c:("="===k.charAt(1)?parseInt(k.charAt(0)+"1",10)*parseFloat(k.substr(2)):parseFloat(k)-g)||0,f:0,m:o&&4>o?Math.round:P}),m+=k.length;return n+=b.substr(m),n&&l.push(n),l.setRatio=O,N.test(b)&&(l.end=null),l},R=function(a,b,c,d,e,f,g,h,i){"function"==typeof d&&(d=d(i||0,a));var j,k=typeof a[b],l="function"!==k?"":b.indexOf("set")||"function"!=typeof a["get"+b.substr(3)]?b:"get"+b.substr(3),m="get"!==c?c:l?g?a[l](g):a[l]():a[b],n="string"==typeof d&&"="===d.charAt(1),o={t:a,p:b,s:m,f:"function"===k,pg:0,n:e||b,m:f?"function"==typeof f?f:Math.round:0,pr:0,c:n?parseInt(d.charAt(0)+"1",10)*parseFloat(d.substr(2)):parseFloat(d)-m||0};return("number"!=typeof m||"number"!=typeof d&&!n)&&(g||isNaN(m)||!n&&isNaN(d)||"boolean"==typeof m||"boolean"==typeof d?(o.fp=g,j=Q(m,n?parseFloat(o.s)+o.c+(o.s+"").replace(/[0-9\-\.]/g,""):d,h||H.defaultStringFilter,o),o={t:j,p:"setRatio",s:0,c:1,f:2,pg:0,n:e||b,pr:0,m:0}):(o.s=parseFloat(m),n||(o.c=parseFloat(d)-o.s||0))),o.c?((o._next=this._firstPT)&&(o._next._prev=o),this._firstPT=o,o):void 0},S=H._internals={isArray:q,isSelector:I,lazyTweens:K,blobDif:Q},T=H._plugins={},U=S.tweenLookup={},V=0,W=S.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1,yoyoEase:1,stagger:1},X={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,"true":1,"false":0},Y=E._rootFramesTimeline=new G,Z=E._rootTimeline=new G,$=30,_=S.lazyRender=function(){var a,b,c=K.length;for(L={},a=0;c>a;a++)b=K[a],b&&b._lazy!==!1&&(b.render(b._lazy[0],b._lazy[1],!0),b._lazy=!1);K.length=0};Z._startTime=j.time,Y._startTime=j.frame,Z._active=Y._active=!0,setTimeout(_,1),E._updateRoot=H.render=function(){var a,b,c;if(K.length&&_(),Z.render((j.time-Z._startTime)*Z._timeScale,!1,!1),Y.render((j.frame-Y._startTime)*Y._timeScale,!1,!1),K.length&&_(),j.frame>=$){$=j.frame+(parseInt(H.autoSleep,10)||120);for(c in U){for(b=U[c].tweens,a=b.length;--a>-1;)b[a]._gc&&b.splice(a,1);0===b.length&&delete U[c]}if(c=Z._first,(!c||c._paused)&&H.autoSleep&&!Y._first&&1===j._listeners.tick.length){for(;c&&c._paused;)c=c._next;c||j.sleep()}}},j.addEventListener("tick",E._updateRoot);var aa=function(a,b,c){var d,e,f=a._gsTweenID;if(U[f||(a._gsTweenID=f="t"+V++)]||(U[f]={target:a,tweens:[]}),b&&(d=U[f].tweens,d[e=d.length]=b,c))for(;--e>-1;)d[e]===b&&d.splice(e,1);return U[f].tweens},ba=function(a,b,c,d){var e,f,g=a.vars.onOverwrite;return g&&(e=g(a,b,c,d)),g=H.onOverwrite,g&&(f=g(a,b,c,d)),e!==!1&&f!==!1},ca=function(a,b,c,d,e){var f,g,h,i;if(1===d||d>=4){for(i=e.length,f=0;i>f;f++)if((h=e[f])!==b)h._gc||h._kill(null,a,b)&&(g=!0);else if(5===d)break;return g}var j,k=b._startTime+n,l=[],m=0,o=0===b._duration;for(f=e.length;--f>-1;)(h=e[f])===b||h._gc||h._paused||(h._timeline!==b._timeline?(j=j||da(b,0,o),0===da(h,j,o)&&(l[m++]=h)):h._startTime<=k&&h._startTime+h.totalDuration()/h._timeScale>k&&((o||!h._initted)&&k-h._startTime<=2*n||(l[m++]=h)));for(f=m;--f>-1;)if(h=l[f],i=h._firstPT,2===d&&h._kill(c,a,b)&&(g=!0),2!==d||!h._firstPT&&h._initted&&i){if(2!==d&&!ba(h,b))continue;h._enabled(!1,!1)&&(g=!0)}return g},da=function(a,b,c){for(var d=a._timeline,e=d._timeScale,f=a._startTime;d._timeline;){if(f+=d._startTime,e*=d._timeScale,d._paused)return-100;d=d._timeline}return f/=e,f>b?f-b:c&&f===b||!a._initted&&2*n>f-b?n:(f+=a.totalDuration()/a._timeScale/e)>b+n?0:f-b-n};i._init=function(){var a,b,c,d,e,f,g=this.vars,h=this._overwrittenProps,i=this._duration,j=!!g.immediateRender,k=g.ease,l=this._startAt;if(g.startAt){l&&(l.render(-1,!0),l.kill()),e={};for(d in g.startAt)e[d]=g.startAt[d];if(e.data="isStart",e.overwrite=!1,e.immediateRender=!0,e.lazy=j&&g.lazy!==!1,e.startAt=e.delay=null,e.onUpdate=g.onUpdate,e.onUpdateParams=g.onUpdateParams,e.onUpdateScope=g.onUpdateScope||g.callbackScope||this,this._startAt=H.to(this.target||{},0,e),j)if(this._time>0)this._startAt=null;else if(0!==i)return}else if(g.runBackwards&&0!==i)if(l)l.render(-1,!0),l.kill(),this._startAt=null;else{0!==this._time&&(j=!1),c={};for(d in g)W[d]&&"autoCSS"!==d||(c[d]=g[d]);if(c.overwrite=0,c.data="isFromStart",c.lazy=j&&g.lazy!==!1,c.immediateRender=j,this._startAt=H.to(this.target,0,c),j){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=k=k?k instanceof w?k:"function"==typeof k?new w(k,g.easeParams):x[k]||H.defaultEase:H.defaultEase,g.easeParams instanceof Array&&k.config&&(this._ease=k.config.apply(k,g.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(f=this._targets.length,a=0;f>a;a++)this._initProps(this._targets[a],this._propLookup[a]={},this._siblings[a],h?h[a]:null,a)&&(b=!0);else b=this._initProps(this.target,this._propLookup,this._siblings,h,0);if(b&&H._onPluginEvent("_onInitAllProps",this),h&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),g.runBackwards)for(c=this._firstPT;c;)c.s+=c.c,c.c=-c.c,c=c._next;this._onUpdate=g.onUpdate,this._initted=!0},i._initProps=function(b,c,d,e,f){var g,h,i,j,k,l;if(null==b)return!1;L[b._gsTweenID]&&_(),this.vars.css||b.style&&b!==a&&b.nodeType&&T.css&&this.vars.autoCSS!==!1&&J(this.vars,b);for(g in this.vars)if(l=this.vars[g],W[g])l&&(l instanceof Array||l.push&&q(l))&&-1!==l.join("").indexOf("{self}")&&(this.vars[g]=l=this._swapSelfInParams(l,this));else if(T[g]&&(j=new T[g])._onInitTween(b,this.vars[g],this,f)){for(this._firstPT=k={_next:this._firstPT,t:j,p:"setRatio",s:0,c:1,f:1,n:g,pg:1,pr:j._priority,m:0},h=j._overwriteProps.length;--h>-1;)c[j._overwriteProps[h]]=this._firstPT;(j._priority||j._onInitAllProps)&&(i=!0),(j._onDisable||j._onEnable)&&(this._notifyPluginsOfEnabled=!0),k._next&&(k._next._prev=k)}else c[g]=R.call(this,b,g,"get",l,g,0,null,this.vars.stringFilter,f);return e&&this._kill(e,b)?this._initProps(b,c,d,e,f):this._overwrite>1&&this._firstPT&&d.length>1&&ca(b,this,c,this._overwrite,d)?(this._kill(c,b),this._initProps(b,c,d,e,f)):(this._firstPT&&(this.vars.lazy!==!1&&this._duration||this.vars.lazy&&!this._duration)&&(L[b._gsTweenID]=!0),i)},i.render=function(a,b,c){var d,e,f,g,h=this,i=h._time,j=h._duration,k=h._rawPrevTime;if(a>=j-n&&a>=0)h._totalTime=h._time=j,h.ratio=h._ease._calcEnd?h._ease.getRatio(1):1,h._reversed||(d=!0,e="onComplete",c=c||h._timeline.autoRemoveChildren),0===j&&(h._initted||!h.vars.lazy||c)&&(h._startTime===h._timeline._duration&&(a=0),(0>k||0>=a&&a>=-n||k===n&&"isPause"!==h.data)&&k!==a&&(c=!0,k>n&&(e="onReverseComplete")),h._rawPrevTime=g=!b||a||k===a?a:n);else if(n>a)h._totalTime=h._time=0,h.ratio=h._ease._calcEnd?h._ease.getRatio(0):0,(0!==i||0===j&&k>0)&&(e="onReverseComplete",d=h._reversed),a>-n?a=0:0>a&&(h._active=!1,0===j&&(h._initted||!h.vars.lazy||c)&&(k>=0&&(k!==n||"isPause"!==h.data)&&(c=!0),h._rawPrevTime=g=!b||a||k===a?a:n)),(!h._initted||h._startAt&&h._startAt.progress())&&(c=!0);else if(h._totalTime=h._time=a,h._easeType){var l=a/j,m=h._easeType,o=h._easePower;(1===m||3===m&&l>=.5)&&(l=1-l),3===m&&(l*=2),1===o?l*=l:2===o?l*=l*l:3===o?l*=l*l*l:4===o&&(l*=l*l*l*l),h.ratio=1===m?1-l:2===m?l:.5>a/j?l/2:1-l/2}else h.ratio=h._ease.getRatio(a/j);if(h._time!==i||c){if(!h._initted){if(h._init(),!h._initted||h._gc)return;if(!c&&h._firstPT&&(h.vars.lazy!==!1&&h._duration||h.vars.lazy&&!h._duration))return h._time=h._totalTime=i,h._rawPrevTime=k,K.push(h),void(h._lazy=[a,b]);h._time&&!d?h.ratio=h._ease.getRatio(h._time/j):d&&h._ease._calcEnd&&(h.ratio=h._ease.getRatio(0===h._time?0:1))}for(h._lazy!==!1&&(h._lazy=!1),h._active||!h._paused&&h._time!==i&&a>=0&&(h._active=!0),0===i&&(h._startAt&&(a>=0?h._startAt.render(a,!0,c):e||(e="_dummyGS")),h.vars.onStart&&(0!==h._time||0===j)&&(b||h._callback("onStart"))),f=h._firstPT;f;)f.f?f.t[f.p](f.c*h.ratio+f.s):f.t[f.p]=f.c*h.ratio+f.s,f=f._next;h._onUpdate&&(0>a&&h._startAt&&a!==-1e-4&&h._startAt.render(a,!0,c),b||(h._time!==i||d||c)&&h._callback("onUpdate")),e&&(!h._gc||c)&&(0>a&&h._startAt&&!h._onUpdate&&a!==-1e-4&&h._startAt.render(a,!0,c),d&&(h._timeline.autoRemoveChildren&&h._enabled(!1,!1),h._active=!1),!b&&h.vars[e]&&h._callback(e),0===j&&h._rawPrevTime===n&&g!==n&&(h._rawPrevTime=0))}},i._kill=function(a,b,c){if("all"===a&&(a=null),null==a&&(null==b||b===this.target))return this._lazy=!1,this._enabled(!1,!1);b="string"!=typeof b?b||this._targets||this.target:H.selector(b)||b;var d,e,f,g,h,i,j,k,l,m=c&&this._time&&c._startTime===this._startTime&&this._timeline===c._timeline,n=this._firstPT;if((q(b)||I(b))&&"number"!=typeof b[0])for(d=b.length;--d>-1;)this._kill(a,b[d],c)&&(i=!0);else{if(this._targets){for(d=this._targets.length;--d>-1;)if(b===this._targets[d]){h=this._propLookup[d]||{},this._overwrittenProps=this._overwrittenProps||[],e=this._overwrittenProps[d]=a?this._overwrittenProps[d]||{}:"all";break}}else{if(b!==this.target)return!1;h=this._propLookup,e=this._overwrittenProps=a?this._overwrittenProps||{}:"all"}if(h){if(j=a||h,k=a!==e&&"all"!==e&&a!==h&&("object"!=typeof a||!a._tempKill),c&&(H.onOverwrite||this.vars.onOverwrite)){for(f in j)h[f]&&(l||(l=[]),l.push(f));if((l||!a)&&!ba(this,c,b,l))return!1}for(f in j)(g=h[f])&&(m&&(g.f?g.t[g.p](g.s):g.t[g.p]=g.s,i=!0),g.pg&&g.t._kill(j)&&(i=!0),g.pg&&0!==g.t._overwriteProps.length||(g._prev?g._prev._next=g._next:g===this._firstPT&&(this._firstPT=g._next),g._next&&(g._next._prev=g._prev),g._next=g._prev=null),delete h[f]),k&&(e[f]=1);!this._firstPT&&this._initted&&n&&this._enabled(!1,!1)}}return i},i.invalidate=function(){this._notifyPluginsOfEnabled&&H._onPluginEvent("_onDisable",this);var a=this._time;return this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],E.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-n,this.render(a,!1,this.vars.lazy!==!1)),this},i._enabled=function(a,b){if(k||j.wake(),a&&this._gc){var c,d=this._targets;if(d)for(c=d.length;--c>-1;)this._siblings[c]=aa(d[c],this,!0);else this._siblings=aa(this.target,this,!0)}return E.prototype._enabled.call(this,a,b),this._notifyPluginsOfEnabled&&this._firstPT?H._onPluginEvent(a?"_onEnable":"_onDisable",this):!1},H.to=function(a,b,c){return new H(a,b,c)},H.from=function(a,b,c){return c.runBackwards=!0,c.immediateRender=0!=c.immediateRender,new H(a,b,c)},H.fromTo=function(a,b,c,d){return d.startAt=c,d.immediateRender=0!=d.immediateRender&&0!=c.immediateRender,new H(a,b,d)},H.delayedCall=function(a,b,c,d,e){return new H(b,0,{delay:a,onComplete:b,onCompleteParams:c,callbackScope:d,onReverseComplete:b,onReverseCompleteParams:c,immediateRender:!1,lazy:!1,useFrames:e,overwrite:0})},H.set=function(a,b){return new H(a,0,b)},H.getTweensOf=function(a,b){if(null==a)return[];a="string"!=typeof a?a:H.selector(a)||a;var c,d,e,f;if((q(a)||I(a))&&"number"!=typeof a[0]){for(c=a.length,d=[];--c>-1;)d=d.concat(H.getTweensOf(a[c],b));for(c=d.length;--c>-1;)for(f=d[c],e=c;--e>-1;)f===d[e]&&d.splice(c,1)}else if(a._gsTweenID)for(d=aa(a).concat(),c=d.length;--c>-1;)(d[c]._gc||b&&!d[c].isActive())&&d.splice(c,1);return d||[]},H.killTweensOf=H.killDelayedCallsTo=function(a,b,c){"object"==typeof b&&(c=b,b=!1);for(var d=H.getTweensOf(a,b),e=d.length;--e>-1;)d[e]._kill(c,a)};var ea=u("plugins.TweenPlugin",function(a,b){this._overwriteProps=(a||"").split(","),this._propName=this._overwriteProps[0],this._priority=b||0,this._super=ea.prototype},!0);if(i=ea.prototype,ea.version="1.19.0",ea.API=2,i._firstPT=null,i._addTween=R,i.setRatio=O,i._kill=function(a){var b,c=this._overwriteProps,d=this._firstPT;if(null!=a[this._propName])this._overwriteProps=[];else for(b=c.length;--b>-1;)null!=a[c[b]]&&c.splice(b,1);for(;d;)null!=a[d.n]&&(d._next&&(d._next._prev=d._prev),d._prev?(d._prev._next=d._next,d._prev=null):this._firstPT===d&&(this._firstPT=d._next)),d=d._next;return!1},i._mod=i._roundProps=function(a){for(var b,c=this._firstPT;c;)b=a[this._propName]||null!=c.n&&a[c.n.split(this._propName+"_").join("")],b&&"function"==typeof b&&(2===c.f?c.t._applyPT.m=b:c.m=b),c=c._next},H._onPluginEvent=function(a,b){var c,d,e,f,g,h=b._firstPT;if("_onInitAllProps"===a){for(;h;){for(g=h._next,d=e;d&&d.pr>h.pr;)d=d._next;(h._prev=d?d._prev:f)?h._prev._next=h:e=h,(h._next=d)?d._prev=h:f=h,h=g}h=b._firstPT=e}for(;h;)h.pg&&"function"==typeof h.t[a]&&h.t[a]()&&(c=!0),h=h._next;return c},ea.activate=function(a){for(var b=a.length;--b>-1;)a[b].API===ea.API&&(T[(new a[b])._propName]=a[b]);return!0},t.plugin=function(a){if(!(a&&a.propName&&a.init&&a.API))throw"illegal plugin definition.";var b,c=a.propName,d=a.priority||0,e=a.overwriteProps,f={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},g=u("plugins."+c.charAt(0).toUpperCase()+c.substr(1)+"Plugin",function(){ea.call(this,c,d),this._overwriteProps=e||[]},a.global===!0),h=g.prototype=new ea(c);h.constructor=g,g.API=a.API;for(b in f)"function"==typeof a[b]&&(h[f[b]]=a[b]);return g.version=a.version,ea.activate([g]),g},g=a._gsQueue){for(h=0;he+1E3&&(r.update(1E3*a/(c-e),100),e=c,a=0,t)){var d=performance.memory;t.update(d.usedJSHeapSize/1048576,d.jsHeapSizeLimit/1048576)}return c},update:function(){g=this.end()},domElement:c,setMode:k}}; -Stats.Panel=function(h,k,l){var c=Infinity,g=0,e=Math.round,a=e(window.devicePixelRatio||1),r=80*a,f=48*a,t=3*a,u=2*a,d=3*a,m=15*a,n=74*a,p=30*a,q=document.createElement("canvas");q.width=r;q.height=f;q.style.cssText="width:80px;height:48px";var b=q.getContext("2d");b.font="bold "+9*a+"px Helvetica,Arial,sans-serif";b.textBaseline="top";b.fillStyle=l;b.fillRect(0,0,r,f);b.fillStyle=k;b.fillText(h,t,u);b.fillRect(d,m,n,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d,m,n,p);return{dom:q,update:function(f,v){c=Math.min(c,f);g=Math.max(g,f);b.fillStyle=l;b.globalAlpha=1;b.fillRect(0,0,r,m);b.fillStyle=k;b.fillText(e(f)+" "+h+" ("+e(c)+"-"+e(g)+")",t,u);b.drawImage(q,d+a,m,n-a,p,d,m,n-a,p);b.fillRect(d+n-a,m,a,p);b.fillStyle=l;b.globalAlpha=.9;b.fillRect(d+n-a,m,a,e((1-f/v)*p))}}};"object"===typeof module&&(module.exports=Stats); /////////////////////////////////////////////////////-------------- my line-------------- var getProportionPoint2 = (point, segment, length, dx, dy) => { let factor = segment / length @@ -37066,3 +37084,1569 @@ var dijkstra = { } } }; +////////////////////////-------LineSegmentsGeometry---------------------- + THREE.LineSegmentsGeometry = function () { + THREE.InstancedBufferGeometry.call( this ); + this.type = 'LineSegmentsGeometry'; + var plane = new THREE.BufferGeometry(); + var positions = [ - 1, 2, 0, 1, 2, 0, - 1, 1, 0, 1, 1, 0, - 1, 0, 0, 1, 0, 0, - 1, - 1, 0, 1, - 1, 0 ]; + var uvs = [ - 1, 2, 1, 2, - 1, 1, 1, 1, - 1, - 1, 1, - 1, - 1, - 2, 1, - 2 ]; + var index = [ 0, 2, 1, 2, 3, 1, 2, 4, 3, 4, 5, 3, 4, 6, 5, 6, 7, 5 ]; + this.setIndex( index ); + this.addAttribute( 'position', new THREE.Float32BufferAttribute( positions, 3 ) ); + this.addAttribute( 'uv', new THREE.Float32BufferAttribute( uvs, 2 ) ); +}; +THREE.LineSegmentsGeometry.prototype = Object.assign( Object.create( THREE.InstancedBufferGeometry.prototype ), { + constructor: THREE.LineSegmentsGeometry, + isLineSegmentsGeometry: true, + applyMatrix: function ( matrix ) { + var start = this.attributes.instanceStart; + var end = this.attributes.instanceEnd; + if ( start !== undefined ) { + matrix.applyToBufferAttribute( start ); + matrix.applyToBufferAttribute( end ); + start.data.needsUpdate = true; + } + if ( this.boundingBox !== null ) { + this.computeBoundingBox(); + } + if ( this.boundingSphere !== null ) { + this.computeBoundingSphere(); + } + return this; + }, + setPositions: function ( array ) { + var lineSegments; + if ( array instanceof Float32Array ) { + lineSegments = array; + } else if ( Array.isArray( array ) ) { + lineSegments = new Float32Array( array ); + } + var instanceBuffer = new THREE.InstancedInterleavedBuffer( lineSegments, 6, 1 ); // xyz, xyz + this.addAttribute( 'instanceStart', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 0 ) ); // xyz + this.addAttribute( 'instanceEnd', new THREE.InterleavedBufferAttribute( instanceBuffer, 3, 3 ) ); // xyz + // + this.computeBoundingBox(); + this.computeBoundingSphere(); + return this; + }, + setColors: function ( array ) { + var colors; + if ( array instanceof Float32Array ) { + colors = array; + } else if ( Array.isArray( array ) ) { + colors = new Float32Array( array ); + } + var instanceColorBuffer = new THREE.InstancedInterleavedBuffer( colors, 6, 1 ); // rgb, rgb + this.addAttribute( 'instanceColorStart', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 0 ) ); // rgb + this.addAttribute( 'instanceColorEnd', new THREE.InterleavedBufferAttribute( instanceColorBuffer, 3, 3 ) ); // rgb + return this; + }, + fromWireframeGeometry: function ( geometry ) { + this.setPositions( geometry.attributes.position.array ); + return this; + }, + fromEdgesGeometry: function ( geometry ) { + this.setPositions( geometry.attributes.position.array ); + return this; + }, + fromMesh: function ( mesh ) { + this.fromWireframeGeometry( new THREE.WireframeGeometry( mesh.geometry ) ); + // set colors, maybe + return this; + }, + fromLineSegements: function ( lineSegments ) { + var geometry = lineSegments.geometry; + if ( geometry.isGeometry ) { + this.setPositions( geometry.vertices ); + } else if ( geometry.isBufferGeometry ) { + this.setPositions( geometry.position.array ); // assumes non-indexed + } + // set colors, maybe + return this; + }, + computeBoundingBox: function () { + var box = new THREE.Box3(); + return function computeBoundingBox() { + if ( this.boundingBox === null ) { + this.boundingBox = new THREE.Box3(); + } + var start = this.attributes.instanceStart; + var end = this.attributes.instanceEnd; + if ( start !== undefined && end !== undefined ) { + this.boundingBox.setFromBufferAttribute( start ); + box.setFromBufferAttribute( end ); + this.boundingBox.union( box ); + } + }; + }(), + computeBoundingSphere: function () { + var vector = new THREE.Vector3(); + return function computeBoundingSphere() { + if ( this.boundingSphere === null ) { + this.boundingSphere = new THREE.Sphere(); + } + if ( this.boundingBox === null ) { + this.computeBoundingBox(); + } + var start = this.attributes.instanceStart; + var end = this.attributes.instanceEnd; + if ( start !== undefined && end !== undefined ) { + var center = this.boundingSphere.center; + this.boundingBox.getCenter( center ); + var maxRadiusSq = 0; + for ( var i = 0, il = start.count; i < il; i ++ ) { + vector.fromBufferAttribute( start, i ); + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) ); + vector.fromBufferAttribute( end, i ); + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) ); + } + this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); + + } + }; + }(), + toJSON: function () { + // todo + }, + clone: function () { + // todo + }, + copy: function ( source ) { + // todo + return this; + } +} ); +//////////////////////////////--------------虚线 -LineMaterial----------- + THREE.UniformsLib.line = { + linewidth: { value: 1 }, + resolution: { value: new THREE.Vector2( 1, 1 ) }, + dashScale: { value: 1 }, + dashSize: { value: 1 }, + gapSize: { value: 1 } // todo FIX - maybe change to totalSize +}; +THREE.ShaderLib[ 'line' ] = { + uniforms: THREE.UniformsUtils.merge( [ + THREE.UniformsLib.common, + THREE.UniformsLib.fog, + THREE.UniformsLib.line + ] ), + vertexShader: + ` + #include + #include + #include + #include + #include + uniform float linewidth; + uniform vec2 resolution; + attribute vec3 instanceStart; + attribute vec3 instanceEnd; + attribute vec3 instanceColorStart; + attribute vec3 instanceColorEnd; + varying vec2 vUv; + #ifdef USE_DASH + uniform float dashScale; + attribute float instanceDistanceStart; + attribute float instanceDistanceEnd; + varying float vLineDistance; + #endif + void trimSegment( const in vec4 start, inout vec4 end ) { + // trim end segment so it terminates between the camera plane and the near plane + // conservative estimate of the near plane + float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column + float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column + float nearEstimate = - 0.5 * b / a; + float alpha = ( nearEstimate - start.z ) / ( end.z - start.z ); + end.xyz = mix( start.xyz, end.xyz, alpha ); + } + void main() { + #ifdef USE_COLOR + vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd; + #endif + #ifdef USE_DASH + vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd; + #endif + float aspect = resolution.x / resolution.y; + vUv = uv; + // camera space + vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 ); + vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 ); + // special case for perspective projection, and segments that terminate either in, or behind, the camera plane + // clearly the gpu firmware has a way of addressing this issue when projecting into ndc space + // but we need to perform ndc-space calculations in the shader, so we must address this issue directly + // perhaps there is a more elegant solution -- WestLangley + bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column + if ( perspective ) { + if ( start.z < 0.0 && end.z >= 0.0 ) { + trimSegment( start, end ); + } else if ( end.z < 0.0 && start.z >= 0.0 ) { + trimSegment( end, start ); + } + } + // clip space + vec4 clipStart = projectionMatrix * start; + vec4 clipEnd = projectionMatrix * end; + // ndc space + vec2 ndcStart = clipStart.xy / clipStart.w; + vec2 ndcEnd = clipEnd.xy / clipEnd.w; + // direction + vec2 dir = ndcEnd - ndcStart; + // account for clip-space aspect ratio + dir.x *= aspect; + dir = normalize( dir ); + // perpendicular to dir + vec2 offset = vec2( dir.y, - dir.x ); + // undo aspect ratio adjustment + dir.x /= aspect; + offset.x /= aspect; + // sign flip + if ( position.x < 0.0 ) offset *= - 1.0; + // endcaps + if ( position.y < 0.0 ) { + offset += - dir; + } else if ( position.y > 1.0 ) { + offset += dir; + } + // adjust for linewidth + offset *= linewidth; + // adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ... + offset /= resolution.y; + // select end + vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd; + // back to clip space + offset *= clip.w; + clip.xy += offset; + gl_Position = clip; + vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation + #include + #include + #include + } + `, + fragmentShader: + ` + uniform vec3 diffuse; + uniform float opacity; + #ifdef USE_DASH + uniform float dashSize; + uniform float gapSize; + #endif + varying float vLineDistance; + #include + #include + #include + #include + #include + varying vec2 vUv; + void main() { + #include + #ifdef USE_DASH + if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps + if ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX + #endif + if ( abs( vUv.y ) > 1.0 ) { + float a = vUv.x; + float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0; + float len2 = a * a + b * b; + if ( len2 > 1.0 ) discard; + } + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + gl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a ); + #include + #include + #include + #include + } ` +}; +THREE.LineMaterial = function ( parameters ) { + THREE.ShaderMaterial.call( this, { + type: 'LineMaterial', + uniforms: THREE.UniformsUtils.clone( THREE.ShaderLib[ 'line' ].uniforms ), + vertexShader: THREE.ShaderLib[ 'line' ].vertexShader, + fragmentShader: THREE.ShaderLib[ 'line' ].fragmentShader + } ); + this.dashed = false; + Object.defineProperties( this, { + color: { + enumerable: true, + get: function () { + return this.uniforms.diffuse.value; + }, + set: function ( value ) { + this.uniforms.diffuse.value = value; + } + }, + linewidth: { + enumerable: true, + get: function () { + return this.uniforms.linewidth.value; + }, + set: function ( value ) { + this.uniforms.linewidth.value = value; + } + }, + dashScale: { + enumerable: true, + get: function () { + return this.uniforms.dashScale.value; + }, + set: function ( value ) { + this.uniforms.dashScale.value = value; + } + }, + dashSize: { + enumerable: true, + get: function () { + return this.uniforms.dashSize.value; + }, + set: function ( value ) { + this.uniforms.dashSize.value = value; + } + }, + gapSize: { + enumerable: true, + get: function () { + return this.uniforms.gapSize.value; + }, + set: function ( value ) { + this.uniforms.gapSize.value = value; + } + }, + resolution: { + enumerable: true, + get: function () { + return this.uniforms.resolution.value; + }, + set: function ( value ) { + this.uniforms.resolution.value.copy( value ); + } + } + } ); + this.setValues( parameters ); +}; +THREE.LineMaterial.prototype = Object.create( THREE.ShaderMaterial.prototype ); +THREE.LineMaterial.prototype.constructor = THREE.LineMaterial; +THREE.LineMaterial.prototype.isLineMaterial = true; +THREE.LineMaterial.prototype.copy = function ( source ) { + THREE.ShaderMaterial.prototype.copy.call( this, source ); + this.color.copy( source.color ); + this.linewidth = source.linewidth; + this.resolution = source.resolution; + // todo + return this; +}; +// Generated by CoffeeScript 1.6.3 +(function() { + var BACK, COPLANAR, EPSILON, FRONT, SPANNING, returning, + __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, + __slice = [].slice, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; + EPSILON = 1e-5; + COPLANAR = 0; + FRONT = 1; + BACK = 2; + SPANNING = 3; + returning = function(value, fn) { + fn(); + return value; + }; + window.ThreeBSP = (function() { + function ThreeBSP(treeIsh, matrix) { + this.matrix = matrix; + this.intersect = __bind(this.intersect, this); + this.union = __bind(this.union, this); + this.subtract = __bind(this.subtract, this); + this.toGeometry = __bind(this.toGeometry, this); + this.toMesh = __bind(this.toMesh, this); + this.toTree = __bind(this.toTree, this); + if (this.matrix == null) { + this.matrix = new THREE.Matrix4(); + } + this.tree = this.toTree(treeIsh); + } + ThreeBSP.prototype.toTree = function(treeIsh) { + var face, geometry, i, polygons, _fn, _i, _len, _ref, + _this = this; + if (treeIsh instanceof ThreeBSP.Node) { + return treeIsh; + } + polygons = []; + geometry = treeIsh instanceof THREE.Geometry ? treeIsh : treeIsh instanceof THREE.Mesh ? (treeIsh.updateMatrix(), this.matrix = treeIsh.matrix.clone(), treeIsh.geometry) : void 0; + _ref = geometry.faces; + _fn = function(face, i) { + var faceVertexUvs, idx, polygon, vIndex, vName, vertex, _j, _len1, _ref1, _ref2; + faceVertexUvs = (_ref1 = geometry.faceVertexUvs) != null ? _ref1[0][i] : void 0; + if (faceVertexUvs == null) { + faceVertexUvs = [new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2(), new THREE.Vector2()]; + } + polygon = new ThreeBSP.Polygon(); + _ref2 = ['a', 'b', 'c', 'd']; + for (vIndex = _j = 0, _len1 = _ref2.length; _j < _len1; vIndex = ++_j) { + vName = _ref2[vIndex]; + if ((idx = face[vName]) != null) { + vertex = geometry.vertices[idx]; + vertex = new ThreeBSP.Vertex(vertex.x, vertex.y, vertex.z, face.vertexNormals[0], new THREE.Vector2(faceVertexUvs[vIndex].x, faceVertexUvs[vIndex].y)); + vertex.applyMatrix4(_this.matrix); + polygon.vertices.push(vertex); + } + } + return polygons.push(polygon.calculateProperties()); + }; + for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { + face = _ref[i]; + _fn(face, i); + } + return new ThreeBSP.Node(polygons); + }; + ThreeBSP.prototype.toMesh = function(material) { + var geometry, mesh, + _this = this; + if (material == null) { + material = new THREE.MeshNormalMaterial(); + } + geometry = this.toGeometry(); + return returning((mesh = new THREE.Mesh(geometry, material)), function() { + mesh.position.getPositionFromMatrix(_this.matrix); + return mesh.rotation.setFromRotationMatrix(_this.matrix); + }); + }; + ThreeBSP.prototype.toGeometry = function() { + var geometry, matrix, + _this = this; + matrix = new THREE.Matrix4().getInverse(this.matrix); + return returning((geometry = new THREE.Geometry()), function() { + var face, idx, polyVerts, polygon, v, vertUvs, verts, _i, _len, _ref, _results; + _ref = _this.tree.allPolygons(); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + polygon = _ref[_i]; + polyVerts = (function() { + var _j, _len1, _ref1, _results1; + _ref1 = polygon.vertices; + _results1 = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + v = _ref1[_j]; + _results1.push(v.clone().applyMatrix4(matrix)); + } + return _results1; + })(); + _results.push((function() { + var _j, _ref1, _results1; + _results1 = []; + for (idx = _j = 2, _ref1 = polyVerts.length; 2 <= _ref1 ? _j < _ref1 : _j > _ref1; idx = 2 <= _ref1 ? ++_j : --_j) { + verts = [polyVerts[0], polyVerts[idx - 1], polyVerts[idx]]; + vertUvs = (function() { + var _k, _len1, _ref2, _ref3, _results2; + _results2 = []; + for (_k = 0, _len1 = verts.length; _k < _len1; _k++) { + v = verts[_k]; + _results2.push(new THREE.Vector2((_ref2 = v.uv) != null ? _ref2.x : void 0, (_ref3 = v.uv) != null ? _ref3.y : void 0)); + } + return _results2; + })(); + face = (function(func, args, ctor) { + ctor.prototype = func.prototype; + var child = new ctor, result = func.apply(child, args); + return Object(result) === result ? result : child; + })(THREE.Face3, __slice.call((function() { + var _k, _len1, _results2; + _results2 = []; + for (_k = 0, _len1 = verts.length; _k < _len1; _k++) { + v = verts[_k]; + _results2.push(geometry.vertices.push(v) - 1); + } + return _results2; + })()).concat([polygon.normal.clone()]), function(){}); + geometry.faces.push(face); + _results1.push(geometry.faceVertexUvs[0].push(vertUvs)); + } + return _results1; + })()); + } + return _results; + }); + }; + ThreeBSP.prototype.subtract = function(other) { + var them, us, _ref; + _ref = [this.tree.clone(), other.tree.clone()], us = _ref[0], them = _ref[1]; + us.invert().clipTo(them); + them.clipTo(us).invert().clipTo(us).invert(); + return new ThreeBSP(us.build(them.allPolygons()).invert(), this.matrix); + }; + ThreeBSP.prototype.union = function(other) { + var them, us, _ref; + _ref = [this.tree.clone(), other.tree.clone()], us = _ref[0], them = _ref[1]; + us.clipTo(them); + them.clipTo(us).invert().clipTo(us).invert(); + return new ThreeBSP(us.build(them.allPolygons()), this.matrix); + }; + ThreeBSP.prototype.intersect = function(other) { + var them, us, _ref; + _ref = [this.tree.clone(), other.tree.clone()], us = _ref[0], them = _ref[1]; + them.clipTo(us.invert()).invert().clipTo(us.clipTo(them)); + return new ThreeBSP(us.build(them.allPolygons()).invert(), this.matrix); + }; + return ThreeBSP; + })(); + ThreeBSP.Vertex = (function(_super) { + __extends(Vertex, _super); + function Vertex(x, y, z, normal, uv) { + this.normal = normal != null ? normal : new THREE.Vector3(); + this.uv = uv != null ? uv : new THREE.Vector2(); + this.interpolate = __bind(this.interpolate, this); + this.lerp = __bind(this.lerp, this); + Vertex.__super__.constructor.call(this, x, y, z); + } + Vertex.prototype.clone = function() { + return new ThreeBSP.Vertex(this.x, this.y, this.z, this.normal.clone(), this.uv.clone()); + }; + Vertex.prototype.lerp = function(v, alpha) { + var _this = this; + return returning(Vertex.__super__.lerp.apply(this, arguments), function() { + _this.uv.add(v.uv.clone().sub(_this.uv).multiplyScalar(alpha)); + return _this.normal.lerp(v, alpha); + }); + }; + Vertex.prototype.interpolate = function() { + var args, _ref; + args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + return (_ref = this.clone()).lerp.apply(_ref, args); + }; + return Vertex; + })(THREE.Vector3); + ThreeBSP.Polygon = (function() { + function Polygon(vertices, normal, w) { + this.vertices = vertices != null ? vertices : []; + this.normal = normal; + this.w = w; + this.subdivide = __bind(this.subdivide, this); + this.tessellate = __bind(this.tessellate, this); + this.classifySide = __bind(this.classifySide, this); + this.classifyVertex = __bind(this.classifyVertex, this); + this.invert = __bind(this.invert, this); + this.clone = __bind(this.clone, this); + this.calculateProperties = __bind(this.calculateProperties, this); + if (this.vertices.length) { + this.calculateProperties(); + } + } + Polygon.prototype.calculateProperties = function() { + var _this = this; + return returning(this, function() { + var a, b, c, _ref; + _ref = _this.vertices, a = _ref[0], b = _ref[1], c = _ref[2]; + _this.normal = b.clone().sub(a).cross(c.clone().sub(a)).normalize(); + return _this.w = _this.normal.clone().dot(a); + }); + }; + Polygon.prototype.clone = function() { + var v; + return new ThreeBSP.Polygon((function() { + var _i, _len, _ref, _results; + _ref = this.vertices; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + v = _ref[_i]; + _results.push(v.clone()); + } + return _results; + }).call(this), this.normal.clone(), this.w); + }; + Polygon.prototype.invert = function() { + var _this = this; + return returning(this, function() { + _this.normal.multiplyScalar(-1); + _this.w *= -1; + return _this.vertices.reverse(); + }); + }; + Polygon.prototype.classifyVertex = function(vertex) { + var side; + side = this.normal.dot(vertex) - this.w; + switch (false) { + case !(side < -EPSILON): + return BACK; + case !(side > EPSILON): + return FRONT; + default: + return COPLANAR; + } + }; + Polygon.prototype.classifySide = function(polygon) { + var back, front, tally, v, _i, _len, _ref, _ref1, + _this = this; + _ref = [0, 0], front = _ref[0], back = _ref[1]; + tally = function(v) { + switch (_this.classifyVertex(v)) { + case FRONT: + return front += 1; + case BACK: + return back += 1; + } + }; + _ref1 = polygon.vertices; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + v = _ref1[_i]; + tally(v); + } + if (front > 0 && back === 0) { + return FRONT; + } + if (front === 0 && back > 0) { + return BACK; + } + if ((front === back && back === 0)) { + return COPLANAR; + } + return SPANNING; + }; + Polygon.prototype.tessellate = function(poly) { + var b, count, f, i, j, polys, t, ti, tj, v, vi, vj, _i, _len, _ref, _ref1, _ref2, + _this = this; + _ref = { + f: [], + b: [], + count: poly.vertices.length + }, f = _ref.f, b = _ref.b, count = _ref.count; + if (this.classifySide(poly) !== SPANNING) { + return [poly]; + } + _ref1 = poly.vertices; + for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) { + vi = _ref1[i]; + vj = poly.vertices[(j = (i + 1) % count)]; + _ref2 = (function() { + var _j, _len1, _ref2, _results; + _ref2 = [vi, vj]; + _results = []; + for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { + v = _ref2[_j]; + _results.push(this.classifyVertex(v)); + } + return _results; + }).call(this), ti = _ref2[0], tj = _ref2[1]; + if (ti !== BACK) { + f.push(vi); + } + if (ti !== FRONT) { + b.push(vi); + } + if ((ti | tj) === SPANNING) { + t = (this.w - this.normal.dot(vi)) / this.normal.dot(vj.clone().sub(vi)); + v = vi.interpolate(vj, t); + f.push(v); + b.push(v); + } + } + return returning((polys = []), function() { + if (f.length >= 3) { + polys.push(new ThreeBSP.Polygon(f)); + } + if (b.length >= 3) { + return polys.push(new ThreeBSP.Polygon(b)); + } + }); + }; + Polygon.prototype.subdivide = function(polygon, coplanar_front, coplanar_back, front, back) { + var poly, side, _i, _len, _ref, _results; + _ref = this.tessellate(polygon); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + poly = _ref[_i]; + side = this.classifySide(poly); + switch (side) { + case FRONT: + _results.push(front.push(poly)); + break; + case BACK: + _results.push(back.push(poly)); + break; + case COPLANAR: + if (this.normal.dot(poly.normal) > 0) { + _results.push(coplanar_front.push(poly)); + } else { + _results.push(coplanar_back.push(poly)); + } + break; + default: + throw new Error("BUG: Polygon of classification " + side + " in subdivision"); + } + } + return _results; + }; + return Polygon; + })(); + ThreeBSP.Node = (function() { + Node.prototype.clone = function() { + var node, + _this = this; + return returning((node = new ThreeBSP.Node()), function() { + var p, _ref, _ref1, _ref2; + node.divider = (_ref = _this.divider) != null ? _ref.clone() : void 0; + node.polygons = (function() { + var _i, _len, _ref1, _results; + _ref1 = this.polygons; + _results = []; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + p = _ref1[_i]; + _results.push(p.clone()); + } + return _results; + }).call(_this); + node.front = (_ref1 = _this.front) != null ? _ref1.clone() : void 0; + return node.back = (_ref2 = _this.back) != null ? _ref2.clone() : void 0; + }); + }; + function Node(polygons) { + this.clipTo = __bind(this.clipTo, this); + this.clipPolygons = __bind(this.clipPolygons, this); + this.invert = __bind(this.invert, this); + this.allPolygons = __bind(this.allPolygons, this); + this.isConvex = __bind(this.isConvex, this); + this.build = __bind(this.build, this); + this.clone = __bind(this.clone, this); + this.polygons = []; + if ((polygons != null) && polygons.length) { + this.build(polygons); + } + } + Node.prototype.build = function(polygons) { + var _this = this; + return returning(this, function() { + var poly, polys, side, sides, _i, _len, _results; + sides = { + front: [], + back: [] + }; + if (_this.divider == null) { + _this.divider = polygons[0].clone(); + } + for (_i = 0, _len = polygons.length; _i < _len; _i++) { + poly = polygons[_i]; + _this.divider.subdivide(poly, _this.polygons, _this.polygons, sides.front, sides.back); + } + _results = []; + for (side in sides) { + if (!__hasProp.call(sides, side)) continue; + polys = sides[side]; + if (polys.length) { + if (_this[side] == null) { + _this[side] = new ThreeBSP.Node(); + } + _results.push(_this[side].build(polys)); + } else { + _results.push(void 0); + } + } + return _results; + }); + }; + Node.prototype.isConvex = function(polys) { + var inner, outer, _i, _j, _len, _len1; + for (_i = 0, _len = polys.length; _i < _len; _i++) { + inner = polys[_i]; + for (_j = 0, _len1 = polys.length; _j < _len1; _j++) { + outer = polys[_j]; + if (inner !== outer && outer.classifySide(inner) !== BACK) { + return false; + } + } + } + return true; + }; + Node.prototype.allPolygons = function() { + var _ref, _ref1; + return this.polygons.slice().concat(((_ref1 = this.front) != null ? _ref1.allPolygons() : void 0) || []).concat(((_ref = this.back) != null ? _ref.allPolygons() : void 0) || []); + }; + Node.prototype.invert = function() { + var _this = this; + return returning(this, function() { + var flipper, poly, _i, _j, _len, _len1, _ref, _ref1, _ref2; + _ref = _this.polygons; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + poly = _ref[_i]; + poly.invert(); + } + _ref1 = [_this.divider, _this.front, _this.back]; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + flipper = _ref1[_j]; + if (flipper != null) { + flipper.invert(); + } + } + return _ref2 = [_this.back, _this.front], _this.front = _ref2[0], _this.back = _ref2[1], _ref2; + }); + }; + Node.prototype.clipPolygons = function(polygons) { + var back, front, poly, _i, _len; + if (!this.divider) { + return polygons.slice(); + } + front = []; + back = []; + for (_i = 0, _len = polygons.length; _i < _len; _i++) { + poly = polygons[_i]; + this.divider.subdivide(poly, front, back, front, back); + } + if (this.front) { + front = this.front.clipPolygons(front); + } + if (this.back) { + back = this.back.clipPolygons(back); + } + return front.concat(this.back ? back : []); + }; + Node.prototype.clipTo = function(node) { + var _this = this; + return returning(this, function() { + var _ref, _ref1; + _this.polygons = node.clipPolygons(_this.polygons); + if ((_ref = _this.front) != null) { + _ref.clipTo(node); + } + return (_ref1 = _this.back) != null ? _ref1.clipTo(node) : void 0; + }); + }; + return Node; + })(); +}).call(this); +/////////////////////----------------- 流光线 ------------------ +var uniforms = { + u_time: { value: 0.0 } + }; +// 着色器设置 +const vertexShader = ` + varying vec2 vUv; + attribute float percent; + uniform float u_time; + uniform float number; + uniform float speed; + uniform float length; + varying float opacity; + uniform float size; + void main() + { + vUv = uv; + vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); + float l = clamp(1.0-length,0.0,1.0); + gl_PointSize = clamp(fract(percent*number + l - u_time*number*speed)-l ,0.0,1.) * size * (1./length); + opacity = gl_PointSize/size; + gl_Position = projectionMatrix * mvPosition; + } + ` +const fragmentShader = ` + #ifdef GL_ES + precision mediump float; + #endif + varying float opacity; + uniform vec3 color; + void main(){ + if(opacity <=0.2){ + discard; + } + gl_FragColor = vec4(color,1); + } + ` +function createFlyCurve(points, color, closed) { + var curve = new THREE.CatmullRomCurve3(points, closed); + // 流光的颜色,三个数字分别代表rgb的值,不过注意,需要除以255 + var color = color || new THREE.Vector3( 0.2235, 0.412, 1 ); + var flyLine = initFlyLine( curve, { + speed: 0.5, + color: color, + number: 5, //同时跑动的流光数量 + length: 0.3, //流光线条长度 + size: 8 //粗细 + }, 3000 ); + return flyLine; +} +function initFlyLine( curve, matSetting, pointsNumber ) { + var points = curve.getPoints( pointsNumber ); + var geometry = new THREE.BufferGeometry().setFromPoints( points ); + const length = points.length; + var percents = new Float32Array( length ); + for (let i = 0; i < points.length; i += 1) { + percents[i] = ( i / length ); + } + geometry.setAttribute( 'percent', new THREE.BufferAttribute( percents, 1 ) ); + const lineMaterial = initLineMaterial( matSetting ); + var flyLine = new THREE.Points( geometry, lineMaterial ); + return flyLine; + } + + function initLineMaterial( setting ) { + const number = setting ? ( Number( setting.number ) || 1.0 ) : 1.0; + const speed = setting ? ( Number( setting.speed ) || 1.0 ) : 1.0; + const length = setting ? ( Number( setting.length ) || 0.5 ) : 0.5; + const size = setting ? ( Number( setting.size ) || 3.0 ) : 3.0; + const color = setting ? setting.color || new THREE.Vector3( 0, 1, 1 ) : new THREE.Vector3( 0, 1, 1 ); + const singleUniforms = { + u_time: uniforms.u_time, + number: { type: 'f', value: number }, + speed: { type: 'f', value: speed }, + length: { type: 'f', value: length }, + size: { type: 'f', value: size }, + color: { type: 'v3', value: color } + }; + const lineMaterial = new THREE.ShaderMaterial( { + uniforms: singleUniforms, + vertexShader: vertexShader, + fragmentShader: fragmentShader, + transparent: true + } ); + return lineMaterial; + } +////////////////////////////////---- -------------- aes -------------------- +!function (t, n) { + "object" == typeof exports ? module.exports = exports = n() : "function" == typeof define && define.amd ? define([], n) : t.CryptoJS = n() +}(this, function () { + var t = t || function (t, n) { + var i = Object.create || function () { + function t() {} + return function (n) { + var i; + return t.prototype = n, i = new t, t.prototype = null, i + } + }(), + e = {}, + r = e.lib = {}, + o = r.Base = function () { + return { + extend: function (t) { + var n = i(this); + return t && n.mixIn(t), n.hasOwnProperty("init") && this.init !== n.init || (n.init = function () { + n.$super.init.apply(this, arguments) + }), n.init.prototype = n, n.$super = this, n + }, + create: function () { + var t = this.extend(); + return t.init.apply(t, arguments), t + }, + init: function () {}, + mixIn: function (t) { + for (var n in t) t.hasOwnProperty(n) && (this[n] = t[n]); + t.hasOwnProperty("toString") && (this.toString = t.toString) + }, + clone: function () { + return this.init.prototype.extend(this) + } + } + }(), + s = r.WordArray = o.extend({ + init: function (t, i) { + t = this.words = t || [], i != n ? this.sigBytes = i : this.sigBytes = 4 * t.length + }, + toString: function (t) { + return (t || c).stringify(this) + }, + concat: function (t) { + var n = this.words, + i = t.words, + e = this.sigBytes, + r = t.sigBytes; + if (this.clamp(), e % 4) + for (var o = 0; o < r; o++) { + var s = i[o >>> 2] >>> 24 - o % 4 * 8 & 255; + n[e + o >>> 2] |= s << 24 - (e + o) % 4 * 8 + } else + for (var o = 0; o < r; o += 4) n[e + o >>> 2] = i[o >>> 2]; + return this.sigBytes += r, this + }, + clamp: function () { + var n = this.words, + i = this.sigBytes; + n[i >>> 2] &= 4294967295 << 32 - i % 4 * 8, n.length = t.ceil(i / 4) + }, + clone: function () { + var t = o.clone.call(this); + return t.words = this.words.slice(0), t + }, + random: function (n) { + for (var i, e = [], r = function (n) { + var n = n, + i = 987654321, + e = 4294967295; + return function () { + i = 36969 * (65535 & i) + (i >> 16) & e, n = 18e3 * (65535 & n) + (n >> 16) & e; + var r = (i << 16) + n & e; + return r /= 4294967296, r += .5, r * (t.random() > .5 ? 1 : -1) + } + }, o = 0; o < n; o += 4) { + var a = r(4294967296 * (i || t.random())); + i = 987654071 * a(), e.push(4294967296 * a() | 0) + } + return new s.init(e, n) + } + }), + a = e.enc = {}, + c = a.Hex = { + stringify: function (t) { + for (var n = t.words, i = t.sigBytes, e = [], r = 0; r < i; r++) { + var o = n[r >>> 2] >>> 24 - r % 4 * 8 & 255; + e.push((o >>> 4).toString(16)), e.push((15 & o).toString(16)) + } + return e.join("") + }, + parse: function (t) { + for (var n = t.length, i = [], e = 0; e < n; e += 2) i[e >>> 3] |= parseInt(t.substr(e, 2), 16) << 24 - e % 8 * 4; + return new s.init(i, n / 2) + } + }, + u = a.Latin1 = { + stringify: function (t) { + for (var n = t.words, i = t.sigBytes, e = [], r = 0; r < i; r++) { + var o = n[r >>> 2] >>> 24 - r % 4 * 8 & 255; + e.push(String.fromCharCode(o)) + } + return e.join("") + }, + parse: function (t) { + for (var n = t.length, i = [], e = 0; e < n; e++) i[e >>> 2] |= (255 & t.charCodeAt(e)) << 24 - e % 4 * 8; + return new s.init(i, n) + } + }, + f = a.Utf8 = { + stringify: function (t) { + try { + return decodeURIComponent(escape(u.stringify(t))) + } catch (t) { + throw new Error("Malformed UTF-8 data") + } + }, + parse: function (t) { + return u.parse(unescape(encodeURIComponent(t))) + } + }, + h = r.BufferedBlockAlgorithm = o.extend({ + reset: function () { + this._data = new s.init, this._nDataBytes = 0 + }, + _append: function (t) { + "string" == typeof t && (t = f.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes + }, + _process: function (n) { + var i = this._data, + e = i.words, + r = i.sigBytes, + o = this.blockSize, + a = 4 * o, + c = r / a; + c = n ? t.ceil(c) : t.max((0 | c) - this._minBufferSize, 0); + var u = c * o, + f = t.min(4 * u, r); + if (u) { + for (var h = 0; h < u; h += o) this._doProcessBlock(e, h); + var p = e.splice(0, u); + i.sigBytes -= f + } + return new s.init(p, f) + }, + clone: function () { + var t = o.clone.call(this); + return t._data = this._data.clone(), t + }, + _minBufferSize: 0 + }), + p = (r.Hasher = h.extend({ + cfg: o.extend(), + init: function (t) { + this.cfg = this.cfg.extend(t), this.reset() + }, + reset: function () { + h.reset.call(this), this._doReset() + }, + update: function (t) { + return this._append(t), this._process(), this + }, + finalize: function (t) { + t && this._append(t); + var n = this._doFinalize(); + return n + }, + blockSize: 16, + _createHelper: function (t) { + return function (n, i) { + return new t.init(i).finalize(n) + } + }, + _createHmacHelper: function (t) { + return function (n, i) { + return new p.HMAC.init(t, i).finalize(n) + } + } + }), e.algo = {}); + return e + }(Math); + return t +}); +! function (e, t, i) { + "object" == typeof exports ? module.exports = exports = t(require("./core.min"), require("./sha1.min"), require("./hmac.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./sha1.min", "./hmac.min"], t) : t(e.CryptoJS) +}(this, function (e) { + return function () { + var t = e, + i = t.lib, + r = i.Base, + n = i.WordArray, + o = t.algo, + a = o.MD5, + c = o.EvpKDF = r.extend({ + cfg: r.extend({ + keySize: 4, + hasher: a, + iterations: 1 + }), + init: function (e) { + this.cfg = this.cfg.extend(e) + }, + compute: function (e, t) { + for (var i = this.cfg, r = i.hasher.create(), o = n.create(), a = o.words, c = i.keySize, f = i.iterations; a.length < c;) { + s && r.update(s); + var s = r.update(e).finalize(t); + r.reset(); + for (var u = 1; u < f; u++) s = r.finalize(s), r.reset(); + o.concat(s) + } + return o.sigBytes = 4 * c, o + } + }); + t.EvpKDF = function (e, t, i) { + return c.create(i).compute(e, t) + } + }(), e.EvpKDF +}); +! function (r, e) { + "object" == typeof exports ? module.exports = exports = e(require("./core.min")) : "function" == typeof define && define.amd ? define(["./core.min"], e) : e(r.CryptoJS) +}(this, function (r) { + return function () { + function e(r, e, t) { + for (var n = [], i = 0, o = 0; o < e; o++) + if (o % 4) { + var f = t[r.charCodeAt(o - 1)] << o % 4 * 2, + c = t[r.charCodeAt(o)] >>> 6 - o % 4 * 2; + n[i >>> 2] |= (f | c) << 24 - i % 4 * 8, i++ + } return a.create(n, i) + } + var t = r, + n = t.lib, + a = n.WordArray, + i = t.enc; + i.Base64 = { + stringify: function (r) { + var e = r.words, + t = r.sigBytes, + n = this._map; + r.clamp(); + for (var a = [], i = 0; i < t; i += 3) + for (var o = e[i >>> 2] >>> 24 - i % 4 * 8 & 255, f = e[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255, c = e[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255, s = o << 16 | f << 8 | c, h = 0; h < 4 && i + .75 * h < t; h++) a.push(n.charAt(s >>> 6 * (3 - h) & 63)); + var p = n.charAt(64); + if (p) + for (; a.length % 4;) a.push(p); + return a.join("") + }, + parse: function (r) { + var t = r.length, + n = this._map, + a = this._reverseMap; + if (!a) { + a = this._reverseMap = []; + for (var i = 0; i < n.length; i++) a[n.charCodeAt(i)] = i + } + var o = n.charAt(64); + if (o) { + var f = r.indexOf(o); + f !== -1 && (t = f) + } + return e(r, t, a) + }, + _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" + } + }(), r.enc.Base64 +}); +! function (e, t, r) { + "object" == typeof exports ? module.exports = exports = t(require("./core.min"), require("./evpkdf.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./evpkdf.min"], t) : t(e.CryptoJS) +}(this, function (e) { + e.lib.Cipher || function (t) { + var r = e, + i = r.lib, + n = i.Base, + c = i.WordArray, + o = i.BufferedBlockAlgorithm, + s = r.enc, + a = (s.Utf8, s.Base64), + f = r.algo, + p = f.EvpKDF, + d = i.Cipher = o.extend({ + cfg: n.extend(), + createEncryptor: function (e, t) { + return this.create(this._ENC_XFORM_MODE, e, t) + }, + createDecryptor: function (e, t) { + return this.create(this._DEC_XFORM_MODE, e, t) + }, + init: function (e, t, r) { + this.cfg = this.cfg.extend(r), this._xformMode = e, this._key = t, this.reset() + }, + reset: function () { + o.reset.call(this), this._doReset() + }, + process: function (e) { + return this._append(e), this._process() + }, + finalize: function (e) { + e && this._append(e); + var t = this._doFinalize(); + return t + }, + keySize: 4, + ivSize: 4, + _ENC_XFORM_MODE: 1, + _DEC_XFORM_MODE: 2, + _createHelper: function () { + function e(e) { + return "string" == typeof e ? B : x + } + return function (t) { + return { + encrypt: function (r, i, n) { + return e(i).encrypt(t, r, i, n) + }, + decrypt: function (r, i, n) { + return e(i).decrypt(t, r, i, n) + } + } + } + }() + }), + h = (i.StreamCipher = d.extend({ + _doFinalize: function () { + var e = this._process(!0); + return e + }, + blockSize: 1 + }), r.mode = {}), + u = i.BlockCipherMode = n.extend({ + createEncryptor: function (e, t) { + return this.Encryptor.create(e, t) + }, + createDecryptor: function (e, t) { + return this.Decryptor.create(e, t) + }, + init: function (e, t) { + this._cipher = e, this._iv = t + } + }), + l = h.CBC = function () { + function e(e, r, i) { + var n = this._iv; + if (n) { + var c = n; + this._iv = t + } else var c = this._prevBlock; + for (var o = 0; o < i; o++) e[r + o] ^= c[o] + } + var r = u.extend(); + return r.Encryptor = r.extend({ + processBlock: function (t, r) { + var i = this._cipher, + n = i.blockSize; + e.call(this, t, r, n), i.encryptBlock(t, r), this._prevBlock = t.slice(r, r + n) + } + }), r.Decryptor = r.extend({ + processBlock: function (t, r) { + var i = this._cipher, + n = i.blockSize, + c = t.slice(r, r + n); + i.decryptBlock(t, r), e.call(this, t, r, n), this._prevBlock = c + } + }), r + }(), + _ = r.pad = {}, + v = _.Pkcs7 = { + pad: function (e, t) { + for (var r = 4 * t, i = r - e.sigBytes % r, n = i << 24 | i << 16 | i << 8 | i, o = [], s = 0; s < i; s += 4) o.push(n); + var a = c.create(o, i); + e.concat(a) + }, + unpad: function (e) { + var t = 255 & e.words[e.sigBytes - 1 >>> 2]; + e.sigBytes -= t + } + }, + y = (i.BlockCipher = d.extend({ + cfg: d.cfg.extend({ + mode: l, + padding: v + }), + reset: function () { + d.reset.call(this); + var e = this.cfg, + t = e.iv, + r = e.mode; + if (this._xformMode == this._ENC_XFORM_MODE) var i = r.createEncryptor; + else { + var i = r.createDecryptor; + this._minBufferSize = 1 + } + this._mode && this._mode.__creator == i ? this._mode.init(this, t && t.words) : (this._mode = i.call(r, this, t && t.words), this._mode.__creator = i) + }, + _doProcessBlock: function (e, t) { + this._mode.processBlock(e, t) + }, + _doFinalize: function () { + var e = this.cfg.padding; + if (this._xformMode == this._ENC_XFORM_MODE) { + e.pad(this._data, this.blockSize); + var t = this._process(!0) + } else { + var t = this._process(!0); + e.unpad(t) + } + return t + }, + blockSize: 4 + }), i.CipherParams = n.extend({ + init: function (e) { + this.mixIn(e) + }, + toString: function (e) { + return (e || this.formatter).stringify(this) + } + })), + m = r.format = {}, + k = m.OpenSSL = { + stringify: function (e) { + var t = e.ciphertext, + r = e.salt; + if (r) var i = c.create([1398893684, 1701076831]).concat(r).concat(t); + else var i = t; + return i.toString(a) + }, + parse: function (e) { + var t = a.parse(e), + r = t.words; + if (1398893684 == r[0] && 1701076831 == r[1]) { + var i = c.create(r.slice(2, 4)); + r.splice(0, 4), t.sigBytes -= 16 + } + return y.create({ + ciphertext: t, + salt: i + }) + } + }, + x = i.SerializableCipher = n.extend({ + cfg: n.extend({ + format: k + }), + encrypt: function (e, t, r, i) { + i = this.cfg.extend(i); + var n = e.createEncryptor(r, i), + c = n.finalize(t), + o = n.cfg; + return y.create({ + ciphertext: c, + key: r, + iv: o.iv, + algorithm: e, + mode: o.mode, + padding: o.padding, + blockSize: e.blockSize, + formatter: i.format + }) + }, + decrypt: function (e, t, r, i) { + i = this.cfg.extend(i), t = this._parse(t, i.format); + var n = e.createDecryptor(r, i).finalize(t.ciphertext); + return n + }, + _parse: function (e, t) { + return "string" == typeof e ? t.parse(e, this) : e + } + }), + g = r.kdf = {}, + S = g.OpenSSL = { + execute: function (e, t, r, i) { + i || (i = c.random(8)); + var n = p.create({ + keySize: t + r + }).compute(e, i), + o = c.create(n.words.slice(t), 4 * r); + return n.sigBytes = 4 * t, y.create({ + key: n, + iv: o, + salt: i + }) + } + }, + B = i.PasswordBasedCipher = x.extend({ + cfg: x.cfg.extend({ + kdf: S + }), + encrypt: function (e, t, r, i) { + i = this.cfg.extend(i); + var n = i.kdf.execute(r, e.keySize, e.ivSize); + i.iv = n.iv; + var c = x.encrypt.call(this, e, t, n.key, i); + return c.mixIn(n), c + }, + decrypt: function (e, t, r, i) { + i = this.cfg.extend(i), t = this._parse(t, i.format); + var n = i.kdf.execute(r, e.keySize, e.ivSize, t.salt); + i.iv = n.iv; + var c = x.decrypt.call(this, e, t, n.key, i); + return c + } + }) + }() +}); +! function (e, i) { + "object" == typeof exports ? module.exports = exports = i(require("./core.min")) : "function" == typeof define && define.amd ? define(["./core.min"], i) : i(e.CryptoJS) +}(this, function (e) { + ! function () { + var i = e, + t = i.lib, + n = t.Base, + s = i.enc, + r = s.Utf8, + o = i.algo; + o.HMAC = n.extend({ + init: function (e, i) { + e = this._hasher = new e.init, "string" == typeof i && (i = r.parse(i)); + var t = e.blockSize, + n = 4 * t; + i.sigBytes > n && (i = e.finalize(i)), i.clamp(); + for (var s = this._oKey = i.clone(), o = this._iKey = i.clone(), a = s.words, f = o.words, c = 0; c < t; c++) a[c] ^= 1549556828, f[c] ^= 909522486; + s.sigBytes = o.sigBytes = n, this.reset() + }, + reset: function () { + var e = this._hasher; + e.reset(), e.update(this._iKey) + }, + update: function (e) { + return this._hasher.update(e), this + }, + finalize: function (e) { + var i = this._hasher, + t = i.finalize(e); + i.reset(); + var n = i.finalize(this._oKey.clone().concat(t)); + return n + } + }) + }() +}); +! function (e, o, r) { + "object" == typeof exports ? module.exports = exports = o(require("./core.min"), require("./cipher-core.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./cipher-core.min"], o) : o(e.CryptoJS) +}(this, function (e) { + return e.mode.ECB = function () { + var o = e.lib.BlockCipherMode.extend(); + return o.Encryptor = o.extend({ + processBlock: function (e, o) { + this._cipher.encryptBlock(e, o) + } + }), o.Decryptor = o.extend({ + processBlock: function (e, o) { + this._cipher.decryptBlock(e, o) + } + }), o + }(), e.mode.ECB +}); +! function (e, r, i) { + "object" == typeof exports ? module.exports = exports = r(require("./core.min"), require("./cipher-core.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./cipher-core.min"], r) : r(e.CryptoJS) +}(this, function (e) { + return e.pad.Pkcs7 +}); +! function (e, r, i) { + "object" == typeof exports ? module.exports = exports = r(require("./core.min"), require("./enc-base64.min"), require("./md5.min"), require("./evpkdf.min"), require("./cipher-core.min")) : "function" == typeof define && define.amd ? define(["./core.min", "./enc-base64.min", "./md5.min", "./evpkdf.min", "./cipher-core.min"], r) : r(e.CryptoJS) +}(this, function (e) { + return function () { + var r = e, + i = r.lib, + n = i.BlockCipher, + o = r.algo, + t = [], + c = [], + s = [], + f = [], + a = [], + d = [], + u = [], + v = [], + h = [], + y = []; + ! function () { + for (var e = [], r = 0; r < 256; r++) r < 128 ? e[r] = r << 1 : e[r] = r << 1 ^ 283; + for (var i = 0, n = 0, r = 0; r < 256; r++) { + var o = n ^ n << 1 ^ n << 2 ^ n << 3 ^ n << 4; + o = o >>> 8 ^ 255 & o ^ 99, t[i] = o, c[o] = i; + var p = e[i], + l = e[p], + _ = e[l], + k = 257 * e[o] ^ 16843008 * o; + s[i] = k << 24 | k >>> 8, f[i] = k << 16 | k >>> 16, a[i] = k << 8 | k >>> 24, d[i] = k; + var k = 16843009 * _ ^ 65537 * l ^ 257 * p ^ 16843008 * i; + u[o] = k << 24 | k >>> 8, v[o] = k << 16 | k >>> 16, h[o] = k << 8 | k >>> 24, y[o] = k, i ? (i = p ^ e[e[e[_ ^ p]]], n ^= e[e[n]]) : i = n = 1 + } + }(); + var p = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], + l = o.AES = n.extend({ + _doReset: function () { + if (!this._nRounds || this._keyPriorReset !== this._key) { + for (var e = this._keyPriorReset = this._key, r = e.words, i = e.sigBytes / 4, n = this._nRounds = i + 6, o = 4 * (n + 1), c = this._keySchedule = [], s = 0; s < o; s++) + if (s < i) c[s] = r[s]; + else { + var f = c[s - 1]; + s % i ? i > 6 && s % i == 4 && (f = t[f >>> 24] << 24 | t[f >>> 16 & 255] << 16 | t[f >>> 8 & 255] << 8 | t[255 & f]) : (f = f << 8 | f >>> 24, f = t[f >>> 24] << 24 | t[f >>> 16 & 255] << 16 | t[f >>> 8 & 255] << 8 | t[255 & f], f ^= p[s / i | 0] << 24), c[s] = c[s - i] ^ f + } for (var a = this._invKeySchedule = [], d = 0; d < o; d++) { + var s = o - d; + if (d % 4) var f = c[s]; + else var f = c[s - 4]; + d < 4 || s <= 4 ? a[d] = f : a[d] = u[t[f >>> 24]] ^ v[t[f >>> 16 & 255]] ^ h[t[f >>> 8 & 255]] ^ y[t[255 & f]] + } + } + }, + encryptBlock: function (e, r) { + this._doCryptBlock(e, r, this._keySchedule, s, f, a, d, t) + }, + decryptBlock: function (e, r) { + var i = e[r + 1]; + e[r + 1] = e[r + 3], e[r + 3] = i, this._doCryptBlock(e, r, this._invKeySchedule, u, v, h, y, c); + var i = e[r + 1]; + e[r + 1] = e[r + 3], e[r + 3] = i + }, + _doCryptBlock: function (e, r, i, n, o, t, c, s) { + for (var f = this._nRounds, a = e[r] ^ i[0], d = e[r + 1] ^ i[1], u = e[r + 2] ^ i[2], v = e[r + 3] ^ i[3], h = 4, y = 1; y < f; y++) { + var p = n[a >>> 24] ^ o[d >>> 16 & 255] ^ t[u >>> 8 & 255] ^ c[255 & v] ^ i[h++], + l = n[d >>> 24] ^ o[u >>> 16 & 255] ^ t[v >>> 8 & 255] ^ c[255 & a] ^ i[h++], + _ = n[u >>> 24] ^ o[v >>> 16 & 255] ^ t[a >>> 8 & 255] ^ c[255 & d] ^ i[h++], + k = n[v >>> 24] ^ o[a >>> 16 & 255] ^ t[d >>> 8 & 255] ^ c[255 & u] ^ i[h++]; + a = p, d = l, u = _, v = k + } + var p = (s[a >>> 24] << 24 | s[d >>> 16 & 255] << 16 | s[u >>> 8 & 255] << 8 | s[255 & v]) ^ i[h++], + l = (s[d >>> 24] << 24 | s[u >>> 16 & 255] << 16 | s[v >>> 8 & 255] << 8 | s[255 & a]) ^ i[h++], + _ = (s[u >>> 24] << 24 | s[v >>> 16 & 255] << 16 | s[a >>> 8 & 255] << 8 | s[255 & d]) ^ i[h++], + k = (s[v >>> 24] << 24 | s[a >>> 16 & 255] << 16 | s[d >>> 8 & 255] << 8 | s[255 & u]) ^ i[h++]; + e[r] = p, e[r + 1] = l, e[r + 2] = _, e[r + 3] = k + }, + keySize: 8 + }); + r.AES = n._createHelper(l) + }(), e.AES +}); +! function (e, n) { + "object" == typeof exports ? module.exports = exports = n(require("./core.min")) : "function" == typeof define && define.amd ? define(["./core.min"], n) : n(e.CryptoJS) +}(this, function (e) { + return e.enc.Utf8 +}); +/* + * 热力图 heatmap.js v2.0.2 + */ +(function(a,b,c){if(typeof module!=="undefined"&&module.exports){module.exports=c()}else if(typeof define==="function"&&define.amd){define(c)}else{b[a]=c()}})("h337",this,function(){var a={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};var b=function h(){var b=function d(a){this._coordinator={};this._data=[];this._radi=[];this._min=0;this._max=1;this._xField=a["xField"]||a.defaultXField;this._yField=a["yField"]||a.defaultYField;this._valueField=a["valueField"]||a.defaultValueField;if(a["radius"]){this._cfgRadius=a["radius"]}};var c=a.defaultRadius;b.prototype={_organiseData:function(a,b){var d=a[this._xField];var e=a[this._yField];var f=this._radi;var g=this._data;var h=this._max;var i=this._min;var j=a[this._valueField]||1;var k=a.radius||this._cfgRadius||c;if(!g[d]){g[d]=[];f[d]=[]}if(!g[d][e]){g[d][e]=j;f[d][e]=k}else{g[d][e]+=j}if(g[d][e]>h){if(!b){this._max=g[d][e]}else{this.setDataMax(g[d][e])}return false}else{return{x:d,y:e,value:j,radius:k,min:i,max:h}}},_unOrganizeData:function(){var a=[];var b=this._data;var c=this._radi;for(var d in b){for(var e in b[d]){a.push({x:d,y:e,radius:c[d][e],value:b[d][e]})}}return{min:this._min,max:this._max,data:a}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0){var a=arguments[0];var b=a.length;while(b--){this.addData.call(this,a[b])}}else{var c=this._organiseData(arguments[0],true);if(c){this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[c]})}}return this},setData:function(a){var b=a.data;var c=b.length;this._data=[];this._radi=[];for(var d=0;d0){this._drawAlpha(a);this._colorize()}},renderAll:function(a){this._clear();if(a.data.length>0){this._drawAlpha(c(a));this._colorize()}},_updateGradient:function(b){this._palette=a(b)},updateConfig:function(a){if(a["gradient"]){this._updateGradient(a)}this._setStyles(a)},setDimensions:function(a,b){this._width=a;this._height=b;this.canvas.width=this.shadowCanvas.width=a;this.canvas.height=this.shadowCanvas.height=b},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height);this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(a){this._blur=a.blur==0?0:a.blur||a.defaultBlur;if(a.backgroundColor){this.canvas.style.backgroundColor=a.backgroundColor}this._width=this.canvas.width=this.shadowCanvas.width=a.width||this._width;this._height=this.canvas.height=this.shadowCanvas.height=a.height||this._height;this._opacity=(a.opacity||0)*255;this._maxOpacity=(a.maxOpacity||a.defaultMaxOpacity)*255;this._minOpacity=(a.minOpacity||a.defaultMinOpacity)*255;this._useGradientOpacity=!!a.useGradientOpacity},_drawAlpha:function(a){var c=this._min=a.min;var d=this._max=a.max;var a=a.data||[];var e=a.length;var f=1-this._blur;while(e--){var g=a[e];var h=g.x;var i=g.y;var j=g.radius;var k=Math.min(g.value,d);var l=h-j;var m=i-j;var n=this.shadowCtx;var o;if(!this._templates[j]){this._templates[j]=o=b(j,f)}else{o=this._templates[j]}var p=(k-c)/(d-c);n.globalAlpha=p<.01?.01:p;n.drawImage(o,l,m);if(lthis._renderBoundaries[2]){this._renderBoundaries[2]=l+2*j}if(m+2*j>this._renderBoundaries[3]){this._renderBoundaries[3]=m+2*j}}},_colorize:function(){var a=this._renderBoundaries[0];var b=this._renderBoundaries[1];var c=this._renderBoundaries[2]-a;var d=this._renderBoundaries[3]-b;var e=this._width;var f=this._height;var g=this._opacity;var h=this._maxOpacity;var i=this._minOpacity;var j=this._useGradientOpacity;if(a<0){a=0}if(b<0){b=0}if(a+c>e){c=e-a}if(b+d>f){d=f-b}var k=this.shadowCtx.getImageData(a,b,c,d);var l=k.data;var m=l.length;var n=this._palette;for(var o=3;o0){r=g}else{if(p>0;return b},getDataURL:function(){return this.canvas.toDataURL()}};return d}();var d=function j(){var b=false;if(a["defaultRenderer"]==="canvas2d"){b=c}return b}();var e={merge:function(){var a={};var b=arguments.length;for(var c=0;ct.length)&&(e=t.length);for(var r=0,i=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(255, 255, 255, 1)";return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),(t=u.call(this,new c.SpriteMaterial))._text="".concat(e),t._textHeight=r,t._color=i,t._backgroundColor=!1,t._padding=0,t._borderWidth=0,t._borderRadius=0,t._borderColor="white",t._strokeWidth=0,t._strokeColor="white",t._fontFace="system-ui",t._fontSize=90,t._fontWeight="normal",t._canvas=document.createElement("canvas"),t._genCanvas(),t}return r=f,(n=[{key:"text",get:function(){return this._text},set:function(t){this._text=t,this._genCanvas()}},{key:"textHeight",get:function(){return this._textHeight},set:function(t){this._textHeight=t,this._genCanvas()}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this._genCanvas()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._genCanvas()}},{key:"padding",get:function(){return this._padding},set:function(t){this._padding=t,this._genCanvas()}},{key:"borderWidth",get:function(){return this._borderWidth},set:function(t){this._borderWidth=t,this._genCanvas()}},{key:"borderRadius",get:function(){return this._borderRadius},set:function(t){this._borderRadius=t,this._genCanvas()}},{key:"borderColor",get:function(){return this._borderColor},set:function(t){this._borderColor=t,this._genCanvas()}},{key:"fontFace",get:function(){return this._fontFace},set:function(t){this._fontFace=t,this._genCanvas()}},{key:"fontSize",get:function(){return this._fontSize},set:function(t){this._fontSize=t,this._genCanvas()}},{key:"fontWeight",get:function(){return this._fontWeight},set:function(t){this._fontWeight=t,this._genCanvas()}},{key:"strokeWidth",get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=t,this._genCanvas()}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this._genCanvas()}},{key:"_genCanvas",value:function(){var t=this,e=this._canvas,r=e.getContext("2d"),i=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],n=i.map((function(e){return e*t.fontSize*.1})),o=(Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius]).map((function(e){return e*t.fontSize*.1})),s=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],u=s.map((function(e){return e*t.fontSize*.1})),f=this.text.split("\n"),l="".concat(this.fontWeight," ").concat(this.fontSize,"px ").concat(this.fontFace);r.font=l;var d=Math.max.apply(Math,h(f.map((function(t){return r.measureText(t).width})))),p=this.fontSize*f.length;if(e.width=d+2*n[0]+2*u[0],e.height=p+2*n[1]+2*u[1],this.borderWidth){if(r.strokeStyle=this.borderColor,n[0]){var g=n[0]/2;r.lineWidth=n[0],r.beginPath(),r.moveTo(g,o[0]),r.lineTo(g,e.height-o[3]),r.moveTo(e.width-g,o[1]),r.lineTo(e.width-g,e.height-o[2]),r.stroke()}if(n[1]){var y=n[1]/2;r.lineWidth=n[1],r.beginPath(),r.moveTo(Math.max(n[0],o[0]),y),r.lineTo(e.width-Math.max(n[0],o[1]),y),r.moveTo(Math.max(n[0],o[3]),e.height-y),r.lineTo(e.width-Math.max(n[0],o[2]),e.height-y),r.stroke()}if(this.borderRadius){var b=Math.max.apply(Math,h(n)),v=b/2;r.lineWidth=b,r.beginPath(),[!!o[0]&&[o[0],v,v,o[0]],!!o[1]&&[e.width-o[1],e.width-v,v,o[1]],!!o[2]&&[e.width-o[2],e.width-v,e.height-v,e.height-o[2]],!!o[3]&&[o[3],v,e.height-v,e.height-o[3]]].filter((function(t){return t})).forEach((function(t){var e=a(t,4),i=e[0],n=e[1],o=e[2],h=e[3];r.moveTo(i,o),r.quadraticCurveTo(n,o,n,h)})),r.stroke()}}this.backgroundColor&&(r.fillStyle=this.backgroundColor,this.borderRadius?(r.beginPath(),r.moveTo(n[0],o[0]),[[n[0],o[0],e.width-o[1],n[1],n[1],n[1]],[e.width-n[0],e.width-n[0],e.width-n[0],n[1],o[1],e.height-o[2]],[e.width-n[0],e.width-o[2],o[3],e.height-n[1],e.height-n[1],e.height-n[1]],[n[0],n[0],n[0],e.height-n[1],e.height-o[3],o[0]]].forEach((function(t){var e=a(t,6),i=e[0],n=e[1],o=e[2],h=e[3],s=e[4],u=e[5];r.quadraticCurveTo(i,h,n,s),r.lineTo(o,u)})),r.closePath(),r.fill()):r.fillRect(n[0],n[1],e.width-2*n[0],e.height-2*n[1])),r.translate.apply(r,h(n)),r.translate.apply(r,h(u)),r.font=l,r.fillStyle=this.color,r.textBaseline="bottom";var _=this.strokeWidth>0;_&&(r.lineWidth=this.strokeWidth*this.fontSize/10,r.strokeStyle=this.strokeColor),f.forEach((function(e,i){var n=(d-r.measureText(e).width)/2,o=(i+1)*t.fontSize;_&&r.strokeText(e,n,o),r.fillText(e,n,o)})),this.material.map&&this.material.map.dispose();var m=this.material.map=new c.Texture(e);m.minFilter=c.LinearFilter,m.colorSpace=c.SRGBColorSpace,m.needsUpdate=!0;var w=spriteScale;this.scale.set(w*e.width/e.height,w,1);this.userData.width=e.width*0.25;this.userData.height=e.height*0.25;}},{key:"clone",value:function(){return new this.constructor(this.text,this.textHeight,this.color).copy(this)}},{key:"copy",value:function(t){return c.Sprite.prototype.copy.call(this,t),this.color=t.color,this.backgroundColor=t.backgroundColor,this.padding=t.padding,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.fontFace=t.fontFace,this.fontSize=t.fontSize,this.fontWeight=t.fontWeight,this.strokeWidth=t.strokeWidth,this.strokeColor=t.strokeColor,this}}])&&e(r.prototype,n),s&&e(r,s),Object.defineProperty(r,"prototype",{writable:!1}),f}(c.Sprite);return f}));