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