Class FloatRange

java.lang.Object
toxi.util.datatypes.FloatRange
Direct Known Subclasses:
BiasedFloatRange

public class FloatRange extends Object
  • Field Details

    • min

      public float min
    • max

      public float max
    • currValue

      public float currValue
  • Constructor Details

    • FloatRange

      public FloatRange()
    • FloatRange

      public FloatRange(float min, float max)
  • Method Details

    • fromSamples

      public static FloatRange fromSamples(float... samples)
    • fromSamples

      public static FloatRange fromSamples(List<Float> samples)
    • adjustCurrentBy

      public float adjustCurrentBy(float val)
    • copy

      public FloatRange copy()
    • getAt

      public final float getAt(float perc)
      Returns the value at the normalized position (0.0 = min ... 1.0 = max-EPS) within the range. Since the max value is exclusive, the value returned for position 1.0 is the range max value minus MathUtils.EPS. Also note the given position is not being clipped to the 0.0-1.0 interval, so when passing in values outside that interval will produce out-of-range values too.
      Parameters:
      perc -
      Returns:
      value within the range
    • getCurrent

      public float getCurrent()
    • getMedian

      public float getMedian()
    • getRange

      public float getRange()
    • isValueInRange

      public boolean isValueInRange(float val)
    • pickRandom

      public float pickRandom()
    • seed

      public FloatRange seed(long seed)
    • setCurrent

      public float setCurrent(float val)
    • setRandom

      public FloatRange setRandom(Random rnd)
    • toArray

      public Float[] toArray(float step)
    • toString

      public String toString()
      Overrides:
      toString in class Object