diff --git a/gulpfile.ts b/gulpfile.ts index 2bd61cad2d13102f70d5d63392e0494f234c9034..262c0a5030af41f9df9596b79151c05dd7060310 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -38,7 +38,11 @@ gulp.task('build:copy:locales', cb => { cb(); }); -gulp.task('build:copy', gulp.parallel('build:copy:views', 'build:copy:locales', () => +gulp.task('build:copy:fonts', () => + gulp.src('./node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/client/assets/fonts/')) +); + +gulp.task('build:copy', gulp.parallel('build:copy:views', 'build:copy:locales', 'build:copy:fonts', () => gulp.src([ './src/emojilist.json', './src/server/web/views/**/*', diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5bc978492598fe0fccc0d509da101b28992db2de..ffe0a358a9bca8e7664185d22cf66f768698a2a4 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -501,6 +501,7 @@ userSilenced: "ã“ã®ãƒ¦ãƒ¼ã‚¶ãƒ¼ã¯ã‚µã‚¤ãƒ¬ãƒ³ã‚¹ã•ã‚Œã¦ã„ã¾ã™ã€‚" sidebar: "サイドãƒãƒ¼" divider: "分割線" addItem: "é …ç›®ã‚’è¿½åŠ " +rooms: "ルーム" _theme: explore: "テーマを探ã™" @@ -736,6 +737,67 @@ _timelines: social: "ソーシャル" global: "ã‚°ãƒãƒ¼ãƒãƒ«" +_rooms: + roomOf: "{user}ã®ãƒ«ãƒ¼ãƒ " + addFurniture: "家具を置ã" + translate: "移動" + rotate: "回転" + exit: "戻る" + remove: "ã—ã¾ã†" + clear: "片付ã‘" + clearConfirm: "å…¨ã¦ã®å®¶å…·ã‚’ã—ã¾ã„ã¾ã™ã‹ï¼Ÿ" + leaveConfirm: "未ä¿å˜ã®å¤‰æ›´ãŒã‚ã‚Šã¾ã™ã€ç§»å‹•ã—ã¾ã™ã‹ï¼Ÿ" + chooseImage: "ç”»åƒã‚’é¸æŠž" + roomType: "部屋ã®ã‚¿ã‚¤ãƒ—" + carpetColor: "床ã®è‰²" + _roomType: + default: "デフォルト" + washitsu: "和室" + _furnitures: + milk: "牛乳パック" + bed: "ベッド" + low-table: "ãƒãƒ¼ãƒ†ãƒ¼ãƒ–ル" + desk: "デスク" + chair: "ãƒã‚§ã‚¢" + chair2: "ãƒã‚§ã‚¢2" + fan: "æ›æ°—扇" + pc: "パソコン" + plant: "観葉æ¤ç‰©" + plant2: "観葉æ¤ç‰©2" + eraser: "消ã—ゴム" + pencil: "鉛ç†" + pudding: "プリン" + cardboard-box: "段ボール箱" + cardboard-box2: "段ボール箱2" + cardboard-box3: "段ボール箱3" + book: "本" + book2: "本2" + piano: "ピアノ" + facial-tissue: "ティッシュボックス" + server: "サーãƒãƒ¼" + moon: "月" + corkboard: "コルクボード" + mousepad: "マウスパッド" + monitor: "モニター" + keyboard: "ã‚ーボード" + carpet-stripe: "カーペット(縞)" + mat: "マット" + color-box: "カラーボックス" + wall-clock: "å£æŽ›ã‘時計" + photoframe: "é¡ç¸" + cube: "ã‚ューブ" + tv: "テレビ" + pinguin: "ピンギン" + rubik-cube: "ルービックã‚ューブ" + poster-h: "ãƒã‚¹ã‚¿ãƒ¼(横長)" + poster-v: "ãƒã‚¹ã‚¿ãƒ¼(縦長)" + sofa: "ソファ" + spiral: "螺旋階段" + bin: "ゴミ箱" + cup-noodle: "カップ麺" + holo-display: "ホãƒã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯ãƒ‡ã‚£ã‚¹ãƒ—レイ" + energy-drink: "エナジードリンク" + _pages: newPage: "ページã®ä½œæˆ" editPage: "ページã®ç·¨é›†" diff --git a/src/client/assets/room/furnitures/bed/bed.blend b/src/client/assets/room/furnitures/bed/bed.blend new file mode 100644 index 0000000000000000000000000000000000000000..731df76d0cd735d34f95bfaf05331ca2a6aa6909 Binary files /dev/null and b/src/client/assets/room/furnitures/bed/bed.blend differ diff --git a/src/client/assets/room/furnitures/bed/bed.glb b/src/client/assets/room/furnitures/bed/bed.glb new file mode 100644 index 0000000000000000000000000000000000000000..f35ecb9ef4125801c5f2ff036bc7463abfdabe70 Binary files /dev/null and b/src/client/assets/room/furnitures/bed/bed.glb differ diff --git a/src/client/assets/room/furnitures/bin/bin.blend b/src/client/assets/room/furnitures/bin/bin.blend new file mode 100644 index 0000000000000000000000000000000000000000..8d459a0869ec309ac72a57a0f50f7e2f78b26965 Binary files /dev/null and b/src/client/assets/room/furnitures/bin/bin.blend differ diff --git a/src/client/assets/room/furnitures/bin/bin.glb b/src/client/assets/room/furnitures/bin/bin.glb new file mode 100644 index 0000000000000000000000000000000000000000..b45f203802511026d6c4760155b281d5307105c6 Binary files /dev/null and b/src/client/assets/room/furnitures/bin/bin.glb differ diff --git a/src/client/assets/room/furnitures/book/book.blend b/src/client/assets/room/furnitures/book/book.blend new file mode 100644 index 0000000000000000000000000000000000000000..0d4899d4aec991e1f53e6f77d8c89d58159bf948 Binary files /dev/null and b/src/client/assets/room/furnitures/book/book.blend differ diff --git a/src/client/assets/room/furnitures/book/book.glb b/src/client/assets/room/furnitures/book/book.glb new file mode 100644 index 0000000000000000000000000000000000000000..546893da06b256e8a5e9710525961a01dc9439bb Binary files /dev/null and b/src/client/assets/room/furnitures/book/book.glb differ diff --git a/src/client/assets/room/furnitures/book2/barcode.png b/src/client/assets/room/furnitures/book2/barcode.png new file mode 100644 index 0000000000000000000000000000000000000000..37cfe5add363f5324cf8ed15c4f06c35d2f030c4 Binary files /dev/null and b/src/client/assets/room/furnitures/book2/barcode.png differ diff --git a/src/client/assets/room/furnitures/book2/book2.blend b/src/client/assets/room/furnitures/book2/book2.blend new file mode 100644 index 0000000000000000000000000000000000000000..e0fdb4810197caad280ed2d1e715d9e254827a04 Binary files /dev/null and b/src/client/assets/room/furnitures/book2/book2.blend differ diff --git a/src/client/assets/room/furnitures/book2/book2.glb b/src/client/assets/room/furnitures/book2/book2.glb new file mode 100644 index 0000000000000000000000000000000000000000..2b26402f8ca80bf96517241bf1d0ba1c359605e2 Binary files /dev/null and b/src/client/assets/room/furnitures/book2/book2.glb differ diff --git a/src/client/assets/room/furnitures/book2/texture.afdesign b/src/client/assets/room/furnitures/book2/texture.afdesign new file mode 100644 index 0000000000000000000000000000000000000000..b63771607a035da290e5e27f7d9b5824857440c2 Binary files /dev/null and b/src/client/assets/room/furnitures/book2/texture.afdesign differ diff --git a/src/client/assets/room/furnitures/book2/texture.png b/src/client/assets/room/furnitures/book2/texture.png new file mode 100644 index 0000000000000000000000000000000000000000..5aa84f0340b1e91f341761f605b50dda53dccaeb Binary files /dev/null and b/src/client/assets/room/furnitures/book2/texture.png differ diff --git a/src/client/assets/room/furnitures/book2/uv.png b/src/client/assets/room/furnitures/book2/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..61c4fb040024b5647c98e667314af008fe127141 Binary files /dev/null and b/src/client/assets/room/furnitures/book2/uv.png differ diff --git a/src/client/assets/room/furnitures/cardboard-box/cardboard-box.blend b/src/client/assets/room/furnitures/cardboard-box/cardboard-box.blend new file mode 100644 index 0000000000000000000000000000000000000000..3a528de32a376053a00fc5c9564ed9ebca1a011f Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box/cardboard-box.blend differ diff --git a/src/client/assets/room/furnitures/cardboard-box/cardboard-box.glb b/src/client/assets/room/furnitures/cardboard-box/cardboard-box.glb new file mode 100644 index 0000000000000000000000000000000000000000..bed372e94f8b7bd18a272e8a38f5835cbc3a20ca Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box/cardboard-box.glb differ diff --git a/src/client/assets/room/furnitures/cardboard-box2/cardboard-box2.blend b/src/client/assets/room/furnitures/cardboard-box2/cardboard-box2.blend new file mode 100644 index 0000000000000000000000000000000000000000..5f146267acf22370b4b7a6d60ace5217b3db91f7 Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box2/cardboard-box2.blend differ diff --git a/src/client/assets/room/furnitures/cardboard-box2/cardboard-box2.glb b/src/client/assets/room/furnitures/cardboard-box2/cardboard-box2.glb new file mode 100644 index 0000000000000000000000000000000000000000..85fcb5c0b60ebf15658dc49b687c7bda51843a5d Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box2/cardboard-box2.glb differ diff --git a/src/client/assets/room/furnitures/cardboard-box2/texture.png b/src/client/assets/room/furnitures/cardboard-box2/texture.png new file mode 100644 index 0000000000000000000000000000000000000000..e498d8f65b0d3816157eac2d91f22bace1cbf1e2 Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box2/texture.png differ diff --git a/src/client/assets/room/furnitures/cardboard-box2/uv.png b/src/client/assets/room/furnitures/cardboard-box2/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..d547843ee015eff0edaf60ff86c5eebf2c7b5646 Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box2/uv.png differ diff --git a/src/client/assets/room/furnitures/cardboard-box3/cardboard-box3.blend b/src/client/assets/room/furnitures/cardboard-box3/cardboard-box3.blend new file mode 100644 index 0000000000000000000000000000000000000000..00681a3cfd5060e42378fd2e2fe6646074a6f862 Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box3/cardboard-box3.blend differ diff --git a/src/client/assets/room/furnitures/cardboard-box3/cardboard-box3.glb b/src/client/assets/room/furnitures/cardboard-box3/cardboard-box3.glb new file mode 100644 index 0000000000000000000000000000000000000000..1ef04276894f0c0f7b29533074d5716fb18d66a9 Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box3/cardboard-box3.glb differ diff --git a/src/client/assets/room/furnitures/cardboard-box3/texture.png b/src/client/assets/room/furnitures/cardboard-box3/texture.png new file mode 100644 index 0000000000000000000000000000000000000000..56c914cb9d8094a4ceacad5ff711f63f3df1b582 Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box3/texture.png differ diff --git a/src/client/assets/room/furnitures/cardboard-box3/texture.xcf b/src/client/assets/room/furnitures/cardboard-box3/texture.xcf new file mode 100644 index 0000000000000000000000000000000000000000..7ffb3e3439d30c22841d77510c8d85815ced9475 Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box3/texture.xcf differ diff --git a/src/client/assets/room/furnitures/cardboard-box3/uv.png b/src/client/assets/room/furnitures/cardboard-box3/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..797ac509dbacefd19ff3a9dbbcde418a9e42a2ca Binary files /dev/null and b/src/client/assets/room/furnitures/cardboard-box3/uv.png differ diff --git a/src/client/assets/room/furnitures/carpet-stripe/carpet-stripe.blend b/src/client/assets/room/furnitures/carpet-stripe/carpet-stripe.blend new file mode 100644 index 0000000000000000000000000000000000000000..750343d4f00fc9af30c5158cfc0c517d73e2e02a Binary files /dev/null and b/src/client/assets/room/furnitures/carpet-stripe/carpet-stripe.blend differ diff --git a/src/client/assets/room/furnitures/carpet-stripe/carpet-stripe.glb b/src/client/assets/room/furnitures/carpet-stripe/carpet-stripe.glb new file mode 100644 index 0000000000000000000000000000000000000000..3066a69e353c4ab6668f6c010a804ac258e6f26a Binary files /dev/null and b/src/client/assets/room/furnitures/carpet-stripe/carpet-stripe.glb differ diff --git a/src/client/assets/room/furnitures/chair/chair.blend b/src/client/assets/room/furnitures/chair/chair.blend new file mode 100644 index 0000000000000000000000000000000000000000..79c29a840145a21373a2bb7a635b57745a57007f Binary files /dev/null and b/src/client/assets/room/furnitures/chair/chair.blend differ diff --git a/src/client/assets/room/furnitures/chair/chair.glb b/src/client/assets/room/furnitures/chair/chair.glb new file mode 100644 index 0000000000000000000000000000000000000000..08ee1a0bb0fc569dad8b900fb8c0d5ab2cef4716 Binary files /dev/null and b/src/client/assets/room/furnitures/chair/chair.glb differ diff --git a/src/client/assets/room/furnitures/chair2/chair2.blend b/src/client/assets/room/furnitures/chair2/chair2.blend new file mode 100644 index 0000000000000000000000000000000000000000..c6a1acd96f5f5347536e31d99ee36d25e8e775d6 Binary files /dev/null and b/src/client/assets/room/furnitures/chair2/chair2.blend differ diff --git a/src/client/assets/room/furnitures/chair2/chair2.glb b/src/client/assets/room/furnitures/chair2/chair2.glb new file mode 100644 index 0000000000000000000000000000000000000000..5ea2f3518b692efe6e5237aae464ba594c3f755c Binary files /dev/null and b/src/client/assets/room/furnitures/chair2/chair2.glb differ diff --git a/src/client/assets/room/furnitures/color-box/color-box.blend b/src/client/assets/room/furnitures/color-box/color-box.blend new file mode 100644 index 0000000000000000000000000000000000000000..f96a4ff76633b20fb292504702c0816e06859ce7 Binary files /dev/null and b/src/client/assets/room/furnitures/color-box/color-box.blend differ diff --git a/src/client/assets/room/furnitures/color-box/color-box.glb b/src/client/assets/room/furnitures/color-box/color-box.glb new file mode 100644 index 0000000000000000000000000000000000000000..43f2abcae8ff2471236a5936844179edb4f154ec Binary files /dev/null and b/src/client/assets/room/furnitures/color-box/color-box.glb differ diff --git a/src/client/assets/room/furnitures/corkboard/corkboard.blend b/src/client/assets/room/furnitures/corkboard/corkboard.blend new file mode 100644 index 0000000000000000000000000000000000000000..9a7e1878cda339fc9f22151d9904bdddde7f892f Binary files /dev/null and b/src/client/assets/room/furnitures/corkboard/corkboard.blend differ diff --git a/src/client/assets/room/furnitures/corkboard/corkboard.glb b/src/client/assets/room/furnitures/corkboard/corkboard.glb new file mode 100644 index 0000000000000000000000000000000000000000..fee108fb91519ca8ec3f7dc9637db5dde02c6a6d Binary files /dev/null and b/src/client/assets/room/furnitures/corkboard/corkboard.glb differ diff --git a/src/client/assets/room/furnitures/cube/cube.blend b/src/client/assets/room/furnitures/cube/cube.blend new file mode 100644 index 0000000000000000000000000000000000000000..1af5bf40a9d3c63d4a8345bc34b36f4e36f8fdfe Binary files /dev/null and b/src/client/assets/room/furnitures/cube/cube.blend differ diff --git a/src/client/assets/room/furnitures/cube/cube.glb b/src/client/assets/room/furnitures/cube/cube.glb new file mode 100644 index 0000000000000000000000000000000000000000..4ac8b6036d22ea22981582ee87e529277acab4c5 Binary files /dev/null and b/src/client/assets/room/furnitures/cube/cube.glb differ diff --git a/src/client/assets/room/furnitures/cup-noodle/cup-noodle.blend b/src/client/assets/room/furnitures/cup-noodle/cup-noodle.blend new file mode 100644 index 0000000000000000000000000000000000000000..37ca8868c7c7e9022d00ca7dbe5fb78f2b6bfd93 Binary files /dev/null and b/src/client/assets/room/furnitures/cup-noodle/cup-noodle.blend differ diff --git a/src/client/assets/room/furnitures/cup-noodle/cup-noodle.glb b/src/client/assets/room/furnitures/cup-noodle/cup-noodle.glb new file mode 100644 index 0000000000000000000000000000000000000000..58efb1b3b42ee3188dc70e41307e2a88490a372c Binary files /dev/null and b/src/client/assets/room/furnitures/cup-noodle/cup-noodle.glb differ diff --git a/src/client/assets/room/furnitures/cup-noodle/noodle.png b/src/client/assets/room/furnitures/cup-noodle/noodle.png new file mode 100644 index 0000000000000000000000000000000000000000..1d74e0bbe77d09732066802aff67ce4cf5d4963b Binary files /dev/null and b/src/client/assets/room/furnitures/cup-noodle/noodle.png differ diff --git a/src/client/assets/room/furnitures/desk/desk.blend b/src/client/assets/room/furnitures/desk/desk.blend new file mode 100644 index 0000000000000000000000000000000000000000..c88d01f0b233ec40c4475b2555d21386d9037691 Binary files /dev/null and b/src/client/assets/room/furnitures/desk/desk.blend differ diff --git a/src/client/assets/room/furnitures/desk/desk.glb b/src/client/assets/room/furnitures/desk/desk.glb new file mode 100644 index 0000000000000000000000000000000000000000..4a58513095884e46661b178bc50b41140eeb3a47 Binary files /dev/null and b/src/client/assets/room/furnitures/desk/desk.glb differ diff --git a/src/client/assets/room/furnitures/energy-drink/energy-drink.blend b/src/client/assets/room/furnitures/energy-drink/energy-drink.blend new file mode 100644 index 0000000000000000000000000000000000000000..65fc41273e60c3ce5ecb60838b596fb73c6f50fa Binary files /dev/null and b/src/client/assets/room/furnitures/energy-drink/energy-drink.blend differ diff --git a/src/client/assets/room/furnitures/energy-drink/energy-drink.glb b/src/client/assets/room/furnitures/energy-drink/energy-drink.glb new file mode 100644 index 0000000000000000000000000000000000000000..7fb1c278368ad14c7f18139524b172090e8aca07 Binary files /dev/null and b/src/client/assets/room/furnitures/energy-drink/energy-drink.glb differ diff --git a/src/client/assets/room/furnitures/energy-drink/texture.afdesign b/src/client/assets/room/furnitures/energy-drink/texture.afdesign new file mode 100644 index 0000000000000000000000000000000000000000..8c117a49b18882c3ff5b87fd6a2299a097d3d441 Binary files /dev/null and b/src/client/assets/room/furnitures/energy-drink/texture.afdesign differ diff --git a/src/client/assets/room/furnitures/energy-drink/texture.png b/src/client/assets/room/furnitures/energy-drink/texture.png new file mode 100644 index 0000000000000000000000000000000000000000..484ca0f96ffd29bbfda5a16039a924dfd0e22901 Binary files /dev/null and b/src/client/assets/room/furnitures/energy-drink/texture.png differ diff --git a/src/client/assets/room/furnitures/energy-drink/uv.png b/src/client/assets/room/furnitures/energy-drink/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..2a3f20c999a041dd392611fe5fb921adac8be4c5 Binary files /dev/null and b/src/client/assets/room/furnitures/energy-drink/uv.png differ diff --git a/src/client/assets/room/furnitures/eraser/cover.png b/src/client/assets/room/furnitures/eraser/cover.png new file mode 100644 index 0000000000000000000000000000000000000000..932a3fc62eb19dbafe95f91369249a7b232501da Binary files /dev/null and b/src/client/assets/room/furnitures/eraser/cover.png differ diff --git a/src/client/assets/room/furnitures/eraser/cover.psd b/src/client/assets/room/furnitures/eraser/cover.psd new file mode 100644 index 0000000000000000000000000000000000000000..c393337833d4d76f28a4f2de33ace2ce863f3b1c Binary files /dev/null and b/src/client/assets/room/furnitures/eraser/cover.psd differ diff --git a/src/client/assets/room/furnitures/eraser/eraser-uv.png b/src/client/assets/room/furnitures/eraser/eraser-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..89e4ea4c4508c20514f84977b3320f53c171e71f Binary files /dev/null and b/src/client/assets/room/furnitures/eraser/eraser-uv.png differ diff --git a/src/client/assets/room/furnitures/eraser/eraser.blend b/src/client/assets/room/furnitures/eraser/eraser.blend new file mode 100644 index 0000000000000000000000000000000000000000..103c54fbae3f04db34ad3ad7cd36102890a393fb Binary files /dev/null and b/src/client/assets/room/furnitures/eraser/eraser.blend differ diff --git a/src/client/assets/room/furnitures/eraser/eraser.glb b/src/client/assets/room/furnitures/eraser/eraser.glb new file mode 100644 index 0000000000000000000000000000000000000000..016b60df202459182cb66c6f12b13222f8a88ae8 Binary files /dev/null and b/src/client/assets/room/furnitures/eraser/eraser.glb differ diff --git a/src/client/assets/room/furnitures/facial-tissue/facial-tissue-uv.png b/src/client/assets/room/furnitures/facial-tissue/facial-tissue-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..e3865ad15e6798f43ec910b34aee19ccbe3f8d6e Binary files /dev/null and b/src/client/assets/room/furnitures/facial-tissue/facial-tissue-uv.png differ diff --git a/src/client/assets/room/furnitures/facial-tissue/facial-tissue.blend b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.blend new file mode 100644 index 0000000000000000000000000000000000000000..d59f87c1ee5482a6f375585fba575a60a4d454a8 Binary files /dev/null and b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.blend differ diff --git a/src/client/assets/room/furnitures/facial-tissue/facial-tissue.glb b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.glb new file mode 100644 index 0000000000000000000000000000000000000000..48b36ef34729727ff186714aaf6f08f473115eaa Binary files /dev/null and b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.glb differ diff --git a/src/client/assets/room/furnitures/facial-tissue/facial-tissue.png b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.png new file mode 100644 index 0000000000000000000000000000000000000000..7cee4b1859e5ed39b7abb861a05ca05d0dc16c7e Binary files /dev/null and b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.png differ diff --git a/src/client/assets/room/furnitures/facial-tissue/facial-tissue.psd b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.psd new file mode 100644 index 0000000000000000000000000000000000000000..cd59fc007bb0d4c2472a99ec2326b8f8284cae87 Binary files /dev/null and b/src/client/assets/room/furnitures/facial-tissue/facial-tissue.psd differ diff --git a/src/client/assets/room/furnitures/fan/fan.blend b/src/client/assets/room/furnitures/fan/fan.blend new file mode 100644 index 0000000000000000000000000000000000000000..8c8106e5fe61f92fce0e3e3f359bba90474a5576 Binary files /dev/null and b/src/client/assets/room/furnitures/fan/fan.blend differ diff --git a/src/client/assets/room/furnitures/fan/fan.glb b/src/client/assets/room/furnitures/fan/fan.glb new file mode 100644 index 0000000000000000000000000000000000000000..d9367f353407b2a9f66841ef2ac373e322ca64b5 Binary files /dev/null and b/src/client/assets/room/furnitures/fan/fan.glb differ diff --git a/src/client/assets/room/furnitures/holo-display/holo-display.blend b/src/client/assets/room/furnitures/holo-display/holo-display.blend new file mode 100644 index 0000000000000000000000000000000000000000..56d2e1f8191d1970cb262127f917642ef3a3dc57 Binary files /dev/null and b/src/client/assets/room/furnitures/holo-display/holo-display.blend differ diff --git a/src/client/assets/room/furnitures/holo-display/holo-display.glb b/src/client/assets/room/furnitures/holo-display/holo-display.glb new file mode 100644 index 0000000000000000000000000000000000000000..4d042a59b31f7fc04d6b6359af72f297903acfc0 Binary files /dev/null and b/src/client/assets/room/furnitures/holo-display/holo-display.glb differ diff --git a/src/client/assets/room/furnitures/holo-display/ray-uv.png b/src/client/assets/room/furnitures/holo-display/ray-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..aa7e817e0f7840f2bbda96c031182ade732026f2 Binary files /dev/null and b/src/client/assets/room/furnitures/holo-display/ray-uv.png differ diff --git a/src/client/assets/room/furnitures/holo-display/ray.png b/src/client/assets/room/furnitures/holo-display/ray.png new file mode 100644 index 0000000000000000000000000000000000000000..6a5d24e143bfc5ecde69ba0db283b20a5cdfe29c Binary files /dev/null and b/src/client/assets/room/furnitures/holo-display/ray.png differ diff --git a/src/client/assets/room/furnitures/keyboard/keyboard.blend b/src/client/assets/room/furnitures/keyboard/keyboard.blend new file mode 100644 index 0000000000000000000000000000000000000000..ab33d134b3d99491c34b8557628c944948d01ce9 Binary files /dev/null and b/src/client/assets/room/furnitures/keyboard/keyboard.blend differ diff --git a/src/client/assets/room/furnitures/keyboard/keyboard.glb b/src/client/assets/room/furnitures/keyboard/keyboard.glb new file mode 100644 index 0000000000000000000000000000000000000000..15dc69f47a4d5390dd2f5e83045cf1577ae98a75 Binary files /dev/null and b/src/client/assets/room/furnitures/keyboard/keyboard.glb differ diff --git a/src/client/assets/room/furnitures/low-table/low-table.blend b/src/client/assets/room/furnitures/low-table/low-table.blend new file mode 100644 index 0000000000000000000000000000000000000000..e1592174d9963b9996cdf1969ecc96885c31d2a5 Binary files /dev/null and b/src/client/assets/room/furnitures/low-table/low-table.blend differ diff --git a/src/client/assets/room/furnitures/low-table/low-table.glb b/src/client/assets/room/furnitures/low-table/low-table.glb new file mode 100644 index 0000000000000000000000000000000000000000..c69bf35d7b52eda2434c4a3db91a3c5f695e4adf Binary files /dev/null and b/src/client/assets/room/furnitures/low-table/low-table.glb differ diff --git a/src/client/assets/room/furnitures/mat/mat.blend b/src/client/assets/room/furnitures/mat/mat.blend new file mode 100644 index 0000000000000000000000000000000000000000..a1e1a68c554e93b9b63f54801310d6f34a83d161 Binary files /dev/null and b/src/client/assets/room/furnitures/mat/mat.blend differ diff --git a/src/client/assets/room/furnitures/mat/mat.glb b/src/client/assets/room/furnitures/mat/mat.glb new file mode 100644 index 0000000000000000000000000000000000000000..87ccd44e1a2fcb07c7ea55c7561bff356c5f6d70 Binary files /dev/null and b/src/client/assets/room/furnitures/mat/mat.glb differ diff --git a/src/client/assets/room/furnitures/milk/milk-uv.png b/src/client/assets/room/furnitures/milk/milk-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..258fd546380d4ba7f7f5d3611e792b0192101342 Binary files /dev/null and b/src/client/assets/room/furnitures/milk/milk-uv.png differ diff --git a/src/client/assets/room/furnitures/milk/milk.blend b/src/client/assets/room/furnitures/milk/milk.blend new file mode 100644 index 0000000000000000000000000000000000000000..2df508d5b905dbc1ee0df0f5b755c5949dc66681 Binary files /dev/null and b/src/client/assets/room/furnitures/milk/milk.blend differ diff --git a/src/client/assets/room/furnitures/milk/milk.glb b/src/client/assets/room/furnitures/milk/milk.glb new file mode 100644 index 0000000000000000000000000000000000000000..b335fe3d021b227bcec7f82d13133442f1fe84cf Binary files /dev/null and b/src/client/assets/room/furnitures/milk/milk.glb differ diff --git a/src/client/assets/room/furnitures/milk/milk.png b/src/client/assets/room/furnitures/milk/milk.png new file mode 100644 index 0000000000000000000000000000000000000000..35181c8c8c2b3ccd614bdc4570475f3c32f2d28f Binary files /dev/null and b/src/client/assets/room/furnitures/milk/milk.png differ diff --git a/src/client/assets/room/furnitures/milk/milk.psd b/src/client/assets/room/furnitures/milk/milk.psd new file mode 100644 index 0000000000000000000000000000000000000000..f31e439277821d8ad26e4a6f68c00d80cac2f8ba Binary files /dev/null and b/src/client/assets/room/furnitures/milk/milk.psd differ diff --git a/src/client/assets/room/furnitures/monitor/monitor.blend b/src/client/assets/room/furnitures/monitor/monitor.blend new file mode 100644 index 0000000000000000000000000000000000000000..6c042ccdd87628352089ef4a698546bc55b96b86 Binary files /dev/null and b/src/client/assets/room/furnitures/monitor/monitor.blend differ diff --git a/src/client/assets/room/furnitures/monitor/monitor.glb b/src/client/assets/room/furnitures/monitor/monitor.glb new file mode 100644 index 0000000000000000000000000000000000000000..fc33286a15226afe45cdd17bfcf90dcb668c7b65 Binary files /dev/null and b/src/client/assets/room/furnitures/monitor/monitor.glb differ diff --git a/src/client/assets/room/furnitures/monitor/monitor.psd b/src/client/assets/room/furnitures/monitor/monitor.psd new file mode 100644 index 0000000000000000000000000000000000000000..57afff9cd9ef9717b57fee8df33bc5bd4814da1e Binary files /dev/null and b/src/client/assets/room/furnitures/monitor/monitor.psd differ diff --git a/src/client/assets/room/furnitures/monitor/screen-uv.png b/src/client/assets/room/furnitures/monitor/screen-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..35f74de8aa6a11d80b7710c20761ab0f81048510 Binary files /dev/null and b/src/client/assets/room/furnitures/monitor/screen-uv.png differ diff --git a/src/client/assets/room/furnitures/monitor/screen.jpg b/src/client/assets/room/furnitures/monitor/screen.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4004a1ede9979af67367bab49c48a5499c24bb77 Binary files /dev/null and b/src/client/assets/room/furnitures/monitor/screen.jpg differ diff --git a/src/client/assets/room/furnitures/moon/moon.blend b/src/client/assets/room/furnitures/moon/moon.blend new file mode 100644 index 0000000000000000000000000000000000000000..4ff3deab8ec8c6cdc7ade407b72a8fe5ba28c782 Binary files /dev/null and b/src/client/assets/room/furnitures/moon/moon.blend differ diff --git a/src/client/assets/room/furnitures/moon/moon.glb b/src/client/assets/room/furnitures/moon/moon.glb new file mode 100644 index 0000000000000000000000000000000000000000..07fa7e4c02a9b1902ca137b08e10266c040bfa48 Binary files /dev/null and b/src/client/assets/room/furnitures/moon/moon.glb differ diff --git a/src/client/assets/room/furnitures/moon/moon.jpg b/src/client/assets/room/furnitures/moon/moon.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8988ac64b9b5d1c993d6007864ce83c3d58a4d97 Binary files /dev/null and b/src/client/assets/room/furnitures/moon/moon.jpg differ diff --git a/src/client/assets/room/furnitures/mousepad/mousepad.blend b/src/client/assets/room/furnitures/mousepad/mousepad.blend new file mode 100644 index 0000000000000000000000000000000000000000..14bd139c94a03e0b26685de5431e6fe9893d87ed Binary files /dev/null and b/src/client/assets/room/furnitures/mousepad/mousepad.blend differ diff --git a/src/client/assets/room/furnitures/mousepad/mousepad.glb b/src/client/assets/room/furnitures/mousepad/mousepad.glb new file mode 100644 index 0000000000000000000000000000000000000000..681ada49cd93e18d9b01f111c1de8a0fd6e7b460 Binary files /dev/null and b/src/client/assets/room/furnitures/mousepad/mousepad.glb differ diff --git a/src/client/assets/room/furnitures/pc/motherboard-uv.png b/src/client/assets/room/furnitures/pc/motherboard-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..355009fe7c75491c71de252a7cb649da77d75581 Binary files /dev/null and b/src/client/assets/room/furnitures/pc/motherboard-uv.png differ diff --git a/src/client/assets/room/furnitures/pc/motherboard-uv.psd b/src/client/assets/room/furnitures/pc/motherboard-uv.psd new file mode 100644 index 0000000000000000000000000000000000000000..971f33f79eadfdda3e206d09a23aa17d04ac16fa Binary files /dev/null and b/src/client/assets/room/furnitures/pc/motherboard-uv.psd differ diff --git a/src/client/assets/room/furnitures/pc/motherboard.jpg b/src/client/assets/room/furnitures/pc/motherboard.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d894e4efcf13695b3d308c5481939a96ec023371 Binary files /dev/null and b/src/client/assets/room/furnitures/pc/motherboard.jpg differ diff --git a/src/client/assets/room/furnitures/pc/pc.blend b/src/client/assets/room/furnitures/pc/pc.blend new file mode 100644 index 0000000000000000000000000000000000000000..13dfec6ccc27bdd13bfdcb5d9eec42fcaf75b7b0 Binary files /dev/null and b/src/client/assets/room/furnitures/pc/pc.blend differ diff --git a/src/client/assets/room/furnitures/pc/pc.glb b/src/client/assets/room/furnitures/pc/pc.glb new file mode 100644 index 0000000000000000000000000000000000000000..44a48b18ae6031bf312552636e50c9014391e667 Binary files /dev/null and b/src/client/assets/room/furnitures/pc/pc.glb differ diff --git a/src/client/assets/room/furnitures/pencil/pencil.blend b/src/client/assets/room/furnitures/pencil/pencil.blend new file mode 100644 index 0000000000000000000000000000000000000000..0fc6bdd77699df7874b90b5694ff6e17c0d71a3c Binary files /dev/null and b/src/client/assets/room/furnitures/pencil/pencil.blend differ diff --git a/src/client/assets/room/furnitures/pencil/pencil.glb b/src/client/assets/room/furnitures/pencil/pencil.glb new file mode 100644 index 0000000000000000000000000000000000000000..a938b5cdcc759f46990adfa9e2656587e7070400 Binary files /dev/null and b/src/client/assets/room/furnitures/pencil/pencil.glb differ diff --git a/src/client/assets/room/furnitures/photoframe/photo-uv.png b/src/client/assets/room/furnitures/photoframe/photo-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..9b94906413c704cf62acd86eda0afef773e932e6 Binary files /dev/null and b/src/client/assets/room/furnitures/photoframe/photo-uv.png differ diff --git a/src/client/assets/room/furnitures/photoframe/photo.jpg b/src/client/assets/room/furnitures/photoframe/photo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..af14f0f36a03e15c1e1f12cfb0d69e319378f625 Binary files /dev/null and b/src/client/assets/room/furnitures/photoframe/photo.jpg differ diff --git a/src/client/assets/room/furnitures/photoframe/photoframe.blend b/src/client/assets/room/furnitures/photoframe/photoframe.blend new file mode 100644 index 0000000000000000000000000000000000000000..4224cde45b42b17acd08e3a98eb4d990d543e27f Binary files /dev/null and b/src/client/assets/room/furnitures/photoframe/photoframe.blend differ diff --git a/src/client/assets/room/furnitures/photoframe/photoframe.glb b/src/client/assets/room/furnitures/photoframe/photoframe.glb new file mode 100644 index 0000000000000000000000000000000000000000..4255a77de6ccaacec292f79c0dec650bb22137c7 Binary files /dev/null and b/src/client/assets/room/furnitures/photoframe/photoframe.glb differ diff --git a/src/client/assets/room/furnitures/piano/piano.blend b/src/client/assets/room/furnitures/piano/piano.blend new file mode 100644 index 0000000000000000000000000000000000000000..7653cdf672f6599d66e43aa71a1cf657c54e7f6f Binary files /dev/null and b/src/client/assets/room/furnitures/piano/piano.blend differ diff --git a/src/client/assets/room/furnitures/piano/piano.glb b/src/client/assets/room/furnitures/piano/piano.glb new file mode 100644 index 0000000000000000000000000000000000000000..7242e78ceb4a382243d37cc5c326a26684033461 Binary files /dev/null and b/src/client/assets/room/furnitures/piano/piano.glb differ diff --git a/src/client/assets/room/furnitures/pinguin/pinguin.blend b/src/client/assets/room/furnitures/pinguin/pinguin.blend new file mode 100644 index 0000000000000000000000000000000000000000..514c713e4cd6cdddcef2d2b775712565a950f931 Binary files /dev/null and b/src/client/assets/room/furnitures/pinguin/pinguin.blend differ diff --git a/src/client/assets/room/furnitures/pinguin/pinguin.glb b/src/client/assets/room/furnitures/pinguin/pinguin.glb new file mode 100644 index 0000000000000000000000000000000000000000..6df34c06e9bb2be58974941b90119e6c13ebb071 Binary files /dev/null and b/src/client/assets/room/furnitures/pinguin/pinguin.glb differ diff --git a/src/client/assets/room/furnitures/plant/plant-soil-uv.png b/src/client/assets/room/furnitures/plant/plant-soil-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..d4971a896cd210372a2532bf73d92a4c3dadf089 Binary files /dev/null and b/src/client/assets/room/furnitures/plant/plant-soil-uv.png differ diff --git a/src/client/assets/room/furnitures/plant/plant-soil.png b/src/client/assets/room/furnitures/plant/plant-soil.png new file mode 100644 index 0000000000000000000000000000000000000000..e79ccd240e5fb4710c29aaceafffb8d3bc150170 Binary files /dev/null and b/src/client/assets/room/furnitures/plant/plant-soil.png differ diff --git a/src/client/assets/room/furnitures/plant/plant-soil.psd b/src/client/assets/room/furnitures/plant/plant-soil.psd new file mode 100644 index 0000000000000000000000000000000000000000..1457b7ea5b3086877beb83ab3bb822648c8a8d4f Binary files /dev/null and b/src/client/assets/room/furnitures/plant/plant-soil.psd differ diff --git a/src/client/assets/room/furnitures/plant/plant.blend b/src/client/assets/room/furnitures/plant/plant.blend new file mode 100644 index 0000000000000000000000000000000000000000..aa38c7b54e4e6656a713b97964a1de0b8ea36b48 Binary files /dev/null and b/src/client/assets/room/furnitures/plant/plant.blend differ diff --git a/src/client/assets/room/furnitures/plant/plant.glb b/src/client/assets/room/furnitures/plant/plant.glb new file mode 100644 index 0000000000000000000000000000000000000000..38422b4a9b2940de45816684ae45c77599382995 Binary files /dev/null and b/src/client/assets/room/furnitures/plant/plant.glb differ diff --git a/src/client/assets/room/furnitures/plant2/plant2.blend b/src/client/assets/room/furnitures/plant2/plant2.blend new file mode 100644 index 0000000000000000000000000000000000000000..6592c5d98d91007550d41cdfd27e3da08f17bb3e Binary files /dev/null and b/src/client/assets/room/furnitures/plant2/plant2.blend differ diff --git a/src/client/assets/room/furnitures/plant2/plant2.glb b/src/client/assets/room/furnitures/plant2/plant2.glb new file mode 100644 index 0000000000000000000000000000000000000000..223e6f58340f9a9ba76c8aac4777ca3ccfb51a0c Binary files /dev/null and b/src/client/assets/room/furnitures/plant2/plant2.glb differ diff --git a/src/client/assets/room/furnitures/plant2/soil.png b/src/client/assets/room/furnitures/plant2/soil.png new file mode 100644 index 0000000000000000000000000000000000000000..e79ccd240e5fb4710c29aaceafffb8d3bc150170 Binary files /dev/null and b/src/client/assets/room/furnitures/plant2/soil.png differ diff --git a/src/client/assets/room/furnitures/poster-h/poster-h.blend b/src/client/assets/room/furnitures/poster-h/poster-h.blend new file mode 100644 index 0000000000000000000000000000000000000000..40f944f3c115f9d3aaf966f6b7f06e436c85d9e4 Binary files /dev/null and b/src/client/assets/room/furnitures/poster-h/poster-h.blend differ diff --git a/src/client/assets/room/furnitures/poster-h/poster-h.glb b/src/client/assets/room/furnitures/poster-h/poster-h.glb new file mode 100644 index 0000000000000000000000000000000000000000..c6032c100979c713e6d6a4a15f30f7dcec160e6d Binary files /dev/null and b/src/client/assets/room/furnitures/poster-h/poster-h.glb differ diff --git a/src/client/assets/room/furnitures/poster-h/uv.png b/src/client/assets/room/furnitures/poster-h/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..f854231e0bcea8d17145035c1859ba980fe5e978 Binary files /dev/null and b/src/client/assets/room/furnitures/poster-h/uv.png differ diff --git a/src/client/assets/room/furnitures/poster-v/poster-v.blend b/src/client/assets/room/furnitures/poster-v/poster-v.blend new file mode 100644 index 0000000000000000000000000000000000000000..07fe971634f2f9df6ab8802f670ebd09c41adf65 Binary files /dev/null and b/src/client/assets/room/furnitures/poster-v/poster-v.blend differ diff --git a/src/client/assets/room/furnitures/poster-v/poster-v.glb b/src/client/assets/room/furnitures/poster-v/poster-v.glb new file mode 100644 index 0000000000000000000000000000000000000000..6e3782f19364233453bfee6d4af8451614af6de5 Binary files /dev/null and b/src/client/assets/room/furnitures/poster-v/poster-v.glb differ diff --git a/src/client/assets/room/furnitures/poster-v/uv.png b/src/client/assets/room/furnitures/poster-v/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..7bb2bf809e000338978284c7e25a56a6cbb4e15b Binary files /dev/null and b/src/client/assets/room/furnitures/poster-v/uv.png differ diff --git a/src/client/assets/room/furnitures/pudding/pudding.blend b/src/client/assets/room/furnitures/pudding/pudding.blend new file mode 100644 index 0000000000000000000000000000000000000000..bba40ce161d37b08e974cbc875ee5193ffbfe862 Binary files /dev/null and b/src/client/assets/room/furnitures/pudding/pudding.blend differ diff --git a/src/client/assets/room/furnitures/pudding/pudding.glb b/src/client/assets/room/furnitures/pudding/pudding.glb new file mode 100644 index 0000000000000000000000000000000000000000..06c9ed80cc1507fc8562d12b7b3cf849897580fa Binary files /dev/null and b/src/client/assets/room/furnitures/pudding/pudding.glb differ diff --git a/src/client/assets/room/furnitures/rubik-cube/rubik-cube.blend b/src/client/assets/room/furnitures/rubik-cube/rubik-cube.blend new file mode 100644 index 0000000000000000000000000000000000000000..6c09067e78bfce812853e715ed6b467fd87ab2d4 Binary files /dev/null and b/src/client/assets/room/furnitures/rubik-cube/rubik-cube.blend differ diff --git a/src/client/assets/room/furnitures/rubik-cube/rubik-cube.glb b/src/client/assets/room/furnitures/rubik-cube/rubik-cube.glb new file mode 100644 index 0000000000000000000000000000000000000000..d640df9b06e50757d021866fb6eeda54ad272296 Binary files /dev/null and b/src/client/assets/room/furnitures/rubik-cube/rubik-cube.glb differ diff --git a/src/client/assets/room/furnitures/server/rack-uv.png b/src/client/assets/room/furnitures/server/rack-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..65bdb0ffd91b3b4dccbc0e83f1641c42c99afe59 Binary files /dev/null and b/src/client/assets/room/furnitures/server/rack-uv.png differ diff --git a/src/client/assets/room/furnitures/server/rack.png b/src/client/assets/room/furnitures/server/rack.png new file mode 100644 index 0000000000000000000000000000000000000000..b851295cfa1c5748c4b42b13ee9296c358be3544 Binary files /dev/null and b/src/client/assets/room/furnitures/server/rack.png differ diff --git a/src/client/assets/room/furnitures/server/server.blend b/src/client/assets/room/furnitures/server/server.blend new file mode 100644 index 0000000000000000000000000000000000000000..6675dfbdc2f020c98cb755bd1989de2a753b107a Binary files /dev/null and b/src/client/assets/room/furnitures/server/server.blend differ diff --git a/src/client/assets/room/furnitures/server/server.glb b/src/client/assets/room/furnitures/server/server.glb new file mode 100644 index 0000000000000000000000000000000000000000..a8b530a2d22ee5cce3e76ac644c55f64e7e2f041 Binary files /dev/null and b/src/client/assets/room/furnitures/server/server.glb differ diff --git a/src/client/assets/room/furnitures/server/server.png b/src/client/assets/room/furnitures/server/server.png new file mode 100644 index 0000000000000000000000000000000000000000..8e9a0d716c928c335b09511e92ab308e000ab7f6 Binary files /dev/null and b/src/client/assets/room/furnitures/server/server.png differ diff --git a/src/client/assets/room/furnitures/server/uv.png b/src/client/assets/room/furnitures/server/uv.png new file mode 100644 index 0000000000000000000000000000000000000000..ca2e747d16227f000de4266c0e04c3888ba982ce Binary files /dev/null and b/src/client/assets/room/furnitures/server/uv.png differ diff --git a/src/client/assets/room/furnitures/sofa/sofa.blend b/src/client/assets/room/furnitures/sofa/sofa.blend new file mode 100644 index 0000000000000000000000000000000000000000..fb5aa51a2c05e9bed15a29e3e556775d75163d6e Binary files /dev/null and b/src/client/assets/room/furnitures/sofa/sofa.blend differ diff --git a/src/client/assets/room/furnitures/sofa/sofa.glb b/src/client/assets/room/furnitures/sofa/sofa.glb new file mode 100644 index 0000000000000000000000000000000000000000..6ce77d94ac3aff8c008ac139367827cf2c93c362 Binary files /dev/null and b/src/client/assets/room/furnitures/sofa/sofa.glb differ diff --git a/src/client/assets/room/furnitures/spiral/spiral.blend b/src/client/assets/room/furnitures/spiral/spiral.blend new file mode 100644 index 0000000000000000000000000000000000000000..9d3be77bce7e2f915a4840881ea0aaa302d3910c Binary files /dev/null and b/src/client/assets/room/furnitures/spiral/spiral.blend differ diff --git a/src/client/assets/room/furnitures/spiral/spiral.glb b/src/client/assets/room/furnitures/spiral/spiral.glb new file mode 100644 index 0000000000000000000000000000000000000000..ee8e3c23b1558750f1fa56c8a9fdeb4cabf476d9 Binary files /dev/null and b/src/client/assets/room/furnitures/spiral/spiral.glb differ diff --git a/src/client/assets/room/furnitures/tv/screen-uv.png b/src/client/assets/room/furnitures/tv/screen-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..4bb74f031f857cc5a2f0fd0cbbf082c6f45453bb Binary files /dev/null and b/src/client/assets/room/furnitures/tv/screen-uv.png differ diff --git a/src/client/assets/room/furnitures/tv/tv.blend b/src/client/assets/room/furnitures/tv/tv.blend new file mode 100644 index 0000000000000000000000000000000000000000..490e298e7b24dd1928fd4d39d7f54b7fdea63250 Binary files /dev/null and b/src/client/assets/room/furnitures/tv/tv.blend differ diff --git a/src/client/assets/room/furnitures/tv/tv.glb b/src/client/assets/room/furnitures/tv/tv.glb new file mode 100644 index 0000000000000000000000000000000000000000..b9bd23896b394fd59991885296acea68b6b37dcd Binary files /dev/null and b/src/client/assets/room/furnitures/tv/tv.glb differ diff --git a/src/client/assets/room/furnitures/wall-clock/wall-clock.blend b/src/client/assets/room/furnitures/wall-clock/wall-clock.blend new file mode 100644 index 0000000000000000000000000000000000000000..0a61c8f01e3eab209e3a2ed73fbfc13feaaa84b7 Binary files /dev/null and b/src/client/assets/room/furnitures/wall-clock/wall-clock.blend differ diff --git a/src/client/assets/room/furnitures/wall-clock/wall-clock.glb b/src/client/assets/room/furnitures/wall-clock/wall-clock.glb new file mode 100644 index 0000000000000000000000000000000000000000..b9f0093a8dc470e2783a9a53b97a021e330ee037 Binary files /dev/null and b/src/client/assets/room/furnitures/wall-clock/wall-clock.glb differ diff --git a/src/client/assets/room/rooms/default/default.blend b/src/client/assets/room/rooms/default/default.blend new file mode 100644 index 0000000000000000000000000000000000000000..661154724aafc4b46db0d6100e0be6a9458335a7 Binary files /dev/null and b/src/client/assets/room/rooms/default/default.blend differ diff --git a/src/client/assets/room/rooms/default/default.glb b/src/client/assets/room/rooms/default/default.glb new file mode 100644 index 0000000000000000000000000000000000000000..3d378deee2a9c63add57a19753481a18e409c81a Binary files /dev/null and b/src/client/assets/room/rooms/default/default.glb differ diff --git a/src/client/assets/room/rooms/washitsu/husuma-uv.png b/src/client/assets/room/rooms/washitsu/husuma-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..ae2fca3911bdd50d5d80f21a8e69e269b4af92a9 Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/husuma-uv.png differ diff --git a/src/client/assets/room/rooms/washitsu/husuma.png b/src/client/assets/room/rooms/washitsu/husuma.png new file mode 100644 index 0000000000000000000000000000000000000000..084cbed67c89845583ab8176a325aa01a86fa4e7 Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/husuma.png differ diff --git a/src/client/assets/room/rooms/washitsu/tatami-single1600.png b/src/client/assets/room/rooms/washitsu/tatami-single1600.png new file mode 100644 index 0000000000000000000000000000000000000000..c0e684d743d06352b35472a2bfce21e4a385947a Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/tatami-single1600.png differ diff --git a/src/client/assets/room/rooms/washitsu/tatami-uv.png b/src/client/assets/room/rooms/washitsu/tatami-uv.png new file mode 100644 index 0000000000000000000000000000000000000000..5b16c66091db13632800d0eea7798c93162ae48e Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/tatami-uv.png differ diff --git a/src/client/assets/room/rooms/washitsu/tatami.afdesign b/src/client/assets/room/rooms/washitsu/tatami.afdesign new file mode 100644 index 0000000000000000000000000000000000000000..9300a26950a1ab857fe71d41893c8eb2b5429ba1 Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/tatami.afdesign differ diff --git a/src/client/assets/room/rooms/washitsu/tatami.png b/src/client/assets/room/rooms/washitsu/tatami.png new file mode 100644 index 0000000000000000000000000000000000000000..8894d040ae35bb522c503ea771943e00d8194613 Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/tatami.png differ diff --git a/src/client/assets/room/rooms/washitsu/washitsu.blend b/src/client/assets/room/rooms/washitsu/washitsu.blend new file mode 100644 index 0000000000000000000000000000000000000000..84dc11374d63314bc95b4556ad0c588dc420cb98 Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/washitsu.blend differ diff --git a/src/client/assets/room/rooms/washitsu/washitsu.glb b/src/client/assets/room/rooms/washitsu/washitsu.glb new file mode 100644 index 0000000000000000000000000000000000000000..5b4767bc73d5c27e677c6b3832e7900ecbeb7604 Binary files /dev/null and b/src/client/assets/room/rooms/washitsu/washitsu.glb differ diff --git a/src/client/pages/room/preview.vue b/src/client/pages/room/preview.vue new file mode 100644 index 0000000000000000000000000000000000000000..22228cf8cbe25cf91f6b244a60d8a9b483bd3d8b --- /dev/null +++ b/src/client/pages/room/preview.vue @@ -0,0 +1,106 @@ +<template> +<canvas width="224" height="128"></canvas> +</template> + +<script lang="ts"> +import Vue from 'vue'; +import * as THREE from 'three'; + +export default Vue.extend({ + data() { + return { + selected: null, + objectHeight: 0, + orbitRadius: 5 + }; + }, + + mounted() { + const canvas = this.$el; + + const width = canvas.width; + const height = canvas.height; + + const scene = new THREE.Scene(); + + const renderer = new THREE.WebGLRenderer({ + canvas: canvas, + antialias: true, + alpha: false + }); + renderer.setPixelRatio(window.devicePixelRatio); + renderer.setSize(width, height); + renderer.setClearColor(0x000000); + renderer.autoClear = false; + renderer.shadowMap.enabled = true; + renderer.shadowMap.cullFace = THREE.CullFaceBack; + + const camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 100); + camera.zoom = 10; + camera.position.x = 0; + camera.position.y = 2; + camera.position.z = 0; + camera.updateProjectionMatrix(); + scene.add(camera); + + const ambientLight = new THREE.AmbientLight(0xffffff, 1); + ambientLight.castShadow = false; + scene.add(ambientLight); + + const light = new THREE.PointLight(0xffffff, 1, 100); + light.position.set(3, 3, 3); + scene.add(light); + + const grid = new THREE.GridHelper(5, 16, 0x444444, 0x222222); + scene.add(grid); + + const render = () => { + const timer = Date.now() * 0.0004; + requestAnimationFrame(render); + + camera.position.y = Math.sin(Math.PI / 6) * this.orbitRadius; // Math.PI / 6 => 30deg + camera.position.z = Math.cos(timer) * this.orbitRadius; + camera.position.x = Math.sin(timer) * this.orbitRadius; + camera.lookAt(new THREE.Vector3(0, this.objectHeight / 2, 0)); + renderer.render(scene, camera); + }; + + this.selected = selected => { + const obj = selected.clone(); + + // Remove current object + const current = scene.getObjectByName('obj'); + if (current != null) { + scene.remove(current); + } + + // Add new object + obj.name = 'obj'; + obj.position.x = 0; + obj.position.y = 0; + obj.position.z = 0; + obj.rotation.x = 0; + obj.rotation.y = 0; + obj.rotation.z = 0; + obj.traverse(child => { + if (child instanceof THREE.Mesh) { + child.material = child.material.clone(); + return child.material.emissive.setHex(0x000000); + } + }); + const objectBoundingBox = new THREE.Box3().setFromObject(obj); + this.objectHeight = objectBoundingBox.max.y - objectBoundingBox.min.y; + + const objectWidth = objectBoundingBox.max.x - objectBoundingBox.min.x; + const objectDepth = objectBoundingBox.max.z - objectBoundingBox.min.z; + + const horizontal = Math.hypot(objectWidth, objectDepth) / camera.aspect; + this.orbitRadius = Math.max(horizontal, this.objectHeight) * camera.zoom * 0.625 / Math.tan(camera.fov * 0.5 * (Math.PI / 180)); + + scene.add(obj); + }; + + render(); + }, +}); +</script> diff --git a/src/client/pages/room/room.vue b/src/client/pages/room/room.vue new file mode 100644 index 0000000000000000000000000000000000000000..2dd221ddf1567f6138413a77db7a93e5027adfa7 --- /dev/null +++ b/src/client/pages/room/room.vue @@ -0,0 +1,296 @@ +<template> +<div class="hveuntkp"> + <portal to="avatar" v-if="user"><mk-avatar class="avatar" :user="user" :disable-preview="true"/></portal> + <portal to="title" v-if="user"> + <mfm + :text="$t('_rooms.roomOf', { user: user.name || user.username })" + :plain="true" :nowrap="true" :custom-emojis="user.emojis" :is-note="false" + /> + </portal> + + <div class="controller _card" v-if="objectSelected"> + <div class="_content"> + <p class="name">{{ selectedFurnitureName }}</p> + <x-preview ref="preview"/> + <template v-if="selectedFurnitureInfo.props"> + <div v-for="k in Object.keys(selectedFurnitureInfo.props)" :key="k"> + <p>{{ k }}</p> + <template v-if="selectedFurnitureInfo.props[k] === 'image'"> + <mk-button @click="chooseImage(k)">{{ $t('_rooms.chooseImage') }}</mk-button> + </template> + <template v-else-if="selectedFurnitureInfo.props[k] === 'color'"> + <input type="color" :value="selectedFurnitureProps ? selectedFurnitureProps[k] : null" @change="updateColor(k, $event)"/> + </template> + </div> + </template> + </div> + <div class="_content"> + <mk-button inline @click="translate()" :primary="isTranslateMode"><fa :icon="faArrowsAlt"/> {{ $t('_rooms.translate') }}</mk-button> + <mk-button inline @click="rotate()" :primary="isRotateMode"><fa :icon="faUndo"/> {{ $t('_rooms.rotate') }}</mk-button> + <mk-button inline v-if="isTranslateMode || isRotateMode" @click="exit()"><fa :icon="faBan"/> {{ $t('_rooms.exit') }}</mk-button> + </div> + <div class="_content"> + <mk-button @click="remove()"><fa :icon="faTrashAlt"/> {{ $t('_rooms.remove') }}</mk-button> + </div> + </div> + + <div class="menu _card" v-if="isMyRoom"> + <div class="_content"> + <mk-button @click="add()"><fa :icon="faBoxOpen"/> {{ $t('_rooms.addFurniture') }}</mk-button> + </div> + <div class="_content"> + <mk-select :value="roomType" @input="updateRoomType($event)"> + <template #label>{{ $t('_rooms.roomType') }}</template> + <option value="default">{{ $t('_rooms._roomType.default') }}</option> + <option value="washitsu">{{ $t('_rooms._roomType.washitsu') }}</option> + </mk-select> + <label v-if="roomType === 'default'"> + <span>{{ $t('_rooms.carpetColor') }}</span> + <input type="color" :value="carpetColor" @change="updateCarpetColor($event)"/> + </label> + </div> + <div class="_content"> + <mk-button inline :disabled="!changed" primary @click="save()"><fa :icon="faSave"/> {{ $t('save') }}</mk-button> + <mk-button inline @click="clear()"><fa :icon="faBroom"/> {{ $t('_rooms.clear') }}</mk-button> + </div> + </div> +</div> +</template> + +<script lang="ts"> +import Vue from 'vue'; +import i18n from '../../i18n'; +import { Room } from '../../scripts/room/room'; +import parseAcct from '../../../misc/acct/parse'; +import XPreview from './preview.vue'; +const storeItems = require('../../scripts/room/furnitures.json5'); +import { faBoxOpen, faUndo, faArrowsAlt, faBan, faBroom } from '@fortawesome/free-solid-svg-icons'; +import { faSave, faTrashAlt } from '@fortawesome/free-regular-svg-icons'; +import { query as urlQuery } from '../../../prelude/url'; +import MkButton from '../../components/ui/button.vue'; +import MkSelect from '../../components/ui/select.vue'; + +let room: Room; + +export default Vue.extend({ + i18n, + + components: { + XPreview, + MkButton, + MkSelect, + }, + + props: { + acct: { + type: String, + required: true + }, + }, + + data() { + return { + user: null, + objectSelected: false, + selectedFurnitureName: null, + selectedFurnitureInfo: null, + selectedFurnitureProps: null, + roomType: null, + carpetColor: null, + isTranslateMode: false, + isRotateMode: false, + isMyRoom: false, + changed: false, + faBoxOpen, faSave, faTrashAlt, faUndo, faArrowsAlt, faBan, faBroom, + }; + }, + + async mounted() { + window.addEventListener('beforeunload', this.beforeunload); + + this.user = await this.$root.api('users/show', { + ...parseAcct(this.acct) + }); + + this.isMyRoom = this.$store.getters.isSignedIn && (this.$store.state.i.id === this.user.id); + + const roomInfo = await this.$root.api('room/show', { + userId: this.user.id + }); + + this.roomType = roomInfo.roomType; + this.carpetColor = roomInfo.carpetColor; + + room = new Room(this.user, this.isMyRoom, roomInfo, this.$el, { + graphicsQuality: this.$store.state.device.roomGraphicsQuality, + onChangeSelect: obj => { + this.objectSelected = obj != null; + if (obj) { + const f = room.findFurnitureById(obj.name); + this.selectedFurnitureName = this.$t('_rooms._furnitures.' + f.type); + this.selectedFurnitureInfo = storeItems.find(x => x.id === f.type); + this.selectedFurnitureProps = f.props + ? JSON.parse(JSON.stringify(f.props)) // Disable reactivity + : null; + this.$nextTick(() => { + this.$refs.preview.selected(obj); + }); + } + }, + useOrthographicCamera: this.$store.state.device.roomUseOrthographicCamera + }); + }, + + beforeRouteLeave(to, from, next) { + if (this.changed) { + this.$root.dialog({ + type: 'warning', + text: this.$t('leave-confirm'), + showCancelButton: true + }).then(({ canceled }) => { + if (canceled) { + next(false); + } else { + next(); + } + }); + } else { + next(); + } + }, + + beforeDestroy() { + room.destroy(); + window.removeEventListener('beforeunload', this.beforeunload); + }, + + methods: { + beforeunload(e: BeforeUnloadEvent) { + if (this.changed) { + e.preventDefault(); + e.returnValue = ''; + } + }, + + async add() { + const { canceled, result: id } = await this.$root.dialog({ + type: null, + title: this.$t('_rooms.addFurniture'), + select: { + items: storeItems.map(item => ({ + value: item.id, text: this.$t('_rooms._furnitures.' + item.id) + })) + }, + showCancelButton: true + }); + if (canceled) return; + room.addFurniture(id); + this.changed = true; + }, + + remove() { + this.isTranslateMode = false; + this.isRotateMode = false; + room.removeFurniture(); + this.changed = true; + }, + + save() { + this.$root.api('room/update', { + room: room.getRoomInfo() + }).then(() => { + this.changed = false; + this.$root.dialog({ + type: 'success', + iconOnly: true, autoClose: true + }); + }).catch((e: any) => { + this.$root.dialog({ + type: 'error', + text: e.message + }); + }); + }, + + clear() { + this.$root.dialog({ + type: 'warning', + text: this.$t('_rooms.clearConfirm'), + showCancelButton: true + }).then(({ canceled }) => { + if (canceled) return; + room.removeAllFurnitures(); + this.changed = true; + }); + }, + + chooseImage(key) { + this.$chooseDriveFile({ + multiple: false + }).then(file => { + room.updateProp(key, `/proxy/?${urlQuery({ url: file.thumbnailUrl })}`); + this.$refs.preview.selected(room.getSelectedObject()); + this.changed = true; + }); + }, + + updateColor(key, ev) { + room.updateProp(key, ev.target.value); + this.$refs.preview.selected(room.getSelectedObject()); + this.changed = true; + }, + + updateCarpetColor(ev) { + room.updateCarpetColor(ev.target.value); + this.carpetColor = ev.target.value; + this.changed = true; + }, + + updateRoomType(type) { + room.changeRoomType(type); + this.roomType = type; + this.changed = true; + }, + + translate() { + if (this.isTranslateMode) { + this.exit(); + } else { + this.isRotateMode = false; + this.isTranslateMode = true; + room.enterTransformMode('translate'); + } + this.changed = true; + }, + + rotate() { + if (this.isRotateMode) { + this.exit(); + } else { + this.isTranslateMode = false; + this.isRotateMode = true; + room.enterTransformMode('rotate'); + } + this.changed = true; + }, + + exit() { + this.isTranslateMode = false; + this.isRotateMode = false; + room.exitTransformMode(); + this.changed = true; + } + } +}); +</script> + +<style lang="scss" scoped> +.hveuntkp { + position: relative; + min-height: 500px; + + > ::v-deep canvas { + display: block; + } +} +</style> diff --git a/src/client/router.ts b/src/client/router.ts index d826d6b49322924508394928fbf95df0c67ca0f8..e997d2db9986ef379b95c8658be0eacaf98edc5c 100644 --- a/src/client/router.ts +++ b/src/client/router.ts @@ -18,6 +18,7 @@ export const router = new VueRouter({ ]}, { path: '/@:user/pages/:page', component: page('page'), props: route => ({ pageName: route.params.page, username: route.params.user }) }, { path: '/@:user/pages/:pageName/view-source', component: page('page-editor/page-editor'), props: route => ({ initUser: route.params.user, initPageName: route.params.pageName }) }, + { path: '/@:acct/room', props: true, component: page('room/room') }, { path: '/announcements', component: page('announcements') }, { path: '/about', component: page('about') }, { path: '/about-misskey', component: page('about-misskey') }, diff --git a/src/client/scripts/room/furniture.ts b/src/client/scripts/room/furniture.ts new file mode 100644 index 0000000000000000000000000000000000000000..7734e32668699547a00291fef0d828190f1ed209 --- /dev/null +++ b/src/client/scripts/room/furniture.ts @@ -0,0 +1,21 @@ +export type RoomInfo = { + roomType: string; + carpetColor: string; + furnitures: Furniture[]; +}; + +export type Furniture = { + id: string; // åŒã˜å®¶å…·ãŒè¤‡æ•°ã‚ã‚‹å ´åˆã«ãã‚Œãžã‚Œã‚’è˜åˆ¥ã™ã‚‹ãŸã‚ã®IDã§ã‚ã‚Šã€å®¶å…·IDã§ã¯ãªã„ + type: string; // ã“ã£ã¡ãŒå®¶å…·ID(chairã¨ã‹) + position: { + x: number; + y: number; + z: number; + }; + rotation: { + x: number; + y: number; + z: number; + }; + props?: Record<string, any>; +}; diff --git a/src/client/scripts/room/furnitures.json5 b/src/client/scripts/room/furnitures.json5 new file mode 100644 index 0000000000000000000000000000000000000000..7c1a90a3f93b38f277389663e445e4123766e298 --- /dev/null +++ b/src/client/scripts/room/furnitures.json5 @@ -0,0 +1,397 @@ +// 家具メタデータ + +// 家具ã«ã¯ãƒ¦ãƒ¼ã‚¶ãƒ¼ãŒè¨å®šã§ãるプãƒãƒ‘ティをè¨å®šå¯èƒ½ã§ã™: +// +// props: { +// <propname>: <proptype> +// } +// +// proptype一覧: +// * image ... ç”»åƒé¸æŠžãƒ€ã‚¤ã‚¢ãƒã‚°ã‚’出ã—ã€ãã®ç”»åƒã®URLãŒæ ¼ç´ã•ã‚Œã¾ã™ +// * color ... 色é¸æŠžã‚³ãƒ³ãƒˆãƒãƒ¼ãƒ«ã‚’出ã—ã€é¸æŠžã•ã‚ŒãŸè‰²ãŒæ ¼ç´ã•ã‚Œã¾ã™ + +// 家具ã«ã‚«ã‚¹ã‚¿ãƒ テクスãƒãƒ£ã‚’é©ç”¨ã§ãるよã†ã«ã™ã‚‹ã«ã¯ã€textureプãƒãƒ‘ティã«ä»¥ä¸‹ã®è¿½åŠ ã®æƒ…å ±ã‚’å«ã‚ã¾ã™: +// 便宜上ãã®UVã®ã©ã®éƒ¨åˆ†ã«ã‚«ã‚¹ã‚¿ãƒ テクスãƒãƒ£ã‚’貼りåˆã‚ã›ã‚‹ã‹ã®ã‚¨ãƒªã‚¢ã‚’テクスãƒãƒ£ã‚¨ãƒªã‚¢ã¨å‘¼ã³ã¾ã™ã€‚ +// UVã¯1024*1024ã ã¨ä»®å®šã—ã¾ã™ã€‚ +// +// <key>: { +// prop: <プãƒãƒ‘ティå>, +// uv: { +// x: <テクスãƒãƒ£ã‚¨ãƒªã‚¢X座標>, +// y: <テクスãƒãƒ£ã‚¨ãƒªã‚¢Y座標>, +// width: <テクスãƒãƒ£ã‚¨ãƒªã‚¢ã®å¹…>, +// height: <テクスãƒãƒ£ã‚¨ãƒªã‚¢ã®é«˜ã•>, +// }, +// } +// +// <key>ã«ã¯ã€ã‚«ã‚¹ã‚¿ãƒ テクスãƒãƒ£ã‚’é©ç”¨ã—ãŸã„メッシュåを指定ã—ã¾ã™ +// <プãƒãƒ‘ティå>ã«ã¯ã€ã‚«ã‚¹ã‚¿ãƒ テクスãƒãƒ£ã¨ã—ã¦ä½¿ç”¨ã™ã‚‹ç”»åƒã‚’æ ¼ç´ã™ã‚‹ãƒ—ãƒãƒ‘ティ(å‰è¿°)åを指定ã—ã¾ã™ + +// 家具ã«ã‚«ã‚¹ã‚¿ãƒ カラーをé©ç”¨ã§ãるよã†ã«ã™ã‚‹ã«ã¯ã€colorプãƒãƒ‘ティã«ä»¥ä¸‹ã®è¿½åŠ ã®æƒ…å ±ã‚’å«ã‚ã¾ã™: +// +// <key>: <プãƒãƒ‘ティå> +// +// <key>ã«ã¯ã€ã‚«ã‚¹ã‚¿ãƒ カラーをé©ç”¨ã—ãŸã„マテリアルåを指定ã—ã¾ã™ +// <プãƒãƒ‘ティå>ã«ã¯ã€ã‚«ã‚¹ã‚¿ãƒ カラーã¨ã—ã¦ä½¿ç”¨ã™ã‚‹è‰²ã‚’æ ¼ç´ã™ã‚‹ãƒ—ãƒãƒ‘ティ(å‰è¿°)åを指定ã—ã¾ã™ + +[ + { + id: "milk", + place: "floor" + }, + { + id: "bed", + place: "floor" + }, + { + id: "low-table", + place: "floor", + props: { + color: 'color' + }, + color: { + Table: 'color' + } + }, + { + id: "desk", + place: "floor", + props: { + color: 'color' + }, + color: { + Board: 'color' + } + }, + { + id: "chair", + place: "floor", + props: { + color: 'color' + }, + color: { + Chair: 'color' + } + }, + { + id: "chair2", + place: "floor", + props: { + color1: 'color', + color2: 'color' + }, + color: { + Cushion: 'color1', + Leg: 'color2' + } + }, + { + id: "fan", + place: "wall" + }, + { + id: "pc", + place: "floor" + }, + { + id: "plant", + place: "floor" + }, + { + id: "plant2", + place: "floor" + }, + { + id: "eraser", + place: "floor" + }, + { + id: "pencil", + place: "floor" + }, + { + id: "pudding", + place: "floor" + }, + { + id: "cardboard-box", + place: "floor" + }, + { + id: "cardboard-box2", + place: "floor" + }, + { + id: "cardboard-box3", + place: "floor" + }, + { + id: "book", + place: "floor", + props: { + color: 'color' + }, + color: { + Cover: 'color' + } + }, + { + id: "book2", + place: "floor" + }, + { + id: "piano", + place: "floor" + }, + { + id: "facial-tissue", + place: "floor" + }, + { + id: "server", + place: "floor" + }, + { + id: "moon", + place: "floor" + }, + { + id: "corkboard", + place: "wall" + }, + { + id: "mousepad", + place: "floor", + props: { + color: 'color' + }, + color: { + Pad: 'color' + } + }, + { + id: "monitor", + place: "floor", + props: { + screen: 'image' + }, + texture: { + Screen: { + prop: 'screen', + uv: { + x: 0, + y: 434, + width: 1024, + height: 588, + }, + }, + }, + }, + { + id: "tv", + place: "floor", + props: { + screen: 'image' + }, + texture: { + Screen: { + prop: 'screen', + uv: { + x: 0, + y: 434, + width: 1024, + height: 588, + }, + }, + }, + }, + { + id: "keyboard", + place: "floor" + }, + { + id: "carpet-stripe", + place: "floor", + props: { + color1: 'color', + color2: 'color' + }, + color: { + CarpetAreaA: 'color1', + CarpetAreaB: 'color2' + }, + }, + { + id: "mat", + place: "floor", + props: { + color: 'color' + }, + color: { + Mat: 'color' + } + }, + { + id: "color-box", + place: "floor", + props: { + color: 'color' + }, + color: { + main: 'color' + } + }, + { + id: "wall-clock", + place: "wall" + }, + { + id: "cube", + place: "floor", + props: { + color: 'color' + }, + color: { + Cube: 'color' + } + }, + { + id: "photoframe", + place: "wall", + props: { + photo: 'image', + color: 'color' + }, + texture: { + Photo: { + prop: 'photo', + uv: { + x: 0, + y: 342, + width: 1024, + height: 683, + }, + }, + }, + color: { + Frame: 'color' + } + }, + { + id: "pinguin", + place: "floor", + props: { + body: 'color', + belly: 'color' + }, + color: { + Body: 'body', + Belly: 'belly', + } + }, + { + id: "rubik-cube", + place: "floor", + }, + { + id: "poster-h", + place: "wall", + props: { + picture: 'image' + }, + texture: { + Poster: { + prop: 'picture', + uv: { + x: 0, + y: 277, + width: 1024, + height: 745, + }, + }, + }, + }, + { + id: "poster-v", + place: "wall", + props: { + picture: 'image' + }, + texture: { + Poster: { + prop: 'picture', + uv: { + x: 0, + y: 0, + width: 745, + height: 1024, + }, + }, + }, + }, + { + id: "sofa", + place: "floor", + props: { + color: 'color' + }, + color: { + Sofa: 'color' + } + }, + { + id: "spiral", + place: "floor", + props: { + color: 'color' + }, + color: { + Step: 'color' + } + }, + { + id: "bin", + place: "floor", + props: { + color: 'color' + }, + color: { + Bin: 'color' + } + }, + { + id: "cup-noodle", + place: "floor" + }, + { + id: "holo-display", + place: "floor", + props: { + image: 'image' + }, + texture: { + Image_Front: { + prop: 'image', + uv: { + x: 0, + y: 0, + width: 1024, + height: 1024, + }, + }, + Image_Back: { + prop: 'image', + uv: { + x: 0, + y: 0, + width: 1024, + height: 1024, + }, + }, + }, + }, + { + id: 'energy-drink', + place: "floor", + } +] diff --git a/src/client/scripts/room/room.ts b/src/client/scripts/room/room.ts new file mode 100644 index 0000000000000000000000000000000000000000..a45fb11e4a9185c38ed1eb32f3f0c4dbfb30da8e --- /dev/null +++ b/src/client/scripts/room/room.ts @@ -0,0 +1,776 @@ +import autobind from 'autobind-decorator'; +import { v4 as uuid } from 'uuid'; +import * as THREE from 'three'; +import { GLTFLoader, GLTF } from 'three/examples/jsm/loaders/GLTFLoader'; +import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'; +import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'; +import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass.js'; +import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass.js'; +import { BloomPass } from 'three/examples/jsm/postprocessing/BloomPass.js'; +import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader.js'; +import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js'; +import { Furniture, RoomInfo } from './furniture'; +import { query as urlQuery } from '../../../prelude/url'; +const furnitureDefs = require('./furnitures.json5'); + +THREE.ImageUtils.crossOrigin = ''; + +type Options = { + graphicsQuality: Room['graphicsQuality']; + onChangeSelect: Room['onChangeSelect']; + useOrthographicCamera: boolean; +}; + +/** + * MisskeyRoom Core Engine + */ +export class Room { + private clock: THREE.Clock; + private scene: THREE.Scene; + private renderer: THREE.WebGLRenderer; + private camera: THREE.PerspectiveCamera | THREE.OrthographicCamera; + private controls: OrbitControls; + private composer: EffectComposer; + private mixers: THREE.AnimationMixer[] = []; + private furnitureControl: TransformControls; + private roomInfo: RoomInfo; + private graphicsQuality: 'cheep' | 'low' | 'medium' | 'high' | 'ultra'; + private roomObj: THREE.Object3D; + private objects: THREE.Object3D[] = []; + private selectedObject: THREE.Object3D = null; + private onChangeSelect: Function; + private isTransformMode = false; + private renderFrameRequestId: number; + + private get canvas(): HTMLCanvasElement { + return this.renderer.domElement; + } + + private get furnitures(): Furniture[] { + return this.roomInfo.furnitures; + } + + private set furnitures(furnitures: Furniture[]) { + this.roomInfo.furnitures = furnitures; + } + + private get enableShadow() { + return this.graphicsQuality != 'cheep'; + } + + private get usePostFXs() { + return this.graphicsQuality !== 'cheep' && this.graphicsQuality !== 'low'; + } + + private get shadowQuality() { + return ( + this.graphicsQuality === 'ultra' ? 16384 : + this.graphicsQuality === 'high' ? 8192 : + this.graphicsQuality === 'medium' ? 4096 : + this.graphicsQuality === 'low' ? 1024 : + 0); // cheep + } + + constructor(user, isMyRoom, roomInfo: RoomInfo, container: Element, options: Options) { + this.roomInfo = roomInfo; + this.graphicsQuality = options.graphicsQuality; + this.onChangeSelect = options.onChangeSelect; + + this.clock = new THREE.Clock(true); + + //#region Init a scene + this.scene = new THREE.Scene(); + + const width = container.clientWidth; + const height = container.clientHeight; + + //#region Init a renderer + this.renderer = new THREE.WebGLRenderer({ + antialias: false, + stencil: false, + alpha: false, + powerPreference: + this.graphicsQuality === 'ultra' ? 'high-performance' : + this.graphicsQuality === 'high' ? 'high-performance' : + this.graphicsQuality === 'medium' ? 'default' : + this.graphicsQuality === 'low' ? 'low-power' : + 'low-power' // cheep + }); + + this.renderer.setPixelRatio(window.devicePixelRatio); + this.renderer.setSize(width, height); + this.renderer.autoClear = false; + this.renderer.setClearColor(new THREE.Color(0x051f2d)); + this.renderer.shadowMap.enabled = this.enableShadow; + this.renderer.gammaOutput = true; + this.renderer.shadowMap.type = + this.graphicsQuality === 'ultra' ? THREE.PCFSoftShadowMap : + this.graphicsQuality === 'high' ? THREE.PCFSoftShadowMap : + this.graphicsQuality === 'medium' ? THREE.PCFShadowMap : + this.graphicsQuality === 'low' ? THREE.BasicShadowMap : + THREE.BasicShadowMap; // cheep + + container.insertBefore(this.canvas, container.firstChild); + //#endregion + + //#region Init a camera + this.camera = options.useOrthographicCamera + ? new THREE.OrthographicCamera( + width / - 2, width / 2, height / 2, height / - 2, -10, 10) + : new THREE.PerspectiveCamera(45, width / height); + + if (options.useOrthographicCamera) { + this.camera.position.x = 2; + this.camera.position.y = 2; + this.camera.position.z = 2; + this.camera.zoom = 100; + this.camera.updateProjectionMatrix(); + } else { + this.camera.position.x = 5; + this.camera.position.y = 2; + this.camera.position.z = 5; + } + + this.scene.add(this.camera); + //#endregion + + //#region AmbientLight + const ambientLight = new THREE.AmbientLight(0xffffff, 1); + this.scene.add(ambientLight); + //#endregion + + if (this.graphicsQuality !== 'cheep') { + //#region Room light + const roomLight = new THREE.SpotLight(0xffffff, 0.1); + + roomLight.position.set(0, 8, 0); + roomLight.castShadow = this.enableShadow; + roomLight.shadow.bias = -0.0001; + roomLight.shadow.mapSize.width = this.shadowQuality; + roomLight.shadow.mapSize.height = this.shadowQuality; + roomLight.shadow.camera.near = 0.1; + roomLight.shadow.camera.far = 9; + roomLight.shadow.camera.fov = 45; + + this.scene.add(roomLight); + //#endregion + } + + //#region Out light + const outLight1 = new THREE.SpotLight(0xffffff, 0.4); + outLight1.position.set(9, 3, -2); + outLight1.castShadow = this.enableShadow; + outLight1.shadow.bias = -0.001; // アクãƒã€ã‚¢ãƒ¼ãƒãƒ•ã‚¡ã‚¯ãƒˆå¯¾ç– ãã®ä»£ã‚りピーターパンãŒç™ºç”Ÿã™ã‚‹å¯èƒ½æ€§ãŒã‚ã‚‹ + outLight1.shadow.mapSize.width = this.shadowQuality; + outLight1.shadow.mapSize.height = this.shadowQuality; + outLight1.shadow.camera.near = 6; + outLight1.shadow.camera.far = 15; + outLight1.shadow.camera.fov = 45; + this.scene.add(outLight1); + + const outLight2 = new THREE.SpotLight(0xffffff, 0.2); + outLight2.position.set(-2, 3, 9); + outLight2.castShadow = false; + outLight2.shadow.bias = -0.001; // アクãƒã€ã‚¢ãƒ¼ãƒãƒ•ã‚¡ã‚¯ãƒˆå¯¾ç– ãã®ä»£ã‚りピーターパンãŒç™ºç”Ÿã™ã‚‹å¯èƒ½æ€§ãŒã‚ã‚‹ + outLight2.shadow.camera.near = 6; + outLight2.shadow.camera.far = 15; + outLight2.shadow.camera.fov = 45; + this.scene.add(outLight2); + //#endregion + + //#region Init a controller + this.controls = new OrbitControls(this.camera, this.canvas); + + this.controls.target.set(0, 1, 0); + this.controls.enableZoom = true; + this.controls.enablePan = isMyRoom; + this.controls.minPolarAngle = 0; + this.controls.maxPolarAngle = Math.PI / 2; + this.controls.minAzimuthAngle = 0; + this.controls.maxAzimuthAngle = Math.PI / 2; + this.controls.enableDamping = true; + this.controls.dampingFactor = 0.2; + //#endregion + + //#region POST FXs + if (!this.usePostFXs) { + this.composer = null; + } else { + const renderTarget = new THREE.WebGLRenderTarget(width, height, { + minFilter: THREE.LinearFilter, + magFilter: THREE.LinearFilter, + format: THREE.RGBFormat, + stencilBuffer: false, + }); + + const fxaa = new ShaderPass(FXAAShader); + fxaa.uniforms['resolution'].value = new THREE.Vector2(1 / width, 1 / height); + fxaa.renderToScreen = true; + + this.composer = new EffectComposer(this.renderer, renderTarget); + this.composer.addPass(new RenderPass(this.scene, this.camera)); + if (this.graphicsQuality === 'ultra') { + this.composer.addPass(new BloomPass(0.25, 30, 128.0, 512)); + } + this.composer.addPass(fxaa); + } + //#endregion + //#endregion + + //#region Label + //#region Avatar + const avatarUrl = `/proxy/?${urlQuery({ url: user.avatarUrl })}`; + + const textureLoader = new THREE.TextureLoader(); + textureLoader.crossOrigin = 'anonymous'; + + const iconTexture = textureLoader.load(avatarUrl); + iconTexture.wrapS = THREE.RepeatWrapping; + iconTexture.wrapT = THREE.RepeatWrapping; + iconTexture.anisotropy = 16; + + const avatarMaterial = new THREE.MeshBasicMaterial({ + map: iconTexture, + side: THREE.DoubleSide, + alphaTest: 0.5 + }); + + const iconGeometry = new THREE.PlaneGeometry(1, 1); + + const avatarObject = new THREE.Mesh(iconGeometry, avatarMaterial); + avatarObject.position.set(-3, 2.5, 2); + avatarObject.rotation.y = Math.PI / 2; + avatarObject.castShadow = false; + + this.scene.add(avatarObject); + //#endregion + + //#region Username + const name = user.username; + + new THREE.FontLoader().load('/assets/fonts/helvetiker_regular.typeface.json', font => { + const nameGeometry = new THREE.TextGeometry(name, { + size: 0.5, + height: 0, + curveSegments: 8, + font: font, + bevelThickness: 0, + bevelSize: 0, + bevelEnabled: false + }); + + const nameMaterial = new THREE.MeshLambertMaterial({ + color: 0xffffff + }); + + const nameObject = new THREE.Mesh(nameGeometry, nameMaterial); + nameObject.position.set(-3, 2.25, 1.25); + nameObject.rotation.y = Math.PI / 2; + nameObject.castShadow = false; + + this.scene.add(nameObject); + }); + //#endregion + //#endregion + + //#region Interaction + if (isMyRoom) { + this.furnitureControl = new TransformControls(this.camera, this.canvas); + this.scene.add(this.furnitureControl); + + // Hover highlight + this.canvas.onmousemove = this.onmousemove; + + // Click + this.canvas.onmousedown = this.onmousedown; + } + //#endregion + + //#region Init room + this.loadRoom(); + //#endregion + + //#region Load furnitures + for (const furniture of this.furnitures) { + this.loadFurniture(furniture).then(obj => { + this.scene.add(obj.scene); + this.objects.push(obj.scene); + }); + } + //#endregion + + // Start render + if (this.usePostFXs) { + this.renderWithPostFXs(); + } else { + this.renderWithoutPostFXs(); + } + } + + @autobind + private renderWithoutPostFXs() { + this.renderFrameRequestId = + window.requestAnimationFrame(this.renderWithoutPostFXs); + + // Update animations + const clock = this.clock.getDelta(); + for (const mixer of this.mixers) { + mixer.update(clock); + } + + this.controls.update(); + this.renderer.render(this.scene, this.camera); + } + + @autobind + private renderWithPostFXs() { + this.renderFrameRequestId = + window.requestAnimationFrame(this.renderWithPostFXs); + + // Update animations + const clock = this.clock.getDelta(); + for (const mixer of this.mixers) { + mixer.update(clock); + } + + this.controls.update(); + this.renderer.clear(); + this.composer.render(); + } + + @autobind + private loadRoom() { + const type = this.roomInfo.roomType; + new GLTFLoader().load(`/assets/room/rooms/${type}/${type}.glb`, gltf => { + gltf.scene.traverse(child => { + if (!(child instanceof THREE.Mesh)) return; + + child.receiveShadow = this.enableShadow; + + child.material = new THREE.MeshLambertMaterial({ + color: (child.material as THREE.MeshStandardMaterial).color, + map: (child.material as THREE.MeshStandardMaterial).map, + name: (child.material as THREE.MeshStandardMaterial).name, + }); + + // 異方性フィルタリング + if ((child.material as THREE.MeshLambertMaterial).map && this.graphicsQuality !== 'cheep') { + (child.material as THREE.MeshLambertMaterial).map.minFilter = THREE.LinearMipMapLinearFilter; + (child.material as THREE.MeshLambertMaterial).map.magFilter = THREE.LinearMipMapLinearFilter; + (child.material as THREE.MeshLambertMaterial).map.anisotropy = 8; + } + }); + + gltf.scene.position.set(0, 0, 0); + + this.scene.add(gltf.scene); + this.roomObj = gltf.scene; + if (this.roomInfo.roomType === 'default') { + this.applyCarpetColor(); + } + }); + } + + @autobind + private loadFurniture(furniture: Furniture) { + const def = furnitureDefs.find(d => d.id === furniture.type); + return new Promise<GLTF>((res, rej) => { + const loader = new GLTFLoader(); + loader.load(`/assets/room/furnitures/${furniture.type}/${furniture.type}.glb`, gltf => { + const model = gltf.scene; + + // Load animation + if (gltf.animations.length > 0) { + const mixer = new THREE.AnimationMixer(model); + this.mixers.push(mixer); + for (const clip of gltf.animations) { + mixer.clipAction(clip).play(); + } + } + + model.name = furniture.id; + model.position.x = furniture.position.x; + model.position.y = furniture.position.y; + model.position.z = furniture.position.z; + model.rotation.x = furniture.rotation.x; + model.rotation.y = furniture.rotation.y; + model.rotation.z = furniture.rotation.z; + + model.traverse(child => { + if (!(child instanceof THREE.Mesh)) return; + child.castShadow = this.enableShadow; + child.receiveShadow = this.enableShadow; + (child.material as THREE.MeshStandardMaterial).metalness = 0; + + // 異方性フィルタリング + if ((child.material as THREE.MeshStandardMaterial).map && this.graphicsQuality !== 'cheep') { + (child.material as THREE.MeshStandardMaterial).map.minFilter = THREE.LinearMipMapLinearFilter; + (child.material as THREE.MeshStandardMaterial).map.magFilter = THREE.LinearMipMapLinearFilter; + (child.material as THREE.MeshStandardMaterial).map.anisotropy = 8; + } + }); + + if (def.color) { // カスタムカラー + this.applyCustomColor(model); + } + + if (def.texture) { // カスタムテクスãƒãƒ£ + this.applyCustomTexture(model); + } + + res(gltf); + }, null, rej); + }); + } + + @autobind + private applyCarpetColor() { + this.roomObj.traverse(child => { + if (!(child instanceof THREE.Mesh)) return; + if (child.material && + (child.material as THREE.MeshStandardMaterial).name && + (child.material as THREE.MeshStandardMaterial).name === 'Carpet' + ) { + const colorHex = parseInt(this.roomInfo.carpetColor.substr(1), 16); + (child.material as THREE.MeshStandardMaterial).color.setHex(colorHex); + } + }); + } + + @autobind + private applyCustomColor(model: THREE.Object3D) { + const furniture = this.furnitures.find(furniture => furniture.id === model.name); + const def = furnitureDefs.find(d => d.id === furniture.type); + if (def.color == null) return; + model.traverse(child => { + if (!(child instanceof THREE.Mesh)) return; + for (const t of Object.keys(def.color)) { + if (!child.material || + !(child.material as THREE.MeshStandardMaterial).name || + (child.material as THREE.MeshStandardMaterial).name !== t + ) continue; + + const prop = def.color[t]; + const val = furniture.props ? furniture.props[prop] : undefined; + + if (val == null) continue; + + const colorHex = parseInt(val.substr(1), 16); + (child.material as THREE.MeshStandardMaterial).color.setHex(colorHex); + } + }); + } + + @autobind + private applyCustomTexture(model: THREE.Object3D) { + const furniture = this.furnitures.find(furniture => furniture.id === model.name); + const def = furnitureDefs.find(d => d.id === furniture.type); + if (def.texture == null) return; + + model.traverse(child => { + if (!(child instanceof THREE.Mesh)) return; + for (const t of Object.keys(def.texture)) { + if (child.name !== t) continue; + + const prop = def.texture[t].prop; + const val = furniture.props ? furniture.props[prop] : undefined; + + if (val == null) continue; + + const canvas = document.createElement('canvas'); + canvas.height = 1024; + canvas.width = 1024; + + child.material = new THREE.MeshLambertMaterial({ + emissive: 0x111111, + side: THREE.DoubleSide, + alphaTest: 0.5, + }); + + const img = new Image(); + img.crossOrigin = 'anonymous'; + img.onload = () => { + const uvInfo = def.texture[t].uv; + + const ctx = canvas.getContext('2d'); + ctx.drawImage(img, + 0, 0, img.width, img.height, + uvInfo.x, uvInfo.y, uvInfo.width, uvInfo.height); + + const texture = new THREE.Texture(canvas); + texture.wrapS = THREE.RepeatWrapping; + texture.wrapT = THREE.RepeatWrapping; + texture.anisotropy = 16; + texture.flipY = false; + + (child.material as THREE.MeshLambertMaterial).map = texture; + (child.material as THREE.MeshLambertMaterial).needsUpdate = true; + (child.material as THREE.MeshLambertMaterial).map.needsUpdate = true; + }; + img.src = val; + } + }); + } + + @autobind + private onmousemove(ev: MouseEvent) { + if (this.isTransformMode) return; + + const rect = (ev.target as HTMLElement).getBoundingClientRect(); + const x = (((ev.clientX * window.devicePixelRatio) - rect.left) / this.canvas.width) * 2 - 1; + const y = -(((ev.clientY * window.devicePixelRatio) - rect.top) / this.canvas.height) * 2 + 1; + const pos = new THREE.Vector2(x, y); + + this.camera.updateMatrixWorld(); + + const raycaster = new THREE.Raycaster(); + raycaster.setFromCamera(pos, this.camera); + + const intersects = raycaster.intersectObjects(this.objects, true); + + for (const object of this.objects) { + if (this.isSelectedObject(object)) continue; + object.traverse(child => { + if (child instanceof THREE.Mesh) { + (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x000000); + } + }); + } + + if (intersects.length > 0) { + const intersected = this.getRoot(intersects[0].object); + if (this.isSelectedObject(intersected)) return; + intersected.traverse(child => { + if (child instanceof THREE.Mesh) { + (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x191919); + } + }); + } + } + + @autobind + private onmousedown(ev: MouseEvent) { + if (this.isTransformMode) return; + if (ev.target !== this.canvas || ev.button !== 0) return; + + const rect = (ev.target as HTMLElement).getBoundingClientRect(); + const x = (((ev.clientX * window.devicePixelRatio) - rect.left) / this.canvas.width) * 2 - 1; + const y = -(((ev.clientY * window.devicePixelRatio) - rect.top) / this.canvas.height) * 2 + 1; + const pos = new THREE.Vector2(x, y); + + this.camera.updateMatrixWorld(); + + const raycaster = new THREE.Raycaster(); + raycaster.setFromCamera(pos, this.camera); + + const intersects = raycaster.intersectObjects(this.objects, true); + + for (const object of this.objects) { + object.traverse(child => { + if (child instanceof THREE.Mesh) { + (child.material as THREE.MeshStandardMaterial).emissive.setHex(0x000000); + } + }); + } + + if (intersects.length > 0) { + const selectedObj = this.getRoot(intersects[0].object); + this.selectFurniture(selectedObj); + } else { + this.selectedObject = null; + this.onChangeSelect(null); + } + } + + @autobind + private getRoot(obj: THREE.Object3D): THREE.Object3D { + let found = false; + let x = obj.parent; + while (!found) { + if (x.parent.parent == null) { + found = true; + } else { + x = x.parent; + } + } + return x; + } + + @autobind + private isSelectedObject(obj: THREE.Object3D): boolean { + if (this.selectedObject == null) { + return false; + } else { + return obj.name === this.selectedObject.name; + } + } + + @autobind + private selectFurniture(obj: THREE.Object3D) { + this.selectedObject = obj; + this.onChangeSelect(obj); + obj.traverse(child => { + if (child instanceof THREE.Mesh) { + (child.material as THREE.MeshStandardMaterial).emissive.setHex(0xff0000); + } + }); + } + + /** + * 家具ã®ç§»å‹•/回転モードã«ã—ã¾ã™ + * @param type 移動ã‹å›žè»¢ã‹ + */ + @autobind + public enterTransformMode(type: 'translate' | 'rotate') { + this.isTransformMode = true; + this.furnitureControl.setMode(type); + this.furnitureControl.attach(this.selectedObject); + this.controls.enableRotate = false; + } + + /** + * 家具ã®ç§»å‹•/回転モードを終了ã—ã¾ã™ + */ + @autobind + public exitTransformMode() { + this.isTransformMode = false; + this.furnitureControl.detach(); + this.controls.enableRotate = true; + } + + /** + * 家具プãƒãƒ‘ティを更新ã—ã¾ã™ + * @param key プãƒãƒ‘ティå + * @param value 値 + */ + @autobind + public updateProp(key: string, value: any) { + const furniture = this.furnitures.find(furniture => furniture.id === this.selectedObject.name); + if (furniture.props == null) furniture.props = {}; + furniture.props[key] = value; + this.applyCustomColor(this.selectedObject); + this.applyCustomTexture(this.selectedObject); + } + + /** + * 部屋ã«å®¶å…·ã‚’è¿½åŠ ã—ã¾ã™ + * @param type 家具ã®ç¨®é¡ž + */ + @autobind + public addFurniture(type: string) { + const furniture = { + id: uuid(), + type: type, + position: { + x: 0, + y: 0, + z: 0, + }, + rotation: { + x: 0, + y: 0, + z: 0, + }, + }; + + this.furnitures.push(furniture); + + this.loadFurniture(furniture).then(obj => { + this.scene.add(obj.scene); + this.objects.push(obj.scene); + }); + } + + /** + * ç¾åœ¨é¸æŠžã•ã‚Œã¦ã„る家具を部屋ã‹ã‚‰å‰Šé™¤ã—ã¾ã™ + */ + @autobind + public removeFurniture() { + this.exitTransformMode(); + const obj = this.selectedObject; + this.scene.remove(obj); + this.objects = this.objects.filter(object => object.name !== obj.name); + this.furnitures = this.furnitures.filter(furniture => furniture.id !== obj.name); + this.selectedObject = null; + this.onChangeSelect(null); + } + + /** + * å…¨ã¦ã®å®¶å…·ã‚’部屋ã‹ã‚‰å‰Šé™¤ã—ã¾ã™ + */ + @autobind + public removeAllFurnitures() { + this.exitTransformMode(); + for (const obj of this.objects) { + this.scene.remove(obj); + } + this.objects = []; + this.furnitures = []; + this.selectedObject = null; + this.onChangeSelect(null); + } + + /** + * 部屋ã®åºŠã®è‰²ã‚’変更ã—ã¾ã™ + * @param color 色 + */ + @autobind + public updateCarpetColor(color: string) { + this.roomInfo.carpetColor = color; + this.applyCarpetColor(); + } + + /** + * 部屋ã®ç¨®é¡žã‚’変更ã—ã¾ã™ + * @param type 種類 + */ + @autobind + public changeRoomType(type: string) { + this.roomInfo.roomType = type; + this.scene.remove(this.roomObj); + this.loadRoom(); + } + + /** + * 部屋データをå–å¾—ã—ã¾ã™ + */ + @autobind + public getRoomInfo() { + for (const obj of this.objects) { + const furniture = this.furnitures.find(f => f.id === obj.name); + furniture.position.x = obj.position.x; + furniture.position.y = obj.position.y; + furniture.position.z = obj.position.z; + furniture.rotation.x = obj.rotation.x; + furniture.rotation.y = obj.rotation.y; + furniture.rotation.z = obj.rotation.z; + } + + return this.roomInfo; + } + + /** + * é¸æŠžã•ã‚Œã¦ã„る家具をå–å¾—ã—ã¾ã™ + */ + @autobind + public getSelectedObject() { + return this.selectedObject; + } + + @autobind + public findFurnitureById(id: string) { + return this.furnitures.find(furniture => furniture.id === id); + } + + /** + * レンダリングを終了ã—ã¾ã™ + */ + @autobind + public destroy() { + // Stop render loop + window.cancelAnimationFrame(this.renderFrameRequestId); + + this.controls.dispose(); + this.scene.dispose(); + } +} diff --git a/src/client/store.ts b/src/client/store.ts index 23c8001846896d105390adaee5515ca408cd2ffe..c1d7d39910e82f4ef0508d5e51c6b10ab4a90446 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -56,6 +56,8 @@ export const defaultDeviceSettings = { imageNewTab: false, showFixedPostForm: false, disablePagesScript: true, + roomGraphicsQuality: 'medium', + roomUseOrthographicCamera: true, sfxVolume: 0.3, sfxNote: 'syuilo/down', sfxNoteMy: 'syuilo/up', @@ -187,6 +189,12 @@ export default () => new Vuex.Store({ icon: faTerminal, to: '/scratchpad', }, + rooms: { + title: 'rooms', + icon: faDoorClosed, + get show() { return getters.isSignedIn; }, + get to() { return `/@${state.i.username}/room`; }, + }, }), },