step method

void step(
  1. double dt
)

Advances the simulation by dt seconds in fixed-size steps, draining a clamped accumulator so the outcome is frame-rate independent.

Implementation

void step(double dt) {
  var frame = dt;
  if (frame < 0.0) frame = 0.0;
  if (frame > maxFrameTime) frame = maxFrameTime;
  _accumulator += frame;
  while (_accumulator >= fixedStep) {
    _stepFixed(fixedStep);
    _accumulator -= fixedStep;
  }
}