Enhance runtime targeting logic and add unit tests for target switching and loss conditions
This commit is contained in:
@@ -329,6 +329,9 @@ const DIALOGUE_PARTICIPANT_RESTORE_EPSILON_DEGREES = 0.5;
|
||||
const TARGETING_LUX_FOLLOW_RATE = 8;
|
||||
const TARGETING_LUX_BOB_RATE = 4.2;
|
||||
const TARGETING_LUX_PULSE_RATE = 6.5;
|
||||
const TARGETING_SIDE_SWITCH_YAW_THRESHOLD_RADIANS = (12 * Math.PI) / 180;
|
||||
const TARGETING_CANCEL_YAW_THRESHOLD_RADIANS = (60 * Math.PI) / 180;
|
||||
const TARGETING_MAX_ACTIVE_TARGET_DISTANCE = 35;
|
||||
// Proposed-target camera nudging is intentionally disabled for now. Lux alone
|
||||
// should communicate proposal without moving the gameplay camera.
|
||||
// const PROPOSED_TARGET_CAMERA_ASSIST_STRENGTH = 0.28;
|
||||
@@ -369,6 +372,13 @@ function lerpScalar(start: number, end: number, t: number) {
|
||||
return start + (end - start) * t;
|
||||
}
|
||||
|
||||
function distanceBetweenPoints(
|
||||
left: { x: number; y: number; z: number },
|
||||
right: { x: number; y: number; z: number }
|
||||
) {
|
||||
return Math.hypot(left.x - right.x, left.y - right.y, left.z - right.z);
|
||||
}
|
||||
|
||||
function smoothStep01(value: number) {
|
||||
const t = clampScalar(value, 0, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user