Class NoiseStretch

java.lang.Object
de.arstwo.twotil.math.NoiseStretch

public class NoiseStretch extends Object
A helper class that stretches a given SimplexNoise on 2 or 3 axis.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final SimplexNoise
     
    protected final double
     
    protected final double
     
    protected final double
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    NoiseStretch(SimplexNoise noise, double stretchX, double stretchZ)
    Creates a new 2D NoiseStretch with the given values.
    NoiseStretch(SimplexNoise noise, double stretchX, double stretchY, double stretchZ)
    Creates a new 3D NoiseStretch with the given values.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    getNoise(double x, double z)
    Gets the specific stretched noise value at a given 2D position
    double
    getNoise(double x, double y, double z)
    Gets the specific stretched noise value at a given 3D position

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • stretchX

      protected final double stretchX
    • stretchY

      protected final double stretchY
    • stretchZ

      protected final double stretchZ
    • noise

      protected final SimplexNoise noise
  • Constructor Details

    • NoiseStretch

      public NoiseStretch(SimplexNoise noise, double stretchX, double stretchZ)
      Creates a new 2D NoiseStretch with the given values.
      Parameters:
      noise - the noise to use
      stretchX - how much the noise will be stretched on the x axis
      stretchZ - how much the noise will be stretched on the z axis
    • NoiseStretch

      public NoiseStretch(SimplexNoise noise, double stretchX, double stretchY, double stretchZ)
      Creates a new 3D NoiseStretch with the given values.
      Parameters:
      noise - the noise to use
      stretchX - how much the noise will be stretched on the x axis
      stretchY - how much the noise will be stretched on the y axis
      stretchZ - how much the noise will be stretched on the z axis
  • Method Details

    • getNoise

      public double getNoise(double x, double z)
      Gets the specific stretched noise value at a given 2D position
      Parameters:
      x - x value of the position
      z - z value of the position
      Returns:
      the stretched noise value at the given 2D position
    • getNoise

      public double getNoise(double x, double y, double z)
      Gets the specific stretched noise value at a given 3D position
      Parameters:
      x - x value of the position
      y - y value of the position
      z - z value of the position
      Returns:
      the stretched noise value at the given 3D position