frameStart method
Starts a frame and returns its scaled delta.
Implementation
double frameStart(Duration elapsed, double deltaSeconds) {
// Advance the profiler frame counter (if profiling is enabled) at the one
// per-frame boundary, so timings can be attributed to a frame number.
app.profiler?.beginFrame();
final world = app.world;
final clock = world.clock;
// Apply a partial freeze to its full frame.
final scaledDelta = deltaSeconds * clock.effectiveScale;
clock.advanceFreeze(deltaSeconds);
world.frameTime
..delta = scaledDelta
..unscaledDelta = deltaSeconds
..elapsed = elapsed
..frame += 1;
_latch.advanceFrame(deltaSeconds);
app.runSchedule(Schedules.frameStart);
app.applyStateTransitions();
onCommandBoundary?.call();
app.updateEvents();
return scaledDelta;
}