Fix Godot Vector3.Up and stiffen terrain suspension for 34 m/s dune climbs
This commit is contained in:
parent
fcf02447ab
commit
ade15c3325
2 changed files with 5 additions and 5 deletions
|
|
@ -311,7 +311,7 @@ public partial class Main : Node3D
|
|||
_cameraSmoothedAnchor = _cameraSmoothedAnchor.Lerp(targetAnchor, blend);
|
||||
|
||||
var camFwdHoriz = new Vector3(MathF.Sin(_cameraYaw), 0f, MathF.Cos(_cameraYaw));
|
||||
var lookDir = (camFwdHoriz * MathF.Cos(_cameraPitch) - Vector3.UnitY * MathF.Sin(_cameraPitch)).Normalized();
|
||||
var lookDir = (camFwdHoriz * MathF.Cos(_cameraPitch) - Vector3.Up * MathF.Sin(_cameraPitch)).Normalized();
|
||||
|
||||
// Pull camera forward along arm if terrain or static cover blocks the shoulder-to-camera ray
|
||||
float effectiveBack = backDist;
|
||||
|
|
|
|||
|
|
@ -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.12f;
|
||||
float kSpring = mass * 50f;
|
||||
float cDamp = mass * 7.0f;
|
||||
const float restTravel = 0.18f;
|
||||
float kSpring = mass * 75f;
|
||||
float cDamp = mass * 9.5f;
|
||||
|
||||
Span<Vector3> corners = stackalloc Vector3[4]
|
||||
{
|
||||
|
|
@ -573,7 +573,7 @@ namespace RustToDust.Ymir
|
|||
{
|
||||
groundedCorners++;
|
||||
float vCornerY = vel.Y + Vector3.Cross(angVel, r).Y;
|
||||
float fY = Math.Clamp(kSpring * pen - cDamp * vCornerY, 0f, mass * 120f);
|
||||
float fY = Math.Clamp(kSpring * pen - cDamp * vCornerY, 0f, mass * 160f);
|
||||
supportForce.Y += fY;
|
||||
supportTorque += Vector3.Cross(r, new Vector3(0f, fY, 0f));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue