邓洁 : 隧道模型合并

This commit is contained in:
dengj
2023-12-07 15:58:43 +08:00
parent 7766cd16ef
commit 5f14289731
25 changed files with 438499 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
export function addDev(devId) {
if (!this.checkDevId) {
alert("请选择设备");
return;
}
const devModel = this.devMap.get(devId).clone();
handleLoadedDevice.call(this, devModel);
}
function handleLoadedDevice(model) {
if (!this.targetPoint) return;
//获取定位位置
const wp = this.targetPoint.getWorldPosition(new this.THREE.Vector3());
model.position.copy(wp);
this.targetPoint.visible = false;
this.scene.add(model);
if (model.name === "camera") {
model.translateX(-5);
model.translateZ(4);
model.translateY(-0.5);
}
// 添加的信息请求或初始化的信息
this.targetPoint.info = {
name: "摄像头",
state: "未开启",
devId: model.id,
};
this.targetPoint.hasDevice = true;
}