Package com.ardor3d.math.functions
Class VoroniFunction3D
java.lang.Object
com.ardor3d.math.functions.VoroniFunction3D
- All Implemented Interfaces:
Function3D
Function that produces a Voronoi graph by placing a random
point in every 1x1x1 unit cube in space and then finding the closest of these points at each eval location.
-
Constructor Summary
ConstructorDescriptionConstruct with default values.VoroniFunction3D
(double frequency, double displacement, boolean useDistance, int seed) Construct a new Voronoi graph function. -
Method Summary
Modifier and TypeMethodDescriptiondouble
eval
(double x, double y, double z) double
double
int
getSeed()
boolean
void
setDisplacement
(double displacement) void
setFrequency
(double frequency) void
setSeed
(int seed) void
setUseDistance
(boolean useDistance)
-
Constructor Details
-
VoroniFunction3D
public VoroniFunction3D()Construct with default values. -
VoroniFunction3D
public VoroniFunction3D(double frequency, double displacement, boolean useDistance, int seed) Construct a new Voronoi graph function.- Parameters:
frequency
- used to modulate input coordinatesdisplacement
- use to modulate the contribution of the random points in each unit cube.useDistance
- if true, we will add the distance from the closest point to our output, giving us variation across the cell.seed
- the random seed value to give to our integer random function.
-
-
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]
-
getFrequency
public double getFrequency() -
setFrequency
public void setFrequency(double frequency) -
isUseDistance
public boolean isUseDistance() -
setUseDistance
public void setUseDistance(boolean useDistance) -
getDisplacement
public double getDisplacement() -
setDisplacement
public void setDisplacement(double displacement) -
getSeed
public int getSeed() -
setSeed
public void setSeed(int seed)
-