SimplexNoise
A class in Root.Township, the global namespace.
Simplex noise in 2, 3 or 4 dimensions, with per-instance offsets added to the inputs.
- Listed in Global namespace: S
- Nested types
Grad
Constructors
| Member | What it is |
|---|---|
SimplexNoise(double offsetX, double offsetY, double offsetZ, double offsetW) | Creates a SimplexNoise from offsetX, offsetY, offsetZ and offsetW. |
Fields
15 private and internal fields
| Member | What it is |
|---|---|
private static double F2 | 2D skew factor for simplex noise. |
private static double F3 | 3D skew factor. |
private static double F4 | 4D skew factor. |
private static double G2 | 2D unskew factor. |
private static double G3 | 3D unskew factor. |
private static double G4 | 4D unskew factor. |
private static SimplexNoise.Grad[] grad3 | The 12 gradient directions for 2D and 3D noise. |
private static SimplexNoise.Grad[] grad4 | The 32 gradient directions for 4D noise. |
private double offsetW | Added to the w input, so noise objects with different offsets give different patterns. |
private double offsetX | Added to the x input. |
private double offsetY | Added to the y input. |
private double offsetZ | Added to the z input. |
private static short[] p | The fixed 256-entry permutation table. All instances share it, so the offsets are the only seed. |
private short[] perm | p doubled to 512 entries to avoid wrapping. |
private short[] permMod12 | perm values mod 12, to index grad3. |
Methods
4 private and internal methods
| Member | What it is |
|---|---|
private static double dot(SimplexNoise.Grad g, double x, double y) | Dot product of a gradient with a 2D, 3D or 4D offset. |
private static double dot(SimplexNoise.Grad g, double x, double y, double z) | Dot product of a gradient with a 2D, 3D or 4D offset. |
private static double dot(SimplexNoise.Grad g, double x, double y, double z, double w) | Dot product of a gradient with a 2D, 3D or 4D offset. |
private static int fastfloor(double x) | Floor of a double as an int, faster than Math.Floor. |
Used in
Members of other types that take, return or hold a SimplexNoise: