summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-08 22:57:58 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-10-08 22:57:58 +0200
commit9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e (patch)
tree0041b54ddeb9d9dd1eee4a1ef474bb953f2608fe /src/vehicles
parentfixed bugs (diff)
parentFull CGameLogic (diff)
downloadre3-9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e.tar
re3-9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e.tar.gz
re3-9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e.tar.bz2
re3-9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e.tar.lz
re3-9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e.tar.xz
re3-9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e.tar.zst
re3-9e5a5f2ab6432ec64a6a7f7ac78fa514fdf5038e.zip
Diffstat (limited to 'src/vehicles')
-rw-r--r--src/vehicles/Automobile.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 67d80915..2329a9d9 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -1933,13 +1933,15 @@ CAutomobile::Render(void)
CVector frontWheelFwd = Multiply3x3(GetMatrix(), CVector(-Sin(m_fSteerAngle), Cos(m_fSteerAngle), 0.0f));
CVector rearWheelFwd = GetForward();
for(i = 0; i < 4; i++){
- contactPoints[i] = m_aWheelColPoints[i].point - GetPosition();
- contactSpeeds[i] = GetSpeed(contactPoints[i]);
- if(i == CARWHEEL_FRONT_LEFT || i == CARWHEEL_FRONT_RIGHT)
- m_aWheelSpeed[i] = ProcessWheelRotation(m_aWheelState[i], frontWheelFwd, contactSpeeds[i], 0.5f*mi->m_wheelScale);
- else
- m_aWheelSpeed[i] = ProcessWheelRotation(m_aWheelState[i], rearWheelFwd, contactSpeeds[i], 0.5f*mi->m_wheelScale);
- m_aWheelRotation[i] += m_aWheelSpeed[i];
+ if (m_aWheelTimer[i] > 0.0f) {
+ contactPoints[i] = m_aWheelColPoints[i].point - GetPosition();
+ contactSpeeds[i] = GetSpeed(contactPoints[i]);
+ if (i == CARWHEEL_FRONT_LEFT || i == CARWHEEL_FRONT_RIGHT)
+ m_aWheelSpeed[i] = ProcessWheelRotation(m_aWheelState[i], frontWheelFwd, contactSpeeds[i], 0.5f*mi->m_wheelScale);
+ else
+ m_aWheelSpeed[i] = ProcessWheelRotation(m_aWheelState[i], rearWheelFwd, contactSpeeds[i], 0.5f*mi->m_wheelScale);
+ m_aWheelRotation[i] += m_aWheelSpeed[i];
+ }
}
// Rear right wheel