mirror of
https://github.com/GTAmodding/re3.git
synced 2024-11-29 05:33:45 +00:00
Add ABS function
When braking, we check every 50 milliseconds whether the wheel is locked and if it is locked, we turn off the brake
This commit is contained in:
parent
7a80acf6a1
commit
f959b3477b
2 changed files with 11 additions and 0 deletions
|
@ -860,6 +860,16 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon
|
|||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(pHandling->bABS && brake != 0.0f && brake < 1.0f && brake > adhesion) {
|
||||
if((uint16)m_fBrakeABSTimer[wheelId] < CTimer::GetTimeStepInMilliseconds()) {
|
||||
m_fBrakeABSTimer[wheelId] = 50;
|
||||
brake = adhesion;
|
||||
} else {
|
||||
m_fBrakeABSTimer[wheelId] -= CTimer::GetTimeStepInMilliseconds();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(brake > adhesion){
|
||||
if(Abs(contactSpeedFwd) > 0.005f)
|
||||
|
|
|
@ -277,6 +277,7 @@ public:
|
|||
CStoredCollPoly m_aCollPolys[2]; // poly which is under front/rear part of car
|
||||
float m_fSteerInput;
|
||||
eVehicleType m_vehType;
|
||||
float m_fBrakeABSTimer[4];
|
||||
|
||||
static void *operator new(size_t) throw();
|
||||
static void *operator new(size_t sz, int slot) throw();
|
||||
|
|
Loading…
Reference in a new issue