- Duke: Move Duke-exclusive code from PlayerHorizon struct into displayweapon_d() and clamp tangent to handle high pitches.

* Clamped range is slightly higher than original (200 vs. 256), however when tested with idle knuckle cracking, etc, hands were drawn not above the screen unlike unclamped tangent.
This commit is contained in:
Mitchell Richters 2022-09-30 15:23:47 +10:00 committed by Christoph Oelckers
parent dbdcdb934f
commit 13d643deb5
2 changed files with 1 additions and 4 deletions

View file

@ -42,9 +42,6 @@ struct PlayerHorizon
void unlockinput() { inputdisabled = false; }
bool movementlocked() { return targetset() || inputdisabled; }
// Draw code helpers.
double horizsumfrac(double const interpfrac) { return (!SyncInput() ? sum() : interpolatedsum(interpfrac)).Tan() * 8.; }
// Ticrate playsim adjustment setters and processor.
void addadjustment(DAngle const value)
{

View file

@ -231,7 +231,7 @@ void displayweapon_d(int snum, double interpfrac)
}
plravel = getavel(snum) * (1. / 16.);
horiz16th = p->horizon.horizsumfrac(interpfrac);
horiz16th = clamp((!SyncInput() ? p->horizon.sum() : p->horizon.interpolatedsum(interpfrac)).Tan(), -2., 2.) * 8.;
look_anghalf = p->angle.look_anghalf(interpfrac);
looking_arc = p->angle.looking_arc(interpfrac);
hard_landing *= 8.;