Class SimplexNoiseField

java.lang.Object
com.hypixel.hytale.builtin.hytalegenerator.noise.NoiseField
com.hypixel.hytale.builtin.hytalegenerator.noise.SimplexNoiseField

public class SimplexNoiseField extends NoiseField
Generates Simplex noise with multiple octaves up to 4 dimensions. The result is normalized from -1 to 1.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimplexNoiseField(long seed, double octaveAmplitudeMultiplier, double octaveFrequencyMultiplier, int numberOfOctaves)
    Initializes an instance with a seed, an octave amplitude multiplier, an octave frequency multiplier and a set number of octaves to initialize.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    long
    Returns the seed used by this generator.
    double
    valueAt(double x)
    Calculates the 1D normalized value at the provided coordinates.
    double
    valueAt(double x, double y)
    Calculates the 2D normalized value at the provided coordinates.
    double
    valueAt(double x, double y, double z)
    Calculates the 3D normalized value at the provided coordinates.
    double
    valueAt(double x, double y, double z, double w)
    Calculates the 4D normalized value at the provided coordinates.

    Methods inherited from class NoiseField

    setScale, setScale

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimplexNoiseField

      public SimplexNoiseField(long seed, double octaveAmplitudeMultiplier, double octaveFrequencyMultiplier, int numberOfOctaves)
      Initializes an instance with a seed, an octave amplitude multiplier, an octave frequency multiplier and a set number of octaves to initialize. The octave amplitude and frequency multipliers are applied to the amplitude of each consecutive octave based on the previous octave's value. The more octaves means more noise and randomness.

      A frequency of: 1 all octaves have frequency 1 0..1 consecutive octaves have smaller frequency values hence larger noise 1... consecutive octaves have larger frequency values hence smaller noise

      An amplitude of: 1 all octaves have amplitude 1 0..1 consecutive octaves have less impact on the value 1... consecutive octaves have more impact on the value

      Parameters:
      seed - determines the uniqueness of the values
      octaveAmplitudeMultiplier - amplitude multiplier
      octaveFrequencyMultiplier - frequency multiplier
      numberOfOctaves - that generate noise value
  • Method Details

    • builder

      @Nonnull public static SimplexNoiseField.Builder builder()
    • valueAt

      public double valueAt(double x, double y, double z, double w)
      Calculates the 4D normalized value at the provided coordinates.
      Specified by:
      valueAt in class NoiseField
    • valueAt

      public double valueAt(double x, double y, double z)
      Calculates the 3D normalized value at the provided coordinates.
      Specified by:
      valueAt in class NoiseField
    • valueAt

      public double valueAt(double x, double y)
      Calculates the 2D normalized value at the provided coordinates.
      Specified by:
      valueAt in class NoiseField
    • valueAt

      public double valueAt(double x)
      Calculates the 1D normalized value at the provided coordinates.
      Specified by:
      valueAt in class NoiseField
    • getSeed

      public long getSeed()
      Returns the seed used by this generator.