public DeltaTimer(ITimer timer, float timestep) { this.Timestep = timestep; this.timer = timer; this.timerFrequency = (float)timer.TicksPerSecond; this.lastTick = timer.CurrentTick(); this.accumilator = 0f; }
public void Update() { long currentTick = timer.CurrentTick(); float elapsed = (currentTick - lastTick) / timerFrequency; lastTick = currentTick; accumilator += elapsed; }