Improved character movement lag compensation
This commit is contained in:
@@ -910,6 +910,17 @@ namespace Barotrauma
|
||||
hand.body.SmoothRotate((ang2 + handAngle * Dir), 100.0f * force);
|
||||
}
|
||||
|
||||
public override Vector2 EstimateCurrPosition(Vector2 prevPosition, float timePassed)
|
||||
{
|
||||
timePassed = MathHelper.Clamp(timePassed, 0.0f, 1.0f);
|
||||
|
||||
Vector2 targetMovement = character.GetTargetMovement();
|
||||
|
||||
Vector2 currPosition = prevPosition + targetMovement * timePassed/1000.0f;
|
||||
|
||||
return currPosition;
|
||||
}
|
||||
|
||||
public override void Flip()
|
||||
{
|
||||
base.Flip();
|
||||
|
||||
Reference in New Issue
Block a user