Class VariableTimestep<T extends Time>

java.lang.Object
dev.engine.core.module.VariableTimestep<T>
Type Parameters:
T - the update context type passed to modules
All Implemented Interfaces:
UpdateStrategy<T>

public class VariableTimestep<T extends Time> extends Object implements UpdateStrategy<T>
Variable timestep UpdateStrategy that fires exactly one update per advance call.

The actual elapsed time (clamped to zero if negative) is passed to the context factory and forwarded to the update callback.

  • Constructor Details

  • Method Details

    • advance

      public void advance(double elapsedSeconds, Consumer<T> onUpdate)
      Description copied from interface: UpdateStrategy
      Advances time by the given elapsed seconds and invokes onUpdate for each computed update step.
      Specified by:
      advance in interface UpdateStrategy<T extends Time>
      Parameters:
      elapsedSeconds - real wall-clock time elapsed since last advance
      onUpdate - callback invoked with the context for each update step