fix(ymir): relax bastion rear maxStep (1.45 -> 2.15m) to avoid mid-swing earlyBreak
This commit is contained in:
parent
6802868912
commit
fd706b52c6
1 changed files with 1 additions and 18 deletions
|
|
@ -1577,23 +1577,6 @@ namespace RustToDust.Ymir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (earlyQuadClamp && (landedSole - ws.FootSole[i]).Length() > 1.45f * scale)
|
|
||||||
{
|
|
||||||
float midX = 0.5f * (ws.FootSole[i].X + landedSole.X);
|
|
||||||
float midZ = 0.5f * (ws.FootSole[i].Z + landedSole.Z);
|
|
||||||
var midHit = SampleGroundAt(terrain, world, midX, midZ, comPos.Y + 0.8f);
|
|
||||||
Vector3 midSole = new(midX, midHit.SurfaceY, midZ);
|
|
||||||
Vector3 midNorm = midHit.Normal;
|
|
||||||
if (ClampSoleToReach(plantHip, plantAnkleH, plantMaxReach, terrain, world, comPos.Y + 0.8f, ref midSole, out Vector3 midClampedN))
|
|
||||||
{
|
|
||||||
midNorm = midClampedN;
|
|
||||||
}
|
|
||||||
if ((midSole - ws.FootSole[i]).Length() < (landedSole - ws.FootSole[i]).Length())
|
|
||||||
{
|
|
||||||
landedSole = midSole;
|
|
||||||
landedNorm = midNorm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ws.FootSole[i] = landedSole;
|
ws.FootSole[i] = landedSole;
|
||||||
ws.FootNormal[i] = landedNorm;
|
ws.FootNormal[i] = landedNorm;
|
||||||
ws.Planted[i] = true;
|
ws.Planted[i] = true;
|
||||||
|
|
@ -1684,7 +1667,7 @@ namespace RustToDust.Ymir
|
||||||
float maxStep = geom.MaxStepRadius * scale * (1f - 0.25f * (1f - legIntegrities[i]));
|
float maxStep = geom.MaxStepRadius * scale * (1f - 0.25f * (1f - legIntegrities[i]));
|
||||||
if (geom.Legs[i].KneeBendSign < 0f)
|
if (geom.Legs[i].KneeBendSign < 0f)
|
||||||
{
|
{
|
||||||
maxStep = MathF.Min(maxStep, 1.45f * scale);
|
maxStep = MathF.Min(maxStep, 2.15f * scale);
|
||||||
}
|
}
|
||||||
if (stepOffset.Length() > maxStep)
|
if (stepOffset.Length() > maxStep)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue