public final class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static double[] |
RANDOM_VECTORS
A table of 256 random normalized vectors.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
clamp(int value,
int low,
int high)
Clamps the value between the low and high boundaries
|
static double |
cubicInterp(double n0,
double n1,
double n2,
double n3,
double a)
Performs cubic interpolation between two values bound between two other values
|
static int |
floor(double x)
Rounds x down to the closest integer
|
static double[] |
latLonToXYZ(double latitude,
double longitude) |
static double |
linearInterp(double n0,
double n1,
double a)
Performs linear interpolation between two values
|
static double |
makeInt32Range(double n)
Modifies a floating-point value so that it can be stored in a noise::int32 variable.
|
static double |
sCurve3(double a)
Maps a value onto a cubic S-Curve
|
static double |
sCurve5(double a)
maps a value onto a quitnic S-Curve
|
public static final double[] RANDOM_VECTORS
public static double cubicInterp(double n0,
double n1,
double n2,
double n3,
double a)
n0 - the value before the first valuen1 - the first valuen2 - the second valuen3 - the value after the second valuea - the alpha valuepublic static double linearInterp(double n0,
double n1,
double a)
n0 - first valuen1 - second valuea - the alpha value. Should be between 0 and 1.public static double sCurve3(double a)
a - the value to map onto a S-Curvepublic static double sCurve5(double a)
a - the value to map onto a quitic S-curvepublic static double[] latLonToXYZ(double latitude,
double longitude)
public static double makeInt32Range(double n)
n - A floating-point number.public static int clamp(int value,
int low,
int high)
value - The value to clamplow - The low bound of the clamphigh - The high bound of the clamppublic static int floor(double x)
x - The value to floorCopyright © 2013–2017 Flow Powered. All rights reserved.