From 49823f9ec36b464c35108e72cbaeb511c23530be Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sat, 4 Apr 2026 17:18:55 +0900 Subject: [PATCH] Update engine.ts --- packages/frontend/src/utility/room/engine.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index a9192e3d28..760d2eb883 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -678,7 +678,7 @@ export class RoomEngine { const oid = pickingInfo.pickedMesh.metadata.objectId; if (oid != null && this.objectEntities.has(oid)) { const o = this.objectEntities.get(oid)!; - const boundingInfo = getMeshesBoundingBox(o.rootMesh.getChildMeshes()); + const boundingInfo = getMeshesBoundingBox(o.rootMesh.getChildMeshes().filter(m => m.isEnabled() && m.isVisible)); this.camera.setTarget(boundingInfo.center); this.selectObject(oid); } @@ -1578,7 +1578,7 @@ export class RoomObjectPreviewEngine { // なぜかちょっと待たないとbounding boxのサイズが正しくない window.setTimeout(() => { - const boundingInfo = getMeshesBoundingBox(this.objectMesh!.getChildMeshes()); + const boundingInfo = getMeshesBoundingBox(this.objectMesh!.getChildMeshes().filter(m => m.isEnabled() && m.isVisible)); this.camera.setTarget(new BABYLON.Vector3(0, boundingInfo.center.y, 0)); // zoom to fit