Add controllable lab walking checkpoint with collision and chase camera
This commit is contained in:
1 parent
37fa18094f
commit
58424120bb
26 files changed
+1848
-110
No files matched your search
@@ -0,0 +1,17 @@
|
||||
namespace GamePort.Game;
|
||||
|
||||
/// <summary>Explicit port policy: 60 simulation calls/second, independent of presentation.</summary>
|
||||
public sealed class FixedStepClock
|
||||
{
|
||||
public const float Step = 1f / 60;
|
||||
private double accumulated;
|
||||
public int Advance(double elapsed)
|
||||
{
|
||||
if (!double.IsFinite(elapsed) || elapsed < 0) throw new ArgumentOutOfRangeException(nameof(elapsed));
|
||||
accumulated += Math.Min(elapsed, 0.25);
|
||||
var steps = (int)Math.Floor((accumulated + 1e-10) * 60);
|
||||
accumulated -= steps / 60.0;
|
||||
return steps;
|
||||
}
|
||||
public void Reset() => accumulated = 0;
|
||||
}
|
||||
Reference in new issue
Block a user