public class LXUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LXUtils.LookupTable |
Modifier and Type | Method and Description |
---|---|
static double |
avg(double v1,
double v2) |
static float |
avgf(float v1,
float v2) |
static double |
clamp(double value,
double min,
double max) |
static int |
clamp(int value,
int min,
int max) |
static float |
clampf(float value,
float min,
float max) |
static double |
constrain(double value,
double min,
double max) |
static int |
constrain(int value,
int min,
int max) |
static float |
constrainf(float value,
float min,
float max) |
static float |
cosf(double radians)
Returns a floating-point rounded value of the cos function to 8 decimal places.
|
static double |
distance(double x1,
double y1,
double x2,
double y2) |
static double |
lerp(double v1,
double v2,
double amt) |
static float |
lerpf(float v1,
float v2,
float amt) |
static int |
lerpi(int v1,
int v2,
float amt) |
static double |
max(double a,
double b) |
static int |
max(int a,
int b) |
static float |
maxf(float a,
float b) |
static double |
min(double a,
double b) |
static int |
min(int a,
int b) |
static float |
minf(float a,
float b) |
static float |
noise(float x,
float y,
float z)
This function computes a random value at the coordinate (x,y,z).
|
static float |
noise(float x,
float y,
float z,
int seed)
This function computes a random value at the coordinate (x,y,z).
|
static float |
noiseFBM(float x,
float y,
float z,
float lacunarity,
float gain,
int octaves)
Common fractal noise functions are included, which produce
a wide variety of nice effects depending on the parameters
provided.
|
static float |
noiseRidge(float x,
float y,
float z,
float lacunarity,
float gain,
float offset,
int octaves)
Common fractal noise functions are included, which produce
a wide variety of nice effects depending on the parameters
provided.
|
static float |
noiseTurbulence(float x,
float y,
float z,
float lacunarity,
float gain,
int octaves)
Common fractal noise functions are included, which produce
a wide variety of nice effects depending on the parameters
provided.
|
static double |
random(double min,
double max) |
static float |
sinf(double radians)
Returns a floating-point rounded value of the sin function to 8 decimal places.
|
static double |
tri(double t) |
static float |
trif(float t) |
static double |
wrapdist(double v1,
double v2,
double modulus)
Computes the distance between v1 and v2 with a wrap-around at the modulus.
|
static float |
wrapdistf(float v1,
float v2,
float modulus) |
public static int min(int a, int b)
public static int max(int a, int b)
public static float minf(float a, float b)
public static float maxf(float a, float b)
public static double min(double a, double b)
public static double max(double a, double b)
public static double clamp(double value, double min, double max)
public static float clampf(float value, float min, float max)
public static int clamp(int value, int min, int max)
public static double constrain(double value, double min, double max)
public static float constrainf(float value, float min, float max)
public static int constrain(int value, int min, int max)
public static double random(double min, double max)
public static double distance(double x1, double y1, double x2, double y2)
public static double lerp(double v1, double v2, double amt)
public static float lerpf(float v1, float v2, float amt)
public static int lerpi(int v1, int v2, float amt)
public static double tri(double t)
public static float trif(float t)
public static double avg(double v1, double v2)
public static float avgf(float v1, float v2)
public static double wrapdist(double v1, double v2, double modulus)
v1
- First valuev2
- Second valuemodulus
- Modulus to wrap aroundpublic static float wrapdistf(float v1, float v2, float modulus)
public static float sinf(double radians)
radians
- Radians to take sin ofpublic static float cosf(double radians)
radians
- Radians to take cos ofpublic static float noise(float x, float y, float z)
x
- X coordinatey
- Y coordinatez
- Z coordinatepublic static float noise(float x, float y, float z, int seed)
x
- X coordinatey
- Y coordinatez
- Z coordinateseed
- Seedpublic static float noiseRidge(float x, float y, float z, float lacunarity, float gain, float offset, int octaves)
x
- X coordinatey
- Y coordinatez
- Z coordinatelacunarity
- spacing between successive octaves (use exactly 2.0 for wrapping output)gain
- relative weighting applied to each successive octaveoffset
- used to invert the ridges, may need to be larger, not sureoctaves
- number of "octaves" of noise3() to sumpublic static float noiseFBM(float x, float y, float z, float lacunarity, float gain, int octaves)
x
- X coordinatey
- Y coordinatez
- Z coordinatelacunarity
- spacing between successive octaves (use exactly 2.0 for wrapping output)gain
- relative weighting applied to each successive octaveoctaves
- number of "octaves" of noise3() to sumpublic static float noiseTurbulence(float x, float y, float z, float lacunarity, float gain, int octaves)
x
- X coordinatey
- Y coordinatez
- Z coordinatelacunarity
- spacing between successive octaves (use exactly 2.0 for wrapping output)gain
- relative weighting applied to each successive octaveoctaves
- number of "octaves" of noise3() to sumLX library by Mark C. Slee. © 2012-2020