1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 21:35:38 +02:00

Update engine.ts

This commit is contained in:
syuilo
2026-04-04 17:18:55 +09:00
parent 85dea8b49d
commit 49823f9ec3

View File

@@ -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