The get(double, double, double)
method retrieves the output
value from the source module, multiplies it with a scaling factor, adds a
bias to it, then outputs the value.
- Source Modules
- This module requires one source module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Default bias for theScaleBias
noise module.static final double
Default scale for theScaleBias
noise module.Fields inherited from class org.spongepowered.noise.module.NoiseModule
sourceModule
-
Constructor Summary
ConstructorsConstructorDescriptionScaleBias
(NoiseModule source) Create a new ScaleBias module with the source modules pre-configured. -
Method Summary
Modifier and TypeMethodDescriptiondouble
bias()
Get the bias to apply to the scaled 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.double
scale()
Get the scaling factor to apply to the output value from the source module.void
setBias
(double bias) Set the bias to apply to the scaled output value from the source module.void
setScale
(double scale) Set the scaling factor to apply to the output value from the source module.Methods inherited from class org.spongepowered.noise.module.NoiseModule
setSourceModule, sourceModule, sourceModuleCount
-
Field Details
-
Constructor Details
-
ScaleBias
public ScaleBias() -
ScaleBias
Create a new ScaleBias module with the source modules pre-configured.- Parameters:
source
- the input module
-
-
Method Details
-
bias
public double bias()Get the bias to apply to the scaled output value from the source module.The
get(double, double, double)
method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.- Returns:
- the bias to apply
-
setBias
public void setBias(double bias) Set the bias to apply to the scaled output value from the source module.The
get(double, double, double)
method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.- Parameters:
bias
- the bias to apply
-
scale
public double scale()Get the scaling factor to apply to the output value from the source module.The
get(double, double, double)
method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.- Returns:
- the scaling factor to apply
-
setScale
public void setScale(double scale) Set the scaling factor to apply to the output value from the source module.The
get(double, double, double)
method retrieves the output value from the source module, multiplies it with a scaling factor, adds a bias to it, then outputs the value.- Parameters:
scale
- the scaling factor to apply
-
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
-