Package com.ardor3d.math.functions
Class TurbulenceFunction3D
java.lang.Object
com.ardor3d.math.functions.TurbulenceFunction3D
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionTurbulenceFunction3D
(Function3D source, double power, int roughness, double frequency) Construct a new turbulence function with the given values. -
Method Summary
Modifier and TypeMethodDescriptiondouble
eval
(double x, double y, double z) double
getPower()
void
setFrequency
(double frequency) void
setPower
(double power) void
setRoughness
(int roughness) void
setSource
(Function3D source)
-
Constructor Details
-
TurbulenceFunction3D
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 interfaceFunction3D
- Parameters:
x
- the 1st value in our tupley
- the 2nd value in our tuplez
- 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
-
setSource
-
setRoughness
public void setRoughness(int roughness) -
setFrequency
public void setFrequency(double frequency)
-