Class TurbulenceFunction3D

java.lang.Object
com.ardor3d.math.functions.TurbulenceFunction3D
All Implemented Interfaces:
Function3D

public class TurbulenceFunction3D extends Object implements Function3D
Function that uses a fBm function to distort incoming coordinates on each of the 3 axis before feeding them to a source function for evaluation. The amount of distortion depends on the given power, roughness and frequency.
  • Constructor Details

    • TurbulenceFunction3D

      public TurbulenceFunction3D(Function3D source, double power, int roughness, double frequency)
      Construct a new turbulence function with the given values.
      Parameters:
      source - the source function to send our distorted coordinates to.
      power - a scalar that controls how much the distortion is applied to the input coordinates. 0 == no distortion.
      roughness - how "choppy" the distortion is. Lower values produce more gradual shifts in distortion whereas higher values produce more choppy transitions.
      frequency - how rapidly the distortion value changes.
  • Method Details

    • eval

      public double eval(double x, double y, double z)
      Specified by:
      eval in interface Function3D
      Parameters:
      x - the 1st value in our tuple
      y - the 2nd value in our tuple
      z - the 3rd value in our tuple
      Returns:
      some value, generally (but not necessarily) in [-1, 1]
    • getPower

      public double getPower()
    • setPower

      public void setPower(double power)
    • getSource

      public Function3D getSource()
    • setSource

      public void setSource(Function3D source)
    • setRoughness

      public void setRoughness(int roughness)
    • setFrequency

      public void setFrequency(double frequency)