廖杰:完成预览模式下鼠标离开设备,面板自动消失,调整面板字体,设备选中的箭头优化

This commit is contained in:
Hcat
2024-03-18 19:26:45 +08:00
parent b90d5d5911
commit 9e3d896259
5 changed files with 100 additions and 107 deletions

View File

@@ -174,7 +174,7 @@ export default class Demo {
}
// 模型加载完函数
_afterLoaded(scene, isedit) {
console.log(isedit);
// console.log(isedit);
// 可以进行选中
this._hoverModel(this.points, isedit);
// 可以进行点击
@@ -254,9 +254,10 @@ export default class Demo {
this.preHover = intersects[0].object;
} else {
if (isedit != true) {
console.log(isedit);
// console.log(isedit);
//附着点设置方框
this.setBoxHelper(intersects[0].object);
this._handleLHover(intersects[0].object);
}
this.preHover.material.color.set("white");
@@ -267,10 +268,17 @@ export default class Demo {
const tagP = intersects[0].object.getWorldPosition(
new this.THREE.Vector3()
);
// if (isedit != false) {
this._checkAnimation(tagP);
// }
} else {
if (!this.preHover) return;
//当鼠标移出的时候,将轨道控制器打开,并且将面板关闭
if (isedit != true) {
this.isControlOrbit(true)
this.clearTagsObj(isedit)
}
this.preHover.material.color.set("white");
}
// this._handleLHover(intersects[0].object);
@@ -374,7 +382,8 @@ export default class Demo {
// this.tag3CSS2DObj.scale.set(0.001, 0.001, 0.001); //编辑框
// this.tag3CSS2DObj.position.set(1, 0, 1);
}
clearTagsObj() {
// 让面板消失的函数
clearTagsObj(isedit) {
if (this.preDBLModel) {
this.preDBLModel.remove(this.tagCSS2DObj);
}
@@ -383,7 +392,7 @@ export default class Demo {
this.scene.remove(this.tag3CSS2DObj);
this.tag3CSS2DObj.element.style.opacity = "0";
// 删除标记动画
this.scene.remove(this.group);
// this.scene.remove(this.group);
}
// 附着点选中线宽包围

View File

@@ -1,7 +1,7 @@
export function handleLHover(targetPoint) {
// 保存进入状态
this._saveState();
this.clearTagsObj();
// this.clearTagsObj();
// 全局临时标记该选中的模型;
this.targetPoint = targetPoint;
const worldPosition = new this.THREE.Vector3();