From c5f237fc9cb8f28b87414204a103ef627dc9c573 Mon Sep 17 00:00:00 2001 From: luoyifan Date: Tue, 17 Jun 2025 23:43:29 +0800 Subject: [PATCH] =?UTF-8?q?BaseRenderer=20update=20/create=20=E9=83=BD?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=A0=B9=E6=8D=AE=20storeAt=20=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E8=B4=A7=E6=9E=B6=E6=89=80=E5=9C=A8=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/base/BaseRenderer.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/core/base/BaseRenderer.ts b/src/core/base/BaseRenderer.ts index 57a15ad..375c808 100644 --- a/src/core/base/BaseRenderer.ts +++ b/src/core/base/BaseRenderer.ts @@ -131,6 +131,14 @@ export default abstract class BaseRenderer { createPoint(item: ItemJson, option?: RendererCudOption): Object3DLike { // 由基础类创造一个属于自己的点演示 const point = this.createPointBasic(item, option) + const matrix = this.calcMeshMatrix(item, option) + point.setMatrix4(matrix) + + point.visible = ((typeof item.v !== 'undefined') ? item.v : true) + return point + } + + calcMeshMatrix(item: ItemJson, option?: RendererCudOption) { let matrix = getMatrixFromTf(item.tf) if (item.dt.storeAt?.item) { @@ -169,13 +177,9 @@ export default abstract class BaseRenderer { item.tf[1] = _.cloneDeep(option.rotation) } - point.setMatrix4(matrix) - - point.visible = ((typeof item.v !== 'undefined') ? item.v : true) - return point + return matrix } - /** * 删除一个点 * @param id 点的唯一标识 @@ -237,7 +241,10 @@ export default abstract class BaseRenderer { // if (point instanceof PointManageWrap) { // point.manager.syncMeshObject3D(point) // } - point.setMatrix4(getMatrixFromTf(item.tf)) + const matrix = this.calcMeshMatrix(item, option) + point.setMatrix4(matrix) + + point.visible = ((typeof item.v !== 'undefined') ? item.v : true) return point }