Interface UpdateStrategy<T extends Time>

Type Parameters:
T - the update context type passed to modules
All Known Implementing Classes:
FixedTimestep, ManualUpdate, VariableTimestep
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface UpdateStrategy<T extends Time>
Strategy that determines when and how module updates are fired.

Given elapsed wall-clock time, the strategy computes zero or more update steps and invokes the callback for each step with an appropriate context value.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    advance(double elapsedSeconds, Consumer<T> onUpdate)
    Advances time by the given elapsed seconds and invokes onUpdate for each computed update step.
  • Method Details

    • advance

      void advance(double elapsedSeconds, Consumer<T> onUpdate)
      Advances time by the given elapsed seconds and invokes onUpdate for each computed update step.
      Parameters:
      elapsedSeconds - real wall-clock time elapsed since last advance
      onUpdate - callback invoked with the context for each update step