Skip to content

Commit

Permalink
Smoothly interpolate the player pitch-centering action
Browse files Browse the repository at this point in the history
  • Loading branch information
nashmuhandes committed Feb 4, 2025
1 parent ec42c77 commit 307fecb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions wadsrc/static/zscript/actors/player/player.zs
Original file line number Diff line number Diff line change
Expand Up @@ -1401,15 +1401,17 @@ class PlayerPawn : Actor
{
if (abs(Pitch) > 2.)
{
Pitch *= (2. / 3.);
A_SetPitch(Pitch * (2. / 3.), SPF_INTERPOLATE);
}
else
{
Pitch = 0.;
player.centering = false;
if (PlayerNumber() == consoleplayer)
A_SetPitch(Pitch * 0.75, SPF_INTERPOLATE);
if (abs(Pitch) <= 0.25)
{
LocalViewPitch = 0;
A_SetPitch(0., SPF_INTERPOLATE);
player.centering = false;
if (PlayerNumber() == consoleplayer)
LocalViewPitch = 0;
}
}
}
Expand Down

0 comments on commit 307fecb

Please sign in to comment.