cut11b: preserve biped step duration, balance quad break ratios, and bound swing step
This commit is contained in:
parent
f69d8fdc73
commit
133e534786
1 changed files with 6 additions and 5 deletions
|
|
@ -1455,7 +1455,7 @@ namespace RustToDust.Ymir
|
|||
{
|
||||
float hScale = MathF.Max(0.30f, rideHeight / 3.20f);
|
||||
float baseDur = Math.Clamp(0.48f * MathF.Sqrt(hScale), 0.24f, 0.58f);
|
||||
float speedDurRatio = Math.Clamp(20f / MathF.Max(8f, grid.Spec.MaxSpeed), 0.72f, 1.0f);
|
||||
float speedDurRatio = Math.Clamp(30f / MathF.Max(8f, grid.Spec.MaxSpeed), 0.65f, 1.0f);
|
||||
float minDur = Math.Clamp(0.245f * MathF.Pow(hScale, 0.55f) * speedDurRatio, 0.085f, 0.32f);
|
||||
float effectiveDur = baseDur * (1f - 0.28f * speedFrac);
|
||||
float crouchFrac = n == 2 ? Math.Clamp(horizSpeed / MathF.Max(5f, grid.Spec.MaxSpeed * 0.35f), 0f, 1f) : speedFrac;
|
||||
|
|
@ -1484,8 +1484,9 @@ namespace RustToDust.Ymir
|
|||
|
||||
// Early step-completion break if a planted leg reaches > effectiveBreakFrac * MaxLegReach
|
||||
bool earlyBreak = false;
|
||||
float firstIdleRatio = n == 4 ? 0.32f : 0.68f;
|
||||
float minBreakTime = Math.Clamp(minDur * (ws.FirstStepFromIdle ? firstIdleRatio : 0.90f), 0.075f, 0.22f);
|
||||
float firstIdleRatio = n == 4 ? 0.36f : 0.68f;
|
||||
float steadyBreakRatio = n == 4 ? 0.56f : 0.90f;
|
||||
float minBreakTime = Math.Clamp(minDur * (ws.FirstStepFromIdle ? firstIdleRatio : steadyBreakRatio), 0.075f, 0.22f);
|
||||
if (ws.SwingTime >= minBreakTime && ws.SwingPhase > overlap + 0.15f)
|
||||
{
|
||||
Vector3 curPelvisShift = Vector3.Transform(ws.PelvisOffset, qYaw);
|
||||
|
|
@ -1526,7 +1527,7 @@ namespace RustToDust.Ymir
|
|||
if (!IsInGroup(n, i, ws.StanceGroup))
|
||||
{
|
||||
Vector3 plantSource = ws.SwingTargetSole[i];
|
||||
float maxPlantStep = MathF.Max(1.00f * scale, horizSpeed * dt * 2.0f);
|
||||
float maxPlantStep = MathF.Max(1.08f * scale, horizSpeed * dt * 2.1f);
|
||||
if (earlyBreak && ws.SwingPhase < 0.96f)
|
||||
{
|
||||
Vector3 stepVec = ws.SwingTargetSole[i] - ws.FootSole[i];
|
||||
|
|
@ -1762,7 +1763,7 @@ namespace RustToDust.Ymir
|
|||
Vector3 desiredSole = new(sx, MathF.Max(syBase + arcLift, minGround), sz);
|
||||
Vector3 swingStep = desiredSole - ws.FootSole[i];
|
||||
float swingStepLen = swingStep.Length();
|
||||
float maxSwingStep = MathF.Max(1.65f * scale, horizSpeed * dt * 4.5f);
|
||||
float maxSwingStep = MathF.Max(1.50f * scale, horizSpeed * dt * 4.5f);
|
||||
if (swingStepLen > maxSwingStep && swingStepLen > 1e-5f)
|
||||
{
|
||||
Vector3 cappedSole = ws.FootSole[i] + swingStep * (maxSwingStep / swingStepLen);
|
||||
|
|
|
|||
Loading…
Reference in a new issue