Class Accumulator

All Implemented Interfaces:
LXComponent.Renamable, LXLoopTask, LXPath, LXSerializable, LXParameter, LXParameterListener

public class Accumulator extends LXModulator
An accumulator oscillates between increasing and decreasing value by some velocity such that it never overflows or stops moving outside of the floating point range. If it hits the extremes of the floating point range then it reverses direction and keeps going. This is useful in extremely long-running programs that wish to seed a value for something like a noise function, without discontinuity.
  • Constructor Details

    • Accumulator

      public Accumulator()
    • Accumulator

      public Accumulator(double velocity)
    • Accumulator

      public Accumulator(LXParameter velocity)
    • Accumulator

      public Accumulator(String label)
    • Accumulator

      public Accumulator(String label, double velocity)
    • Accumulator

      public Accumulator(String label, LXParameter velocity)
  • Method Details

    • computeValue

      protected double computeValue(double deltaMs)
      Description copied from class: LXModulator
      Implementation method to advance the modulator's internal state. Subclasses must provide and update value appropriately.
      Specified by:
      computeValue in class LXModulator
      Parameters:
      deltaMs - Number of milliseconds to advance by
      Returns:
      Computed value