From 4644a332e43a09105977c1a6e2f5a5f130482e7e Mon Sep 17 00:00:00 2001 From: min Date: Tue, 9 Jun 2026 21:01:58 +0300 Subject: [PATCH] =?UTF-8?q?fix(g20):=20=D0=BC=D0=B5=D1=82=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=B2=D1=8F=D0=B7=D1=8B=D0=B2=D0=B0=D1=8E?= =?UTF-8?q?=D1=82=D1=81=D1=8F=20=D0=BA=20npc.data.rootMesh=20(=D0=BC=D0=BE?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Метки рисовались в куче в (0,0,0) — anchorMesh был сам npc (объект, не mesh). LabelManager делал plane.parent = anchorMesh, но позиция не наследовалась. Фикс: _resolveTweenTarget для 'npc' возвращает data.mesh = npc.data.rootMesh (реальная модель NPC). --- src/editor/engine/GameRuntime.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/editor/engine/GameRuntime.js b/src/editor/engine/GameRuntime.js index 400a1b9..6f199fd 100644 --- a/src/editor/engine/GameRuntime.js +++ b/src/editor/engine/GameRuntime.js @@ -1569,15 +1569,17 @@ export class GameRuntime { if (Number.isFinite(n)) npc = nm.npcs.get(n); } if (npc) { - // Возвращаем npc в формате 'tween-target' с mesh-ссылкой. + // У NPC реальный mesh лежит в npc.data.rootMesh (модель). + const mesh = npc.data?.rootMesh || npc.data?.rootNode + || npc.rootMesh || npc.rootNode || null; return { kind: 'npc', data: { - mesh: npc.rootMesh || npc.mesh || npc.rootNode || npc, - rootMesh: npc.rootMesh || npc.rootNode, - x: npc.x ?? npc.position?.x ?? 0, - y: npc.y ?? npc.position?.y ?? 0, - z: npc.z ?? npc.position?.z ?? 0, + mesh, + rootMesh: mesh, + x: npc.x ?? 0, + y: npc.y ?? 0, + z: npc.z ?? 0, }, }; }