Improved character movement lag compensation

This commit is contained in:
Regalis
2015-11-03 18:15:12 +02:00
parent 2a8939f6dc
commit 963f46e7d1
8 changed files with 46 additions and 26 deletions

View File

@@ -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();