mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-22 18:32:44 +01:00
rwengine: Increase the engine force based on the mass
Since heavy vehicles have more inertia, they require more engine force to be moved sufficiently fast. Without this extra force, many heavy vehicles are unbearably slow to drive. Reuse the mass coefficient that was introduced to increase the engine force accordingly. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
This commit is contained in:
parent
6c66f61519
commit
3ae98dd93a
@ -316,6 +316,10 @@ void VehicleObject::tickPhysics(float dt) {
|
||||
// light vehicles.
|
||||
float kM = (std::max(1500.f, info->handling.mass) - 1500.f) / 1500.f;
|
||||
|
||||
// Increase the engine force based on the mass by up to 4 times.
|
||||
// Heavy vehicles need extra engine force to be reactive enough.
|
||||
engineForce *= std::min(1.f + kM, 4.f);
|
||||
|
||||
if (velocity > velocityMax) {
|
||||
btVector3 v = collision->getBulletBody()->getLinearVelocity().normalized();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user