Merge pull request '修复点击设备卡墙视角中间' (#234) from LJ into dev

Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/234
This commit is contained in:
liaojie
2024-01-14 13:19:58 +00:00
3 changed files with 3 additions and 4 deletions

View File

@@ -49,7 +49,6 @@ import { OBJLoader } from "three/examples/jsm/loaders/OBJLoader";
import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader"; import { RGBELoader } from "three/examples/jsm/loaders/RGBELoader";
import { onMounted, reactive, ref, toRaw, watch } from "vue"; import { onMounted, reactive, ref, toRaw, watch } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { useModelSceneStore } from "@/store/modelSceneStore"; import { useModelSceneStore } from "@/store/modelSceneStore";
// 获取html标签跟随组件dom // 获取html标签跟随组件dom
const content = ref(null); const content = ref(null);

View File

@@ -227,7 +227,6 @@ export default class Demo {
this.preHover.material.color.set("white"); this.preHover.material.color.set("white");
this.preHover = intersects[0].object; this.preHover = intersects[0].object;
} }
intersects[0].object.material.color.set("red"); intersects[0].object.material.color.set("red");
const tagP = intersects[0].object.getWorldPosition( const tagP = intersects[0].object.getWorldPosition(
new this.THREE.Vector3() new this.THREE.Vector3()

View File

@@ -21,12 +21,12 @@ export function handleLClick(targetPoint) {
this.tag3CSS2DObj.translateX(3); this.tag3CSS2DObj.translateX(3);
this.tag3CSS2DObj.translateZ(10); this.tag3CSS2DObj.translateZ(10);
this.tag3CSS2DObj.translateY(-5); this.tag3CSS2DObj.translateY(-5);
intoAnimation.call(this, 4.31, -2.55, -11); intoAnimation.call(this, 1.31, -2.55, -11);
} else if (/tl$/.test(targetPoint.name)) { } else if (/tl$/.test(targetPoint.name)) {
this.tag3CSS2DObj.translateX(-3); this.tag3CSS2DObj.translateX(-3);
this.tag3CSS2DObj.translateZ(10); this.tag3CSS2DObj.translateZ(10);
this.tag3CSS2DObj.translateY(-5); this.tag3CSS2DObj.translateY(-5);
intoAnimation.call(this, -4.31, -2.55, -11); intoAnimation.call(this, -1.31, -2.55, -11);
} else if (/tc$/.test(targetPoint.name)) { } else if (/tc$/.test(targetPoint.name)) {
this.tag3CSS2DObj.translateX(0); this.tag3CSS2DObj.translateX(0);
this.tag3CSS2DObj.translateZ(10); this.tag3CSS2DObj.translateZ(10);
@@ -49,6 +49,7 @@ export function handleLClick(targetPoint) {
} }
function intoAnimation(x = -10, y = 3, z = -12) { function intoAnimation(x = -10, y = 3, z = -12) {
//获取当前附着点的世界坐标
const worldP = this.targetPoint.getWorldPosition(new this.THREE.Vector3()); const worldP = this.targetPoint.getWorldPosition(new this.THREE.Vector3());
const positionOBj = this.camera.position; const positionOBj = this.camera.position;
const start = this.orbitControls.target; const start = this.orbitControls.target;