From 86659233372fc8faa1f422966c12d50a3efad5c0 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Fri, 13 Feb 2026 14:10:02 +0900 Subject: [PATCH] wip --- packages/frontend/src/pages/room.vue | 8 ++++++++ packages/frontend/src/utility/room/engine.ts | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/pages/room.vue b/packages/frontend/src/pages/room.vue index cfaaf80bcf..2d07282bd6 100644 --- a/packages/frontend/src/pages/room.vue +++ b/packages/frontend/src/pages/room.vue @@ -25,6 +25,10 @@ const canvas = useTemplateRef('canvas'); let engine: RoomEngine; +function resize() { + if (engine != null) engine.resize(); +} + onMounted(() => { engine = new RoomEngine({ roomType: 'default', @@ -184,10 +188,14 @@ onMounted(() => { engine.init(); canvas.value!.focus(); + + window.addEventListener('resize', resize); }); onUnmounted(() => { engine.destroy(); + + window.removeEventListener('resize', resize); }); function onKeydown(ev: KeyboardEvent) { diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index 603881b099..5b5ad08869 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -286,8 +286,7 @@ const OBJECTS = { castShadows: false, onInit: (room, o, obj) => { const rotor = obj.meshes[0].getChildMeshes().find(m => m.name === 'Rotor') as BABYLON.Mesh; - rotor.rotationQuaternion = null; - console.log(obj.meshes, obj.meshes[0].getChildMeshes().map(x => x.name), rotor, rotor.getChildMeshes()); + rotor.rotation = rotor.rotationQuaternion != null ? rotor.rotationQuaternion.toEulerAngles() : rotor.rotation; const anim = new BABYLON.Animation('', 'rotation.y', 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE); anim.setKeys([ { frame: 0, value: 0 }, @@ -1049,6 +1048,10 @@ export class RoomEngine { } } + public resize() { + this.engine.resize(); + } + public destroy() { for (const id of this.intervalIds) { window.clearInterval(id);