Compare commits

...

2 Commits

Author SHA1 Message Date
xief
c586096fe0 更新版本号 2021-04-08 14:56:48 +08:00
xief
0aa70fdb14 新增鼠标选择回调事件 2021-03-17 15:53:32 +08:00
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "cadview", "name": "cadview",
"version": "1.2.3", "version": "1.2.5",
"description": "", "description": "",
"main": "src/index.ts", "main": "src/index.ts",
"private": true, "private": true,

View File

@ -10,7 +10,7 @@ export class ViewerSettings
{ {
boardMaterial: MeshBasicMaterial = boardMaterial; boardMaterial: MeshBasicMaterial = boardMaterial;
selectMaterial: MeshBasicMaterial = selectMaterial; selectMaterial: MeshBasicMaterial = selectMaterial;
selectByPointCallback: (meshId: number) => void = () => { };
} }
export class Viewer export class Viewer
@ -211,6 +211,10 @@ export class Viewer
{ {
this.oldMesh = mesh; this.oldMesh = mesh;
mesh.material = this._Settings.selectMaterial; mesh.material = this._Settings.selectMaterial;
if (this._Settings.selectByPointCallback)
{
this._Settings.selectByPointCallback(mesh.id);
}
} }
this.m_bNeedUpdate = true; this.m_bNeedUpdate = true;
} }