diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-06-05 22:17:19 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-06-05 22:20:16 +0200 |
commit | d3736ccb1715d7ad5d759f4da7144b75168d33f2 (patch) | |
tree | cc89622ce5b40c77c903caeb0ee46d91dda5d751 /src/vehicles/Vehicle.cpp | |
parent | Bike riding anims, SA bike/heli cam (diff) | |
parent | a bit more CBike (diff) | |
download | re3-d3736ccb1715d7ad5d759f4da7144b75168d33f2.tar re3-d3736ccb1715d7ad5d759f4da7144b75168d33f2.tar.gz re3-d3736ccb1715d7ad5d759f4da7144b75168d33f2.tar.bz2 re3-d3736ccb1715d7ad5d759f4da7144b75168d33f2.tar.lz re3-d3736ccb1715d7ad5d759f4da7144b75168d33f2.tar.xz re3-d3736ccb1715d7ad5d759f4da7144b75168d33f2.tar.zst re3-d3736ccb1715d7ad5d759f4da7144b75168d33f2.zip |
Diffstat (limited to 'src/vehicles/Vehicle.cpp')
-rw-r--r-- | src/vehicles/Vehicle.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp index 7e7be037..c5537a48 100644 --- a/src/vehicles/Vehicle.cpp +++ b/src/vehicles/Vehicle.cpp @@ -5,6 +5,8 @@ #include "Timer.h" #include "Pad.h" #include "Vehicle.h" +#include "Bike.h" +#include "Automobile.h" #include "Pools.h" #include "HandlingMgr.h" #include "CarCtrl.h" @@ -893,7 +895,7 @@ float fTweakBikeWheelTurnForce = 2.0f; void CVehicle::ProcessBikeWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelContactSpeed, CVector &wheelContactPoint, - int32 wheelsOnGround, float thrust, float brake, float adhesion, float unk, int8 wheelId, float *wheelSpeed, tWheelState *wheelState, eBikeWheelSpecial special, uint16 wheelStatus) + int32 wheelsOnGround, float thrust, float brake, float adhesion, float destabTraction, int8 wheelId, float *wheelSpeed, tWheelState *wheelState, eBikeWheelSpecial special, uint16 wheelStatus) { // BUG: using statics here is probably a bad idea static bool bAlreadySkidding = false; // this is never reset @@ -1010,14 +1012,14 @@ CVehicle::ProcessBikeWheel(CVector &wheelFwd, CVector &wheelRight, CVector &whee right *= adhesion * tractionLoss / l; fwd *= adhesion * tractionLoss / l; - if(unk < 1.0f) - right *= unk; - }else if(unk < 1.0f){ + if(destabTraction < 1.0f) + right *= destabTraction; + }else if(destabTraction < 1.0f){ if(!bAlreadySkidding) - unk *= pHandling->fTractionLoss; - if(sq(adhesion*unk) < speedSq){ + destabTraction *= pHandling->fTractionLoss; + if(sq(adhesion*destabTraction) < speedSq){ float l = Sqrt(speedSq); - right *= adhesion * unk / l; + right *= adhesion * destabTraction / l; } } @@ -1030,15 +1032,14 @@ CVehicle::ProcessBikeWheel(CVector &wheelFwd, CVector &wheelRight, CVector &whee float impulse = speed*m_fMass; float turnImpulse = speed*GetMass(wheelContactPoint, direction); CVector vTurnImpulse = turnImpulse * direction; - float turnRight = DotProduct(vTurnImpulse, GetRight()); ApplyMoveForce(impulse * direction); + float turnRight = DotProduct(vTurnImpulse, GetRight()); float contactRight = DotProduct(wheelContactPoint, GetRight()); float contactFwd = DotProduct(wheelContactPoint, GetForward()); - if(wheelId != CARWHEEL_REAR_LEFT || - !bBraking && !bReversing) + if(wheelId != BIKEWHEEL_REAR || !bBraking && !bReversing) ApplyTurnForce((vTurnImpulse - turnRight*GetRight()) * fTweakBikeWheelTurnForce, wheelContactPoint - contactRight*GetRight()); |