|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.math.MathUtils
public class MathUtils
Utility and fast math functions.
Thanks to Riven on JavaGaming.org for sin/cos/atan2/floor/ceil.
Field Summary | |
---|---|
static float[] |
cos
|
static float |
degreesToRadians
|
static float |
PI
|
static float |
radiansToDegrees
|
static java.util.Random |
random
|
static float[] |
sin
|
Constructor Summary | |
---|---|
MathUtils()
|
Method Summary | |
---|---|
static float |
atan2(float y,
float x)
|
static int |
ceil(float x)
Returns the smallest integer greater than or equal to the specified float. |
static int |
ceilPositive(float x)
Returns the smallest integer greater than or equal to the specified float. |
static float |
cos(float rad)
|
static float |
cosDeg(float deg)
|
static int |
floor(float x)
Returns the largest integer less than or equal to the specified float. |
static int |
floorPositive(float x)
Returns the largest integer less than or equal to the specified float. |
static boolean |
isPowerOfTwo(int value)
|
static int |
nextPowerOfTwo(int value)
|
static float |
random()
|
static float |
random(float range)
|
static float |
random(float start,
float end)
|
static int |
random(int range)
Returns a random number between 0 (inclusive) and the specified value (inclusive). |
static int |
random(int start,
int end)
|
static boolean |
randomBoolean()
|
static int |
round(float x)
Returns the closest integer to the specified float. |
static int |
roundPositive(float x)
Returns the closest integer to the specified float. |
static float |
sin(float rad)
|
static float |
sinDeg(float deg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float PI
public static final float radiansToDegrees
public static final float degreesToRadians
public static final float[] sin
public static final float[] cos
public static java.util.Random random
Constructor Detail |
---|
public MathUtils()
Method Detail |
---|
public static final float sin(float rad)
public static final float cos(float rad)
public static final float sinDeg(float deg)
public static final float cosDeg(float deg)
public static final float atan2(float y, float x)
public static final int random(int range)
public static final int random(int start, int end)
public static final boolean randomBoolean()
public static final float random()
public static final float random(float range)
public static final float random(float start, float end)
public static int nextPowerOfTwo(int value)
public static boolean isPowerOfTwo(int value)
public static int floor(float x)
public static int floorPositive(float x)
public static int ceil(float x)
public static int ceilPositive(float x)
public static int round(float x)
public static int roundPositive(float x)
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |