Class FrameClock

java.lang.Object
com.victorvalentim.zividomelive.FrameClock

public final class FrameClock extends Object
Monotonic, frame-oriented clock owned by a SceneServices activation.

The runtime ticks this clock once before Scene.update(). Large stalls are clamped so a paused debugger, window move, or transient hitch cannot inject an unbounded simulation delta.

The clock reports double seconds and is read-only except for the artist-selected delta clamp. Construction, ticking, and reset belong to the runtime.

API stability: Advanced Stable.

Since:
2.0.0
  • Method Details

    • setMaxDeltaSeconds

      public void setMaxDeltaSeconds(double maxDeltaSeconds)
      Sets the maximum delta accepted from one frame.
      Parameters:
      maxDeltaSeconds - finite positive clamp in seconds
    • getDeltaSeconds

      public double getDeltaSeconds()
      Returns:
      clamped delta from the latest Processing frame boundary, in seconds
    • getElapsedSeconds

      public double getElapsedSeconds()
      Returns:
      monotonic sum of accepted, clamped frame deltas, in seconds
    • getMaxDeltaSeconds

      public double getMaxDeltaSeconds()
      Returns:
      configured per-frame delta clamp in seconds
    • getFrameIndex

      public long getFrameIndex()
      Returns:
      one-based frame count after the first runtime tick