Package de.arstwo.twotil.math
Class NoiseStretch
java.lang.Object
de.arstwo.twotil.math.NoiseStretch
A helper class that stretches a given SimplexNoise on 2 or 3 axis.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SimplexNoiseprotected final doubleprotected final doubleprotected final double -
Constructor Summary
ConstructorsConstructorDescriptionNoiseStretch(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
-
Field Details
-
stretchX
protected final double stretchX -
stretchY
protected final double stretchY -
stretchZ
protected final double stretchZ -
noise
-
-
Constructor Details
-
NoiseStretch
Creates a new 2D NoiseStretch with the given values.- Parameters:
noise- the noise to usestretchX- how much the noise will be stretched on the x axisstretchZ- how much the noise will be stretched on the z axis
-
NoiseStretch
Creates a new 3D NoiseStretch with the given values.- Parameters:
noise- the noise to usestretchX- how much the noise will be stretched on the x axisstretchY- how much the noise will be stretched on the y axisstretchZ- 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 positionz- 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 positiony- y value of the positionz- z value of the position- Returns:
- the stretched noise value at the given 3D position
-