summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Vehicle.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-18 16:55:38 +0200
committeraap <aap@papnet.eu>2020-05-18 16:55:38 +0200
commit2588e69849c3a0e4d8c234a3a0e425fceb973d97 (patch)
tree61cb91e2c8f751390c0a74488cb4809697bd54b0 /src/vehicles/Vehicle.cpp
parentfixes for braking and cloud rotation at high fps (diff)
downloadre3-2588e69849c3a0e4d8c234a3a0e425fceb973d97.tar
re3-2588e69849c3a0e4d8c234a3a0e425fceb973d97.tar.gz
re3-2588e69849c3a0e4d8c234a3a0e425fceb973d97.tar.bz2
re3-2588e69849c3a0e4d8c234a3a0e425fceb973d97.tar.lz
re3-2588e69849c3a0e4d8c234a3a0e425fceb973d97.tar.xz
re3-2588e69849c3a0e4d8c234a3a0e425fceb973d97.tar.zst
re3-2588e69849c3a0e4d8c234a3a0e425fceb973d97.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/Vehicle.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index f85f0d50..6646f7f3 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -487,6 +487,11 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon
if(contactSpeedRight != 0.0f){
// exert opposing force
right = -contactSpeedRight/wheelsOnGround;
+#ifdef FIX_BUGS
+ // contactSpeedRight is independent of framerate but right has timestep as a factor
+ // so we probably have to fix this
+ right *= CTimer::GetTimeStepFix();
+#endif
if(wheelStatus == WHEEL_STATUS_BURST){
float fwdspeed = Min(contactSpeedFwd, 0.3f);
@@ -507,6 +512,11 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon
}
}else if(contactSpeedFwd != 0.0f){
fwd = -contactSpeedFwd/wheelsOnGround;
+#ifdef FIX_BUGS
+ // contactSpeedFwd is independent of framerate but fwd has timestep as a factor
+ // so we probably have to fix this
+ fwd *= CTimer::GetTimeStepFix();
+#endif
if(!bBraking){
if(m_fGasPedal < 0.01f){