summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Automobile.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-06-02 14:38:57 +0200
committeraap <aap@papnet.eu>2020-06-02 14:38:57 +0200
commit575c5466dfb3d0d0cdaa47a03b601e4f23f6af94 (patch)
treeb82a2af495d348a08071f88895c175c845a23f09 /src/vehicles/Automobile.cpp
parentCTimer fix (diff)
downloadre3-575c5466dfb3d0d0cdaa47a03b601e4f23f6af94.tar
re3-575c5466dfb3d0d0cdaa47a03b601e4f23f6af94.tar.gz
re3-575c5466dfb3d0d0cdaa47a03b601e4f23f6af94.tar.bz2
re3-575c5466dfb3d0d0cdaa47a03b601e4f23f6af94.tar.lz
re3-575c5466dfb3d0d0cdaa47a03b601e4f23f6af94.tar.xz
re3-575c5466dfb3d0d0cdaa47a03b601e4f23f6af94.tar.zst
re3-575c5466dfb3d0d0cdaa47a03b601e4f23f6af94.zip
Diffstat (limited to 'src/vehicles/Automobile.cpp')
-rw-r--r--src/vehicles/Automobile.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 37b224d1..f35dd9e3 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -2241,22 +2241,22 @@ CAutomobile::ProcessControlInputs(uint8 pad)
// Steer left/right
if(CCamera::m_bUseMouse3rdPerson && !CVehicle::m_bDisableMouseSteering){
if(CPad::GetPad(pad)->GetMouseX() != 0.0f){
- m_fSteerRatio += fMouseSteerSens*CPad::GetPad(pad)->GetMouseX();
+ m_fSteerInput += fMouseSteerSens*CPad::GetPad(pad)->GetMouseX();
nLastControlInput = 2;
- if(Abs(m_fSteerRatio) < fMouseCentreRange)
- m_fSteerRatio *= Pow(fMouseCentreMult, CTimer::GetTimeStep());
+ if(Abs(m_fSteerInput) < fMouseCentreRange)
+ m_fSteerInput *= Pow(fMouseCentreMult, CTimer::GetTimeStep());
}else if(CPad::GetPad(pad)->GetSteeringLeftRight() || nLastControlInput != 2){
// mouse hasn't move, steer with pad like below
- m_fSteerRatio += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerRatio)*
+ m_fSteerInput += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerInput)*
0.2f*CTimer::GetTimeStep();
nLastControlInput = 0;
}
}else{
- m_fSteerRatio += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerRatio)*
+ m_fSteerInput += (-CPad::GetPad(pad)->GetSteeringLeftRight()/128.0f - m_fSteerInput)*
0.2f*CTimer::GetTimeStep();
nLastControlInput = 0;
}
- m_fSteerRatio = clamp(m_fSteerRatio, -1.0f, 1.0f);
+ m_fSteerInput = clamp(m_fSteerInput, -1.0f, 1.0f);
// Accelerate/Brake
float acceleration = (CPad::GetPad(pad)->GetAccelerate() - CPad::GetPad(pad)->GetBrake())/255.0f;
@@ -2307,10 +2307,10 @@ CAutomobile::ProcessControlInputs(uint8 pad)
// Actually turn wheels
static float fValue; // why static?
- if(m_fSteerRatio < 0.0f)
- fValue = -sq(m_fSteerRatio);
+ if(m_fSteerInput < 0.0f)
+ fValue = -sq(m_fSteerInput);
else
- fValue = sq(m_fSteerRatio);
+ fValue = sq(m_fSteerInput);
m_fSteerAngle = DEGTORAD(pHandling->fSteeringLock) * fValue;
if(bComedyControls){