diff --git a/packages/frontend/assets/room/objects/aquarium/aquarium.blend b/packages/frontend/assets/room/objects/aquarium/aquarium.blend new file mode 100644 index 0000000000..1daa50f394 Binary files /dev/null and b/packages/frontend/assets/room/objects/aquarium/aquarium.blend differ diff --git a/packages/frontend/assets/room/objects/aquarium/aquarium.glb b/packages/frontend/assets/room/objects/aquarium/aquarium.glb new file mode 100644 index 0000000000..5f07323d4c Binary files /dev/null and b/packages/frontend/assets/room/objects/aquarium/aquarium.glb differ diff --git a/packages/frontend/src/pages/room.vue b/packages/frontend/src/pages/room.vue index 9488702aa7..502469cdae 100644 --- a/packages/frontend/src/pages/room.vue +++ b/packages/frontend/src/pages/room.vue @@ -104,6 +104,12 @@ onMounted(() => { type: 'steel-rack', position: [130, 0, 115], rotation: [0, 0, 0], + }, { + id: 'j2', + type: 'aquarium', + position: [130, 100, 115], + rotation: [0, Math.PI, 0], + sticky: 'j', }, { id: 'k', type: 'cup-noodle', diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index f538e22bce..d4d4195281 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -212,6 +212,43 @@ const OBJECTS = { 'bed': { placement: 'top', }, + 'aquarium': { + placement: 'top', + onInit: (room, o, obj) => { + const noiseTexture = new BABYLON.NoiseProceduralTexture('perlin', 256, room.scene); + noiseTexture.animationSpeedFactor = 70; + noiseTexture.persistence = 10; + noiseTexture.brightness = 0.5; + noiseTexture.octaves = 5; + + const emitter = new BABYLON.TransformNode('emitter', room.scene); + emitter.parent = obj.meshes[0]; + emitter.position = new BABYLON.Vector3(-9/*cm*/, 7/*cm*/, -17/*cm*/); + const ps = new BABYLON.ParticleSystem('', 128, room.scene); + ps.particleTexture = new BABYLON.Texture('/client-assets/room/objects/lava-lamp/bubble.png'); + ps.emitter = emitter; + ps.isLocal = true; + ps.minEmitBox = new BABYLON.Vector3(-2/*cm*/, 0, -2/*cm*/); + ps.maxEmitBox = new BABYLON.Vector3(2/*cm*/, 0, 2/*cm*/); + ps.minEmitPower = 40; + ps.maxEmitPower = 60; + ps.minLifeTime = 0.5; + ps.maxLifeTime = 0.5; + ps.minSize = 0.1/*cm*/; + ps.maxSize = 1/*cm*/; + ps.direction1 = new BABYLON.Vector3(0, 1, 0); + ps.direction2 = new BABYLON.Vector3(0, 1, 0); + ps.noiseTexture = noiseTexture; + ps.noiseStrength = new BABYLON.Vector3(500, 0, 500); + ps.emitRate = 32; + ps.blendMode = BABYLON.ParticleSystem.BLENDMODE_ADD; + //ps.color1 = new BABYLON.Color4(1, 1, 1, 0.3); + //ps.color2 = new BABYLON.Color4(1, 1, 1, 0.2); + //ps.colorDead = new BABYLON.Color4(1, 1, 1, 0); + ps.preWarmCycles = Math.random() * 1000; + ps.start(); + }, + }, } as Record; function vecToLocal(vector: BABYLON.Vector3, mesh: BABYLON.Mesh): BABYLON.Vector3 { @@ -354,7 +391,7 @@ export class RoomEngine { descendantStickyObjectIds: string[]; } | null = null; private highlightedObjectId: string | null = null; - private time: 0 | 1 | 2 = 0; // 0: 昼, 1: 夕, 2: 夜 + private time: 0 | 1 | 2 = 2; // 0: 昼, 1: 夕, 2: 夜 private roomCollisionMeshes: BABYLON.AbstractMesh[] = []; private def: RoomDef; public enableGridSnapping = false;