Stop adding spring lift above gravity when upward vel.Y > 3.5 m/s on crests

This commit is contained in:
Meta Vens 2026-12-04 16:10:57 +01:00
commit 9db68c2c8a

View file

@ -664,8 +664,8 @@ namespace RustToDust.Ymir
supportForce += supportDir * fCenter; supportForce += supportDir * fCenter;
} }
// Cap total spring + bump-stop vertical acceleration at <= 65 m/s^2 so ridge impacts never catapult vehicles skyward // Cap total spring + bump-stop vertical acceleration at <= 65 m/s^2 (and stop adding upward lift once vel.Y > 3.5 m/s)
float maxSpringY = mass * 65f; float maxSpringY = vel.Y > 3.5f ? mass * 20f : mass * 65f;
if (supportForce.Y > maxSpringY && supportForce.Y > 1e-4f) if (supportForce.Y > maxSpringY && supportForce.Y > 1e-4f)
{ {
supportForce *= maxSpringY / supportForce.Y; supportForce *= maxSpringY / supportForce.Y;