Moved TotalElapsedTime from GameMain to the Timing class

This commit is contained in:
Regalis
2017-05-03 19:15:43 +03:00
parent ba49f59204
commit 043c2fbc5e
5 changed files with 16 additions and 15 deletions

View File

@@ -11,6 +11,8 @@ namespace Barotrauma
{
private static double alpha;
public static double TotalTime;
public static double Accumulator;
public static double Step = 1.0 / 60.0;
@@ -30,6 +32,13 @@ namespace Barotrauma
return current * (float)alpha + previous * (1.0f - (float)alpha);
}
public static float InterpolateRotation(float previous, float current)
{
float angleDiff = MathUtils.GetShortestAngle(previous, current);
return previous + angleDiff * (float)alpha;
}
public static Vector2 Interpolate(Vector2 previous, Vector2 current)
{
return new Vector2(