|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnodebox.graphics.MathUtils
public final class MathUtils
| Method Summary | |
|---|---|
static double |
clamp(double v)
Clamps the value so the result is between 0.0 and 1.0. |
static double |
clamp(double v,
double min,
double max)
Clamps the value so the result is between the given minimum and maximum value. |
static float |
clamp(float v)
Clamps the value so the result is between 0.0 and 1.0. |
static float |
clamp(float v,
float min,
float max)
Clamps the value so the result is between the given minimum and maximum value. |
static Random |
randomFromSeed(long seed)
|
static double |
snap(double v,
double distance,
double strength)
Round a value to the nearest "step". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static float clamp(float v)
v - the value to clamp
public static double clamp(double v)
v - the value to clamp
public static float clamp(float v,
float min,
float max)
v - the value to clampmin - the minimum valuemax - the maximum value
public static double clamp(double v,
double min,
double max)
v - the value to clampmin - the minimum valuemax - the maximum value
public static double snap(double v,
double distance,
double strength)
v - The value to snap.distance - The distance between steps.strength - The strength of rounding. If 1 the values will always be on a step. If zero, the value is unchanged.
public static Random randomFromSeed(long seed)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||