Standardize targeting acquisition range by replacing complex reach multipliers with a fixed acquisition distance

This commit is contained in:
2026-04-25 16:04:21 +02:00
parent 7985afff0c
commit bb05a4b6cb

View File

@@ -20,10 +20,7 @@ import type {
const DEFAULT_INTERACTABLE_TARGET_RADIUS = 0.75; const DEFAULT_INTERACTABLE_TARGET_RADIUS = 0.75;
const DEFAULT_NPC_DIALOGUE_TARGET_RADIUS = 1.5; const DEFAULT_NPC_DIALOGUE_TARGET_RADIUS = 1.5;
const TARGETING_INTERACTABLE_REACH_MULTIPLIER = 3.5; const TARGETING_ACQUISITION_REACH = 15;
const TARGETING_NPC_REACH_MULTIPLIER = 4.5;
const TARGETING_MIN_INTERACTABLE_REACH = 5.5;
const TARGETING_MIN_NPC_REACH = 7;
const TARGETING_MIN_VIEW_DOT = 0.1; const TARGETING_MIN_VIEW_DOT = 0.1;
export interface RuntimeDialogueStartSource { export interface RuntimeDialogueStartSource {
@@ -493,10 +490,7 @@ function collectRuntimeInteractionTargetSources(
const distance = distanceBetweenVec3(interactionOrigin, interactable.position); const distance = distanceBetweenVec3(interactionOrigin, interactable.position);
const acquisitionRange = options.useTargetingReach const acquisitionRange = options.useTargetingReach
? Math.max( ? TARGETING_ACQUISITION_REACH
interactable.radius * TARGETING_INTERACTABLE_REACH_MULTIPLIER,
TARGETING_MIN_INTERACTABLE_REACH
)
: interactable.radius; : interactable.radius;
if (distance > acquisitionRange) { if (distance > acquisitionRange) {
@@ -530,10 +524,7 @@ function collectRuntimeInteractionTargetSources(
const bounds = getNpcDialogueTargetBounds(npc); const bounds = getNpcDialogueTargetBounds(npc);
const distance = distanceToAxisAlignedBox(interactionOrigin, bounds); const distance = distanceToAxisAlignedBox(interactionOrigin, bounds);
const acquisitionRange = options.useTargetingReach const acquisitionRange = options.useTargetingReach
? Math.max( ? TARGETING_ACQUISITION_REACH
bounds.range * TARGETING_NPC_REACH_MULTIPLIER,
TARGETING_MIN_NPC_REACH
)
: bounds.range; : bounds.range;
if (distance > acquisitionRange) { if (distance > acquisitionRange) {