From fa32d8c2e1466fcf3234ba343c70ae8bb9354e25 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 25 Apr 2026 03:04:22 +0200 Subject: [PATCH] auto-git: [change] src/runtime-three/runtime-host.ts --- src/runtime-three/runtime-host.ts | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index e592c12d..f3be7575 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -1279,6 +1279,55 @@ export class RuntimeHost { return null; } + private resolveDialogueAttentionNpc() { + if (this.runtimeScene === null || this.currentDialogue === null) { + return null; + } + + return ( + this.runtimeScene.entities.npcs.find( + (candidate) => candidate.entityId === this.currentDialogue?.npcEntityId + ) ?? null + ); + } + + private resolveDialogueAttentionPlayerFocusPoint() { + if (this.runtimeScene === null) { + return null; + } + + const eyePosition = + this.currentPlayerControllerTelemetry?.eyePosition ?? { + x: this.runtimeScene.spawn.position.x, + y: + this.runtimeScene.spawn.position.y + + this.runtimeScene.playerCollider.eyeHeight, + z: this.runtimeScene.spawn.position.z + }; + const feetPosition = + this.currentPlayerControllerTelemetry?.feetPosition ?? + this.runtimeScene.spawn.position; + + return { + x: feetPosition.x + (eyePosition.x - feetPosition.x) * 0.5, + y: + feetPosition.y + + (eyePosition.y - feetPosition.y) * + DIALOGUE_ATTENTION_PLAYER_FOCUS_HEIGHT_FACTOR, + z: feetPosition.z + (eyePosition.z - feetPosition.z) * 0.5 + }; + } + + private resolveDialogueAttentionNpcFocusPoint(npc: RuntimeNpc) { + return { + x: npc.position.x, + y: + npc.position.y + + npc.collider.eyeHeight * DIALOGUE_ATTENTION_NPC_FOCUS_HEIGHT_FACTOR, + z: npc.position.z + }; + } + private resolveRuntimeCameraRigTargetPosition(rig: RuntimeCameraRig) { if (this.runtimeScene === null) { return null;