public class MathUtils
extends java.lang.Object
Constructor and Description |
---|
MathUtils() |
Modifier and Type | Method and Description |
---|---|
static float |
clamp(float value,
float min,
float max) |
static float |
map_number(float value,
float in_min,
float in_max,
float out_min,
float out_max)
Maps a given input number from a range to another one.
|
static float |
random_range(float min,
float max) |
public static float random_range(float min, float max)
public static float map_number(float value, float in_min, float in_max, float out_min, float out_max)
value
- The input number to mapin_min
- The input's minimum valuein_max
- The input's maximum valueout_min
- The outputs's minimum valueout_max
- The outputs's maximum valuepublic static float clamp(float value, float min, float max)