diff --git a/src/RustToDust.Ymir/ArenaSession.cs b/src/RustToDust.Ymir/ArenaSession.cs index e813350..6c9afff 100644 --- a/src/RustToDust.Ymir/ArenaSession.cs +++ b/src/RustToDust.Ymir/ArenaSession.cs @@ -551,9 +551,9 @@ namespace RustToDust.Ymir float hx = spec.HalfWidth * 0.9f; float hz = spec.HalfLength * 0.9f; float bottomY = -spec.HalfHeight; - const float restTravel = 0.18f; - float kSpring = mass * 75f; - float cDamp = mass * 9.5f; + const float restTravel = 0.20f; + float kSpring = mass * 85f; + float cDamp = mass * 10.5f; Span corners = stackalloc Vector3[4] { @@ -579,6 +579,14 @@ namespace RustToDust.Ymir } } + // Center skid-plate bump-stop prevents belly clipping when straddling sharp ridge crests at speed + float centerPen = (State.Terrain.SampleHeight(pos.X, pos.Z) + 0.08f) - (pos.Y - spec.HalfHeight); + if (centerPen > 0f) + { + groundedCorners = Math.Max(groundedCorners, 1); + supportForce.Y += Math.Clamp(mass * 160f * centerPen - mass * 12f * vel.Y, 0f, mass * 140f); + } + var (nx, ny, nz) = State.Terrain.SampleNormal(pos.X, pos.Z); terrainNormal = new Vector3(nx, ny, nz); }