From be98f3e325597fbebbdd330657cd91e57a4d7d73 Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 23 Mar 2024 00:09:57 +0900 Subject: [PATCH] fix --- src/index.ts | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/index.ts b/src/index.ts index bd85fe0df..b2b2b28db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -104,6 +104,7 @@ window.addEventListener("DOMContentLoaded", () => { } const loader = new GLTFLoader(manager); + loader.register((parser) => { return new VRMLoaderPlugin(parser); }); @@ -111,8 +112,8 @@ window.addEventListener("DOMContentLoaded", () => { return new VRMAnimationLoaderPlugin(parser); }); - load("/vrma/ai.vrm"); - load("/vrma/fly_c.vrma"); + load("/vrma/model/ai.vrm"); + load("/vrma/anime/fly_c.vrma"); const clock = new THREE.Clock(); clock.start(); @@ -264,7 +265,7 @@ window.addEventListener("DOMContentLoaded", () => { case 1: cancelAnimationFrame(anime_id); scene.add(grid); - load("/vrma/ai_normal.vrm"); + load("/vrma/model/ai_normal.vrm"); scene.remove(currentVrm.scene); renderer.toneMapping = THREE.NeutralToneMapping; light.intensity = 1; @@ -273,7 +274,7 @@ window.addEventListener("DOMContentLoaded", () => { scene.fog = new Fog(0xffffff, 3, 20); break; case 2: - load("/vrma/ai.vrm"); + load("/vrma/model/ai.vrm"); scene.remove(currentVrm.scene); break; } @@ -314,13 +315,13 @@ window.addEventListener("DOMContentLoaded", () => { function sword_s(){ scene.remove(currentVrm.scene); - load("/vrma/ai_sword.vrm"); - load("/vrma/sword.vrma"); + load("/vrma/model/ai_sword.vrm"); + load("/vrma/anime/sword.vrma"); setTimeout(() => { - load("/vrma/idle.vrma"); + load("/vrma/anime/idle.vrma"); }, 1000); setTimeout(() => { - load("/vrma/ai.vrm"); + load("/vrma/model/ai.vrm"); scene.remove(currentVrm.scene); }, 5000); } @@ -333,12 +334,12 @@ window.addEventListener("DOMContentLoaded", () => { } function cloud_s(){ - load("/vrma/sky.vrma"); + load("/vrma/anime/sky.vrma"); setTimeout(() => { - load("/vrma/jump.vrma"); + load("/vrma/anime/jump.vrma"); }, 5000); setTimeout(() => { - load("/vrma/idle.vrma"); + load("/vrma/anime/idle.vrma"); }, 5500); } @@ -349,12 +350,12 @@ window.addEventListener("DOMContentLoaded", () => { mouse_ivent_timer_id = setTimeout(function () { motion_enable = true; }, 1000); - load("/vrma/run.vrma"); + load("/vrma/anime/run.vrma"); }); } document.querySelector('#btn-run').addEventListener('mouseup', (event) => { clearTimeout(mouse_ivent_timer_id); - load("/vrma/idle.vrma"); + load("/vrma/anime/idle.vrma"); cool_time(); }); @@ -367,18 +368,18 @@ window.addEventListener("DOMContentLoaded", () => { function jump_s(){ motion_enable = true; - load("/vrma/jump.vrma"); + load("/vrma/anime/jump.vrma"); setTimeout(() => { - load("/vrma/idle.vrma"); + load("/vrma/anime/idle.vrma"); }, 500); cool_time(); } setInterval(() => { const r = Math.floor(Math.random() * 4 + 1); - if (motion_enable == false) { load("/vrma/" + r + ".vrma"); } + if (motion_enable == false) { load("/vrma/random/" + r + ".vrma"); } setTimeout(() => { - if (motion_enable == false) { load("/vrma/fly_c.vrma"); } + if (motion_enable == false) { load("/vrma/anime/fly_c.vrma"); } }, 10000); }, 15000);