Class SeededNoise

java.lang.Object
squidpony.squidmath.SeededNoise
All Implemented Interfaces:
Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise6D
Direct Known Subclasses:
WhirlingNoise

public class SeededNoise
extends Object
implements Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise6D
More advanced noise functions, in 2D, 3D, 4D, and 6D, with the last two as options for generating seamlessly-tiling noise using Noise.seamless2D(double[][], long, int, Noise.Noise4D) and/or Noise.seamless3D(double[][][], long, int, Noise.Noise6D). All functions can take a long seed that should significantly change the pattern of noise produced. Incorporates code from Joise; the full library is available at https://github.com/SudoPlayGames/Joise , and this class adds rather significant optimization in a few methods, especially 6D noise. Joise is derived from the Accidental Noise Library, available in C++ at http://accidentalnoise.sourceforge.net/index.html . Both Joise and ANL have many features that SquidLib has not (yet) incorporated, but now that SquidLib has seamless noise, that's a nice feature that would have needed Joise before.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected long defaultSeed  
    protected static double F2  
    protected static double F3  
    protected static double F4  
    protected static double F6  
    protected static double G2  
    protected static double G3  
    protected static double G4  
    protected static double G6  
    protected static float[] grad3d  
    protected static double[] grad4d  
    protected static double[] gradient6DLUT  
    static SeededNoise instance  
    protected static double LIMIT4  
    protected static double LIMIT6  
    static double[][] phiGrad2
    256 2-element gradient vectors formed from the cos and sin of increasing multiples of the inverse of phi, the golden ratio, while also adding increasing multiples of 2/3 of the reciprocal of Math.E.
    protected static int[] SIMPLEX_4D
    Used by noise(double, double, double, double, long) to look up the vertices of the 4D triangle analogue.
  • Constructor Summary

    Constructors 
    Constructor Description
    SeededNoise()  
    SeededNoise​(long seed)  
  • Method Summary

    Modifier and Type Method Description
    double getNoise​(double x, double y)  
    double getNoise​(double x, double y, double z)  
    double getNoise​(double x, double y, double z, double w)  
    double getNoise​(double x, double y, double z, double w, double u, double v)  
    double getNoiseWithSeed​(double x, double y, double z, double w, double u, double v, long seed)  
    double getNoiseWithSeed​(double x, double y, double z, double w, long seed)  
    double getNoiseWithSeed​(double x, double y, double z, long seed)  
    double getNoiseWithSeed​(double x, double y, long seed)  
    protected static double gradCoord3D​(long seed, int x, int y, int z, double xd, double yd, double zd)
    Computes the hash for a 3D int point and its dot product with a 3D double point as one step.
    static double noise​(double x, double y, double z, double w, double u, double v, long seed)  
    static double noise​(double x, double y, double z, double w, long seed)  
    static double noise​(double x, double y, double z, long seed)  
    static double noise​(double x, double y, long seed)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait