fix(ymir): bound bastion maxPolyAdj within front-leg vertical reach
This commit is contained in:
parent
47b9dd85cd
commit
3510b5ebcd
1 changed files with 2 additions and 1 deletions
|
|
@ -1769,7 +1769,8 @@ namespace RustToDust.Ymir
|
||||||
float meanSoleY = 0.25f * (ws.FootSole[0].Y + ws.FootSole[1].Y + ws.FootSole[2].Y + ws.FootSole[3].Y);
|
float meanSoleY = 0.25f * (ws.FootSole[0].Y + ws.FootSole[1].Y + ws.FootSole[2].Y + ws.FootSole[3].Y);
|
||||||
var centerG = SampleGroundAt(terrain, world, comPos.X, comPos.Z, comPos.Y + 0.6f);
|
var centerG = SampleGroundAt(terrain, world, comPos.X, comPos.Z, comPos.Y + 0.6f);
|
||||||
float minPolyAdj = !geom.IsArachnidUp ? -0.25f * scale : -0.35f * scale;
|
float minPolyAdj = !geom.IsArachnidUp ? -0.25f * scale : -0.35f * scale;
|
||||||
float polyAdjY = Math.Clamp(meanSoleY - centerG.SurfaceY, minPolyAdj, 0.40f * scale);
|
float maxPolyAdj = !geom.IsArachnidUp ? 0.12f * scale : 0.40f * scale;
|
||||||
|
float polyAdjY = Math.Clamp(meanSoleY - centerG.SurfaceY, minPolyAdj, maxPolyAdj);
|
||||||
float diagSignX = (ws.Planted[0] && !ws.Planted[1]) ? +1f : ((!ws.Planted[0] && ws.Planted[1]) ? -1f : 0f);
|
float diagSignX = (ws.Planted[0] && !ws.Planted[1]) ? +1f : ((!ws.Planted[0] && ws.Planted[1]) ? -1f : 0f);
|
||||||
float latShiftX = diagSignX * 0.08f * scale * swingSin * Math.Clamp(horizSpeed / 6.0f, 0.25f, 1f);
|
float latShiftX = diagSignX * 0.08f * scale * swingSin * Math.Clamp(horizSpeed / 6.0f, 0.25f, 1f);
|
||||||
float baseLift = !geom.IsArachnidUp ? 0.02f * scale : 0.04f * scale;
|
float baseLift = !geom.IsArachnidUp ? 0.02f * scale : 0.04f * scale;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue