From b1790791682b152bb59676da5d8d8c13e538ff2a Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 22 Apr 2023 22:45:12 +1000 Subject: [PATCH] - Move constant from previous commit into the class with the other constants. --- source/core/gameinput.cpp | 3 +-- source/core/gameinput.h | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/core/gameinput.cpp b/source/core/gameinput.cpp index 031ffa048..f3e8abcd1 100644 --- a/source/core/gameinput.cpp +++ b/source/core/gameinput.cpp @@ -516,7 +516,6 @@ void PlayerAngles::doViewTilting(InputPacket* const pInput, const DVector2& nVel { // Scale/attenuate tilting based on player actions. const auto runScale = 1. / (!(pInput->actions & SB_RUN) + 1); - const auto avelScale = (1966426. / 12000000.); const auto waterScale = 1. / (bUnderwater + 1); const auto strafeScale = !!pInput->svel + 1; @@ -524,7 +523,7 @@ void PlayerAngles::doViewTilting(InputPacket* const pInput, const DVector2& nVel { // Console-like yaw rolling. Adjustment == ~(90/32) for keyboard turning. Clamp is 1.5x this value. const auto rollAdj = DAngle::fromDeg(pInput->avel * cl_viewtiltscale); - const auto rollAmp = DAngle::fromDeg(avelScale * waterScale); + const auto rollAmp = DAngle::fromDeg(ROLL_TILTAVELSCALE * waterScale); const auto rollMax = DAngle::fromDeg((90. / 32. * 1.5) * cl_viewtiltscale); scaletozero(pActor->spr.Angles.Roll, ROLL_TILTRETURN); pActor->spr.Angles.Roll = clamp(pActor->spr.Angles.Roll + rollAdj * rollAmp, -rollMax, rollMax); diff --git a/source/core/gameinput.h b/source/core/gameinput.h index 56a718e28..0d60274e8 100644 --- a/source/core/gameinput.h +++ b/source/core/gameinput.h @@ -153,6 +153,7 @@ private: DCoreActor* pActor; // Constants used throughout input functions. + static constexpr double ROLL_TILTAVELSCALE = (1966426. / 12000000.); static constexpr double ROLL_TILTRETURN = 15.; static constexpr double YAW_LOOKINGSPEED = 801.5625; static constexpr double YAW_ROTATESPEED = 63.28125; @@ -164,7 +165,7 @@ private: static constexpr double PITCH_CENTERSPEED = 10.7375; static constexpr double PITCH_HORIZOFFSPEED = 4.375; static constexpr DAngle PITCH_CNTRSINEOFFSET = DAngle90 / 8.; - static constexpr DAngle PITCH_HORIZOFFCLIMB = DAngle::fromDeg(-38.); + static constexpr DAngle PITCH_HORIZOFFCLIMB = DAngle::fromDeg(-127076387. / 3344227.); static constexpr double PITCH_HORIZOFFPUSH = (14115687. / 31535389.); };