From c62dfa20d2655603d6c8c94f8afd145bddf2c18a Mon Sep 17 00:00:00 2001 From: Kimberly Wilber Date: Sat, 15 Jun 2024 13:54:42 -0400 Subject: [PATCH] Disable camera dampening when looking backwards. When traveling quickly, camera dampening normally causes the camera to get further away from the player, but it screws up camera angles when looking backwards. This change causes camera dampening to happen instantly when looking behind. That way, players can expect the camera to always be in a consistent location when they tap the "look behind" button. --- src/p_user.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index c144c04bd..5b074a848 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3622,6 +3622,14 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->momx = x - thiscam->x; thiscam->momy = y - thiscam->y; + if (lookback && lookbackdelay[num]) { + // when looking back, camera's momentum + // should inherit the momentum of the player + // plus extra + thiscam->momx += 2*mo->momx; + thiscam->momy += 2*mo->momy; + } + fixed_t z_speed = Easing_Linear( player->karthud[khud_aircam], camspeed * 3 / 5,