java.lang.Object
org.spongepowered.noise.module.NoiseModule
org.spongepowered.noise.module.modifier.Range
A modifier module to map a value from one range to another.
For example: 0.5 (-1 < x < 1) -> 0.75 (0 < x < 1)
- Source Modules
- This module requires one source module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
static final double
static final double
static final double
Fields inherited from class org.spongepowered.noise.module.NoiseModule
sourceModule
-
Constructor Summary
ConstructorsConstructorDescriptionRange()
Range
(NoiseModule source) Create a new Range module with the source modules pre-configured. -
Method Summary
Modifier and TypeMethodDescriptiondouble
double
double
get
(double x, double y, double z) Generates an output value given the coordinates of the specified input value.double
double
void
setBounds
(double currentLower, double currentUpper, double newLower, double newUpper) Configure bounds for range moduleMethods inherited from class org.spongepowered.noise.module.NoiseModule
setSourceModule, sourceModule, sourceModuleCount
-
Field Details
-
DEFAULT_CURRENT_LOWER_BOUND
public static final double DEFAULT_CURRENT_LOWER_BOUND- See Also:
-
DEFAULT_CURRENT_UPPER_BOUND
public static final double DEFAULT_CURRENT_UPPER_BOUND- See Also:
-
DEFAULT_NEW_LOWER_BOUND
public static final double DEFAULT_NEW_LOWER_BOUND- See Also:
-
DEFAULT_NEW_UPPER_BOUND
public static final double DEFAULT_NEW_UPPER_BOUND- See Also:
-
-
Constructor Details
-
Range
public Range() -
Range
Create a new Range module with the source modules pre-configured.- Parameters:
source
- the input module
-
-
Method Details
-
currentLowerBound
public double currentLowerBound() -
currentUpperBound
public double currentUpperBound() -
newLowerBound
public double newLowerBound() -
newUpperBound
public double newUpperBound() -
setBounds
public void setBounds(double currentLower, double currentUpper, double newLower, double newUpper) Configure bounds for range module- Parameters:
currentLower
- current lower boundcurrentUpper
- current upper boundnewLower
- new lower boundnewUpper
- new upper bound
-
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
-