fix(ymir): damp downhill 3D jump on quad earlyBreak plant
This commit is contained in:
parent
b8f82bc8db
commit
6802868912
1 changed files with 18 additions and 1 deletions
|
|
@ -1521,7 +1521,7 @@ namespace RustToDust.Ymir
|
||||||
if (!IsInGroup(n, i, ws.StanceGroup))
|
if (!IsInGroup(n, i, ws.StanceGroup))
|
||||||
{
|
{
|
||||||
Vector3 plantSource = ws.SwingTargetSole[i];
|
Vector3 plantSource = ws.SwingTargetSole[i];
|
||||||
float maxPlantStep = MathF.Max(0.85f * scale, horizSpeed * dt * 2.2f);
|
float maxPlantStep = MathF.Max(1.15f * scale, horizSpeed * dt * 2.2f);
|
||||||
bool earlyQuadClamp = earlyBreak && !(n == 2 && scale >= 0.70f);
|
bool earlyQuadClamp = earlyBreak && !(n == 2 && scale >= 0.70f);
|
||||||
if (earlyBreak)
|
if (earlyBreak)
|
||||||
{
|
{
|
||||||
|
|
@ -1577,6 +1577,23 @@ 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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue