Because most noise modules will output values that range from -1.0
to +1.0
, this module first normalizes the output value (the range
becomes 0.0
to 1.0
), maps that value onto an exponential
curve, then rescales that value back to the original range.
- Source Modules
- This module requires one source module.
-
Field Summary
FieldsFields inherited from class org.spongepowered.noise.module.NoiseModule
sourceModule
-
Constructor Summary
ConstructorsConstructorDescriptionExponent()
Exponent
(NoiseModule source) Create a new Exponent module with the source modules pre-configured. -
Method Summary
Modifier and TypeMethodDescriptiondouble
exponent()
Get the exponent value to apply to the output value from the source module.double
get
(double x, double y, double z) Generates an output value given the coordinates of the specified input value.void
setExponent
(double exponent) Set the exponent value to apply to the output value from the source module.Methods inherited from class org.spongepowered.noise.module.NoiseModule
setSourceModule, sourceModule, sourceModuleCount
-
Field Details
-
DEFAULT_EXPONENT
public static final double DEFAULT_EXPONENTDefault exponent for thenoise module
.- See Also:
-
-
Constructor Details
-
Exponent
public Exponent() -
Exponent
Create a new Exponent module with the source modules pre-configured.- Parameters:
source
- the input module
-
-
Method Details
-
exponent
public double exponent()Get the exponent value to apply to the output value from the source module.Because most noise modules will output values that range from
-1.0
to+1.0
, this module first normalizes the output value (the range becomes0.0
to1.0
), maps that value onto an exponential curve, then rescales that value back to the original range.- Returns:
- the exponent value
-
setExponent
public void setExponent(double exponent) Set the exponent value to apply to the output value from the source module.Because most noise modules will output values that range from
-1.0
to+1.0
, this module first normalizes the output value (the range becomes0.0
to1.0
), maps that value onto an exponential curve, then rescales that value back to the original range.- Parameters:
exponent
- the exponent value
-
get
public double get(double x, double y, double z) Description copied from class:NoiseModule
Generates an output value given the coordinates of the specified input value.All source modules required by this module must have been connected with the
NoiseModule.setSourceModule(int, NoiseModule)
method. If these source modules are not connected, this method will throw aNoModuleException
.To determine the number of source modules required by this noise module, call the
NoiseModule.sourceModuleCount()
method.- Specified by:
get
in classNoiseModule
- Parameters:
x
- thex
coordinate of the input valuey
- they
coordinate of the input valuez
- thez
coordinate of the input value- Returns:
- the output value
-