java.lang.Object
org.spongepowered.noise.module.NoiseModule
org.spongepowered.noise.module.modifier.RotatePoint

public class RotatePoint extends NoiseModule
Noise module that rotates the input value around the origin before returning the output value from a source module.

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

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Default x rotation angle for the RotatePoint noise module.
    static final double
    Default y rotation angle for the RotatePoint noise module.
    static final double
    Default z rotation angle for the RotatePoint noise module.

    Fields inherited from class org.spongepowered.noise.module.NoiseModule

    sourceModule
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Create a new RotatePoint module with the source modules pre-configured.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    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 the x axis to apply to the input value.
    void
    setYAngle(double yAngle)
    Set the rotation angle around the y axis to apply to the input value.
    void
    setZAngle(double zAngle)
    Set the rotation angle around the z axis to apply to the input value.
    double
    Get the rotation angle around the x axis to apply to the input value.
    double
    Get the rotation angle around the y axis to apply to the input value.
    double
    Get the rotation angle around the z axis to apply to the input value.

    Methods inherited from class org.spongepowered.noise.module.NoiseModule

    setSourceModule, sourceModule, sourceModuleCount

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RotatePoint

      public RotatePoint()
    • RotatePoint

      public RotatePoint(NoiseModule source)
      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 the x axis, in degrees
      y - the rotation angle around the y axis, in degrees
      z - the rotation angle around the z axis, in degrees
    • xAngle

      public double xAngle()
      Get the rotation angle around the x 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 the x 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 the x axis, in degrees.
    • yAngle

      public double yAngle()
      Get the rotation angle around the y 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 the y 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 the y axis, in degrees.
    • zAngle

      public double zAngle()
      Get the rotation angle around the z 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 the z 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 the z 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 a NoModuleException.

      To determine the number of source modules required by this noise module, call the NoiseModule.sourceModuleCount() method.

      Specified by:
      get in class NoiseModule
      Parameters:
      x - the x coordinate of the input value
      y - the y coordinate of the input value
      z - the z coordinate of the input value
      Returns:
      the output value