Class SimplexNoise
java.lang.Object
de.arstwo.twotil.math.SimplexNoise
Implementation of SimplexNoise for 2D, 3D and 4D
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final short[]Class membersprotected final short[] -
Constructor Summary
ConstructorsConstructorDescriptionSimplexNoise(Random random) Creates a new SimplexNoise with the given Random generator. -
Method Summary
Modifier and TypeMethodDescriptiongenerateNoiseStretcher(double stretchX, double stretchZ) Generates a stretched 2D view of this noise with the given values.generateNoiseStretcher(double stretchX, double stretchY, double stretchZ) Generates a stretched 3D view of this noise with the given values.doublenoise(double xin, double yin) Noise value at a given 2D positiondoublenoise(double xin, double yin, double zin) Noise value at a given 3D positiondoublenoise(double x, double y, double z, double w) Noise value at a given 4D position
-
Field Details
-
doubledPermutationTable
protected final short[] doubledPermutationTableClass members -
variatedPermutationTable
protected final short[] variatedPermutationTable
-
-
Constructor Details
-
SimplexNoise
Creates a new SimplexNoise with the given Random generator.- Parameters:
random- any Random compatible generator
-
-
Method Details
-
generateNoiseStretcher
Generates a stretched 2D view of this noise with the given values.- Parameters:
stretchX- how much the x-axis is stretchedstretchZ- how much the z-axis is stretched- Returns:
- a NoiseStretch with the given configuration.
-
generateNoiseStretcher
Generates a stretched 3D view of this noise with the given values.- Parameters:
stretchX- how much the x-axis is stretchedstretchY- how much the y-axis is stretchedstretchZ- how much the z-axis is stretched- Returns:
- a NoiseStretch with the given configuration.
-
noise
public double noise(double xin, double yin) Noise value at a given 2D position- Parameters:
xin- any doubleyin- any double- Returns:
- the noise value at the given 2D position
-
noise
public double noise(double xin, double yin, double zin) Noise value at a given 3D position- Parameters:
xin- any doubleyin- any doublezin- any double- Returns:
- the noise value at the given 3D position
-
noise
public double noise(double x, double y, double z, double w) Noise value at a given 4D position- Parameters:
x- any doubley- any doublez- any doublew- any double- Returns:
- the noise value at the given 4D position
-