From 9bc0d7b361156acb12fd98da7a5f0eb12010de8f Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:20:34 +0900 Subject: [PATCH] wip --- packages/frontend/src/utility/room/engine.ts | 11 ++++++++--- .../frontend/src/utility/room/objects/cupNoodle.ts | 7 ++++++- packages/frontend/src/utility/room/objects/mug.ts | 7 ++++++- packages/frontend/src/utility/room/utility.ts | 6 ++++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index c5042969f5..e831420c2c 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -1402,9 +1402,14 @@ export class RoomObjectPreviewEngine { gridMaterial.opacity = 0.5; gridMaterial.gridRatio = 10/*cm*/; - this.zGridPreviewPlane = BABYLON.MeshBuilder.CreatePlane('zGridPreviewPlane', { width: 1000/*cm*/, height: 1000/*cm*/ }, this.scene); - this.zGridPreviewPlane.material = gridMaterial; - this.zGridPreviewPlane.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0); + //this.zGridPreviewPlane = BABYLON.MeshBuilder.CreatePlane('zGridPreviewPlane', { width: 1000/*cm*/, height: 1000/*cm*/ }, this.scene); + //this.zGridPreviewPlane.material = gridMaterial; + //this.zGridPreviewPlane.rotation = new BABYLON.Vector3(Math.PI / 2, 0, 0); + + //this.scene.fogMode = BABYLON.Scene.FOGMODE_LINEAR; + //this.scene.fogStart = 100/*cm*/; + //this.scene.fogEnd = 110/*cm*/; + //this.scene.fogColor = new BABYLON.Color3(0.0, 0.0, 0.0); } public async init() { diff --git a/packages/frontend/src/utility/room/objects/cupNoodle.ts b/packages/frontend/src/utility/room/objects/cupNoodle.ts index b6376e168e..58a11a6e03 100644 --- a/packages/frontend/src/utility/room/objects/cupNoodle.ts +++ b/packages/frontend/src/utility/room/objects/cupNoodle.ts @@ -16,11 +16,16 @@ export const cupNoodle = defineObject({ }, placement: 'top', createInstance: ({ scene, root }) => { + let yugeDispose: (() => void) | null = null; + return { onInited: () => { - yuge(scene, root, new BABYLON.Vector3(0, 10/*cm*/, 0)); + yugeDispose = yuge(scene, root, new BABYLON.Vector3(0, 10/*cm*/, 0)); }, interactions: {}, + dispose: () => { + yugeDispose?.(); + }, }; }, }); diff --git a/packages/frontend/src/utility/room/objects/mug.ts b/packages/frontend/src/utility/room/objects/mug.ts index f45e4dad1a..a015c8f9f6 100644 --- a/packages/frontend/src/utility/room/objects/mug.ts +++ b/packages/frontend/src/utility/room/objects/mug.ts @@ -16,11 +16,16 @@ export const mug = defineObject({ }, placement: 'top', createInstance: ({ scene, root }) => { + let yugeDispose: (() => void) | null = null; + return { onInited: () => { - yuge(scene, root, new BABYLON.Vector3(0, 5/*cm*/, 0)); + yugeDispose = yuge(scene, root, new BABYLON.Vector3(0, 5/*cm*/, 0)); }, interactions: {}, + dispose: () => { + yugeDispose?.(); + }, }; }, }); diff --git a/packages/frontend/src/utility/room/utility.ts b/packages/frontend/src/utility/room/utility.ts index 727920da90..c743b60def 100644 --- a/packages/frontend/src/utility/room/utility.ts +++ b/packages/frontend/src/utility/room/utility.ts @@ -30,6 +30,12 @@ export function yuge(scene: BABYLON.Scene, mesh: BABYLON.Mesh, offset: BABYLON.V ps.colorDead = new BABYLON.Color4(1, 1, 1, 0); ps.preWarmCycles = Math.random() * 1000; ps.start(); + + // dispose + return () => { + ps.stop(); + emitter.dispose(); + }; } const _assumedFramesPerSecond = 60;