Class SmoothNoise

java.lang.Object
de.cheaterpaul.fallingleaves.math.SmoothNoise

public class SmoothNoise extends Object
  • Field Details

    • tickInterval

      protected final int tickInterval
    • nextNoise

      protected final FloatFunction nextNoise
    • leftNoise

      protected float leftNoise
    • rightNoise

      protected float rightNoise
    • ticks

      protected int ticks
    • t

      protected float t
  • Constructor Details

    • SmoothNoise

      public SmoothNoise(int tickInterval, float initial, @Nonnull FloatFunction nextNoise)
  • Method Details

    • smoothstep

      public static float smoothstep(float t)
      Smoothly goes from 0 to 1 when t increases from 0 and 1. Defined for t in [0, 1].
    • tick

      public void tick()
    • getLeftNoise

      public float getLeftNoise()
    • getRightNoise

      public float getRightNoise()
    • getLerp

      public float getLerp()
      Linear interpolation between left and right noise values
    • getNoise

      public float getNoise()
      Smooth interpolation between left and right noise values