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

            lastTick = currentTick;

            accumilator += elapsed;
        }