From aa332f38c619b8d674a72a143824377d7465b5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=93=B6=E4=B8=AD=E6=B2=99?= <464652163@qq.com> Date: Tue, 9 Jan 2024 19:09:26 +0800 Subject: [PATCH] 123 --- src/views/bim/bimHome/components/ThreeView2.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/views/bim/bimHome/components/ThreeView2.vue b/src/views/bim/bimHome/components/ThreeView2.vue index 0f664cf..4a2de19 100644 --- a/src/views/bim/bimHome/components/ThreeView2.vue +++ b/src/views/bim/bimHome/components/ThreeView2.vue @@ -598,14 +598,14 @@ const yjf = () => { } let xfobj = []; let yjobj = []; +let sprite = null; // 消防标签 const xfadd = (obj, state) => { const texLoader = new THREE.TextureLoader(); let texture = null; if(state == 'yj') { texture = texLoader.load("/yj.png"); - } - else if (state) { + } else if (state) { texture = texLoader.load("/ygr.png"); } else { texture = texLoader.load("/yg.png"); @@ -613,7 +613,7 @@ const xfadd = (obj, state) => { const spriteMaterial = new THREE.SpriteMaterial({ map: texture, }); - const sprite = new THREE.Sprite(spriteMaterial); + sprite = new THREE.Sprite(spriteMaterial); // 控制精灵大小 sprite.scale.set(5, 5, 5); sprite.position.y = 12; //标签底部箭头和空对象标注点重合 @@ -639,7 +639,7 @@ const removexf = () => { // 更换纹理贴图方法 const changeMap = (img) => { // 测试移除消防图标 - // removexf(); + removexf(); isShowWall.value = true; // 获取墙体 model.traverse(e => { @@ -701,6 +701,7 @@ const check = () => { let nextObj; if (checkindex == checkArr.length - 1) { nextObj = checkArr[0].getWorldPosition(new THREE.Vector3()) + return; } else if (checkindex < checkArr.length) { nextObj = checkArr[checkindex + 1].getWorldPosition(new THREE.Vector3()) } @@ -723,7 +724,7 @@ const check = () => { // 巡检结束 const checkComplete = () => { toHomeView(); - // checkindex = 0; + checkindex = 0; bimStore().setCheckArr(romeObj); emit('checkComplete', romeObj); return;