The get(double, double, double)
method rotates the
coordinates of the input value around the origin before returning the output
value from the source module. To set the rotation angles,
call the setAngles(double, double, double)
method. To set the
rotation angle around the individual x
, y
, or z
axes,
call the setXAngle(double)
, setYAngle(double)
,
or setZAngle(double)
methods, respectively.
The coordinate system of the input value is assumed to be "left-handed"
(x
increases to the right, y
increases upwards,
and z
increases inward).
- Source Modules
- This module requires one source module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Defaultx
rotation angle for theRotatePoint
noise module.static final double
Defaulty
rotation angle for theRotatePoint
noise module.static final double
Defaultz
rotation angle for theRotatePoint
noise module.Fields inherited from class org.spongepowered.noise.module.NoiseModule
sourceModule
-
Constructor Summary
ConstructorsConstructorDescriptionRotatePoint
(NoiseModule source) Create a new RotatePoint module with the source modules pre-configured. -
Method Summary
Modifier and TypeMethodDescriptiondouble
get
(double x, double y, double z) Generates an output value given the coordinates of the specified input value.void
setAngles
(double x, double y, double z) Sets the rotation angles around all three axes to apply to the input value.void
setXAngle
(double xAngle) Set the rotation angle around thex
axis to apply to the input value.void
setYAngle
(double yAngle) Set the rotation angle around they
axis to apply to the input value.void
setZAngle
(double zAngle) Set the rotation angle around thez
axis to apply to the input value.double
xAngle()
Get the rotation angle around thex
axis to apply to the input value.double
yAngle()
Get the rotation angle around they
axis to apply to the input value.double
zAngle()
Get the rotation angle around thez
axis to apply to the input value.Methods inherited from class org.spongepowered.noise.module.NoiseModule
setSourceModule, sourceModule, sourceModuleCount
-
Field Details
-
DEFAULT_ROTATE_X
public static final double DEFAULT_ROTATE_XDefaultx
rotation angle for theRotatePoint
noise module.- See Also:
-
DEFAULT_ROTATE_Y
public static final double DEFAULT_ROTATE_YDefaulty
rotation angle for theRotatePoint
noise module.- See Also:
-
DEFAULT_ROTATE_Z
public static final double DEFAULT_ROTATE_ZDefaultz
rotation angle for theRotatePoint
noise module.- See Also:
-
-
Constructor Details
-
RotatePoint
public RotatePoint() -
RotatePoint
Create a new RotatePoint module with the source modules pre-configured.- Parameters:
source
- the input module
-
-
Method Details
-
setAngles
public void setAngles(double x, double y, double z) Sets the rotation angles around all three axes to apply to the input value.The
get(double, double, double)
method rotates the coordinates of the input value around the origin before returning the output value from the source module.- Parameters:
x
- the rotation angle around thex
axis, in degreesy
- the rotation angle around they
axis, in degreesz
- the rotation angle around thez
axis, in degrees
-
xAngle
public double xAngle()Get the rotation angle around thex
axis to apply to the input value.- Returns:
- the rotation angle around the
x
axis, in degrees. - See Also:
-
setXAngle
public void setXAngle(double xAngle) Set the rotation angle around thex
axis to apply to the input value.The
get(double, double, double)
method rotates the coordinates of the input value around the origin before returning the output value from the source module.- Parameters:
xAngle
- the rotation angle around thex
axis, in degrees.
-
yAngle
public double yAngle()Get the rotation angle around they
axis to apply to the input value.- Returns:
- the rotation angle around the
y
axis, in degrees. - See Also:
-
setYAngle
public void setYAngle(double yAngle) Set the rotation angle around they
axis to apply to the input value.The
get(double, double, double)
method rotates the coordinates of the input value around the origin before returning the output value from the source module.- Parameters:
yAngle
- the rotation angle around they
axis, in degrees.
-
zAngle
public double zAngle()Get the rotation angle around thez
axis to apply to the input value.- Returns:
- the rotation angle around the
z
axis, in degrees. - See Also:
-
setZAngle
public void setZAngle(double zAngle) Set the rotation angle around thez
axis to apply to the input value.The
get(double, double, double)
method rotates the coordinates of the input value around the origin before returning the output value from the source module.- Parameters:
zAngle
- the rotation angle around thez
axis, in degrees.
-
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
-