From 309974087b0e14e2de546e04c2c945c11f05e621 Mon Sep 17 00:00:00 2001 From: EJClaw Date: Thu, 29 Oct 2026 18:35:24 +0900 Subject: [PATCH] =?UTF-8?q?1=EC=9D=B8=EC=B9=AD:=20=EC=9A=94=EC=9B=90=20?= =?UTF-8?q?=C2=B7=20=EB=AC=B4=EA=B8=B0=EB=A5=BC=20=EB=B0=94=EA=BF=94=20?= =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EB=A7=8C=EB=93=A4=20=EB=95=8C=20=EB=88=88?= =?UTF-8?q?=20=EA=B8=B0=EC=A4=80=EC=A0=90=EC=9D=84=20=ED=8C=94=20=EA=B3=B5?= =?UTF-8?q?=EA=B0=84=20=EC=A2=8C=ED=91=9C=EB=A1=9C=20(=EC=9D=B4=EC=A0=84?= =?UTF-8?q?=20root=20=EB=B3=80=ED=99=98=EC=9D=B4=20=EC=84=9E=EC=97=AC=201.?= =?UTF-8?q?6m=20=EB=B0=80=EB=A6=AC=EB=8D=98=20=EA=B2=83)=20=C2=B7=20?= =?UTF-8?q?=EC=8A=A4=ED=8C=8C=EC=9D=B4=ED=81=AC=20=EC=84=A4=EC=B9=98=20?= =?UTF-8?q?=EA=B5=AC=EA=B0=84=EC=97=90=20=EC=84=A4=EC=B9=98=20=EB=8F=99?= =?UTF-8?q?=EC=9E=91(activate)=20=EC=9E=AC=EC=83=9D=20(=EC=84=A4=EC=B9=98?= =?UTF-8?q?=20=EC=8B=9C=EC=9E=91=20=EB=95=8C=20=EC=8A=A4=ED=8C=8C=EC=9D=B4?= =?UTF-8?q?=ED=81=AC=EB=A5=BC=20=EA=BA=BC=EB=82=B4=EB=AF=80=EB=A1=9C=20?= =?UTF-8?q?=EA=BA=BC=EB=82=B4=EA=B8=B0=EB=B3=B4=EB=8B=A4=20=EB=A8=BC?= =?UTF-8?q?=EC=A0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- site/web/src/components/ReplayViewer.tsx | 4 ++++ site/web/src/lib/viewmodel.ts | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/site/web/src/components/ReplayViewer.tsx b/site/web/src/components/ReplayViewer.tsx index 576b66f..39ec375 100644 --- a/site/web/src/components/ReplayViewer.tsx +++ b/site/web/src/components/ReplayViewer.tsx @@ -624,6 +624,9 @@ export default function ReplayViewer({ m, replay, sync }: Props) { const a = samplePlayer(tr, t, replay.sampleMs * 6); const b = samplePlayer(tr, t - 200, replay.sampleMs * 6); const moving = !!a && !!b && Math.hypot(a.x - b.x, a.y - b.y) > 30; + // 스파이크 설치 중 (이어지는 동작 Plant 구간) + let activateMs: number | null = null; + for (const [a0, a1, k] of animIx.actions[p]) if (k === 'Plant' && a0 <= t && t <= a1) activateMs = t - a0; return { kind, zoom, @@ -634,6 +637,7 @@ export default function ReplayViewer({ m, replay, sync }: Props) { reloadMs, ads: zoom > 0, walkMs: moving ? t : null, + activateMs: kind === 'Spike' ? activateMs : null, }, }; }; diff --git a/site/web/src/lib/viewmodel.ts b/site/web/src/lib/viewmodel.ts index 4e3df49..e9cf41d 100644 --- a/site/web/src/lib/viewmodel.ts +++ b/site/web/src/lib/viewmodel.ts @@ -51,6 +51,8 @@ export interface VmInput { ads: boolean; /** 걷는 중이면 걸은 시간 (반복 동작 위치) */ walkMs: number | null; + /** 스파이크 설치 시작 뒤 (설치하는 동안만) */ + activateMs?: number | null; } function findBone(root: THREE.Object3D, name: string): THREE.Object3D | null { @@ -157,8 +159,9 @@ export class Viewmodel { // 눈 = 팔 Camera 뼈 (대기 자세) this.play(this.armsMixer, this.armClips.get('idle'), 0, false); arms.updateMatrixWorld(true); + // 팔 공간 좌표로 (root 에 이전 요원 · 무기의 변환이 남아 있어도 같은 값) const cam = findBone(arms, 'Camera'); - const cp = cam ? new THREE.Vector3().setFromMatrixPosition(cam.matrixWorld) : new THREE.Vector3(0, 0, 166); + const cp = cam ? arms.worldToLocal(new THREE.Vector3().setFromMatrixPosition(cam.matrixWorld)) : new THREE.Vector3(0, 0, 166); this.root.matrix.copy(UE_TO_VIEW).multiply(new THREE.Matrix4().makeTranslation(-cp.x, -cp.y, -cp.z)); this.root.matrixWorldNeedsUpdate = true; } @@ -181,14 +184,15 @@ export class Viewmodel { return true; } - /** 시각만으로 자세: 꺼내기 > 재장전 > 사격 > 걷기 > 정조준 > 대기 */ + /** 시각만으로 자세: 스파이크 설치 > 꺼내기 > 재장전 > 사격 > 걷기 > 정조준 > 대기 (설치 시작 때 스파이크를 꺼내므로 설치가 먼저) */ pose(i: VmInput) { if (!this.armsMixer || !this.gunMixer) return; const dur = (n: string) => (this.armClips.get(n)?.duration ?? 0) * 1000; let role = 'idle'; let ms = 0; let loop = false; - if (i.equipMs != null && i.equipMs < dur('equip')) [role, ms] = ['equip', i.equipMs]; + if (i.activateMs != null && this.armClips.has('activate')) [role, ms] = ['activate', i.activateMs]; + else if (i.equipMs != null && i.equipMs < dur('equip')) [role, ms] = ['equip', i.equipMs]; else if (i.reloadMs != null && i.reloadMs < dur('reload')) [role, ms] = ['reload', i.reloadMs]; else if (i.shotMs != null && i.shotMs < dur('fire')) [role, ms] = ['fire', i.shotMs]; else if (i.walkMs != null && this.armClips.has('walk') && !i.ads) [role, ms, loop] = ['walk', i.walkMs, true];