Merge pull request 'trp_dev' (#403) from trp_dev into dengjie
Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/403
This commit is contained in:
@@ -259,7 +259,9 @@ export default class Demo {
|
|||||||
const raycaster = new this.THREE.Raycaster();
|
const raycaster = new this.THREE.Raycaster();
|
||||||
raycaster.setFromCamera(mouse, this.camera);
|
raycaster.setFromCamera(mouse, this.camera);
|
||||||
const intersects = raycaster.intersectObjects(hoverModels);
|
const intersects = raycaster.intersectObjects(hoverModels);
|
||||||
|
|
||||||
if (intersects.length > 0) {
|
if (intersects.length > 0) {
|
||||||
|
if(Object.keys(intersects[0].object).includes('enableHover') && !intersects[0].object.enableHover)return;
|
||||||
if (!this.preHover) {
|
if (!this.preHover) {
|
||||||
this.preHover = intersects[0].object;
|
this.preHover = intersects[0].object;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -364,6 +364,16 @@ function changeFanColor(fanData, targetPoint, scene) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function clearTunnelEquipments() {
|
export function clearTunnelEquipments() {
|
||||||
|
if (this.group) this.scene.remove(this.group);
|
||||||
|
if (this.scene.getObjectByName("boxHelper")) {
|
||||||
|
const preModel = this.scene.getObjectByName("boxHelper");
|
||||||
|
this.scene.remove(preModel);
|
||||||
|
}
|
||||||
|
this.scene.traverse(function (point) {
|
||||||
|
if (/^point/.test(point.name)) {
|
||||||
|
point.hasDevice = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
this.deviceModels.forEach((deviceModel) => {
|
this.deviceModels.forEach((deviceModel) => {
|
||||||
this.scene.remove(this.scene.getObjectById(deviceModel.objId));
|
this.scene.remove(this.scene.getObjectById(deviceModel.objId));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
export function editTunnelInit(equipmentList) {
|
export function editTunnelInit(equipmentList) {
|
||||||
// 清空设备
|
// 清空设备
|
||||||
this.clearTunnelEquipments()
|
this.clearTunnelEquipments();
|
||||||
//初始化将墙壁隐藏起来
|
//初始化将墙壁隐藏起来
|
||||||
equipmentList.forEach((item) => {
|
equipmentList.forEach((item) => {
|
||||||
// 根据定位获取附着点信息
|
// 根据定位获取附着点信息
|
||||||
const target = this.scene.getObjectByName(item.position);
|
const target = this.scene.getObjectByName(item.position);
|
||||||
this.addEquipment(target, item, 1);
|
this.addEquipment(target, item, 1);
|
||||||
});
|
});
|
||||||
|
this.scene.traverse(function (point) {
|
||||||
|
if (/^point/.test(point.name)) {
|
||||||
|
point.enableHover =
|
||||||
|
equipmentList.findIndex((item) => item.position === point.name) >= 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export function handleLHover(targetPoint) {
|
export function handleLHover(targetPoint) {
|
||||||
|
// if(Object.keys(targetPoint).includes('enableHover') && !targetPoint.enableHover)return;
|
||||||
if (this.tag3CSS2DObj.element.style.opacity != '1') {
|
if (this.tag3CSS2DObj.element.style.opacity != '1') {
|
||||||
// 保存进入状态
|
// 保存进入状态
|
||||||
this._saveState();
|
this._saveState();
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ export default function previewtunnelModeInit(equipmentList, fanData) {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// console.log(equipmentList);
|
// console.log(equipmentList);
|
||||||
|
|
||||||
equipmentList.forEach((item) => {
|
equipmentList.forEach((item) => {
|
||||||
this.addEquipment(this.scene.getObjectByName(item.position), item, fanData);
|
this.addEquipment(this.scene.getObjectByName(item.position), item, fanData);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user