|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.math.FastMath
FastMath provides 'fast' math approximations and float equivalents of Math
functions. These are all used as static values and functions.
| Nested Class Summary | |
static class |
FastMath.FastTrig
FastTrig is used to calculate quick trig functions using a lookup table. |
| Field Summary | |
static double |
DBL_EPSILON
A "close to zero" double epsilon value for use |
static float |
DEG_TO_RAD
A value to multiply a degree value by, to convert it to radians. |
static float |
FLT_EPSILON
A "close to zero" float epsilon value for use |
static float |
HALF_PI
The value PI/2 as a float. |
static float |
INV_PI
The value 1/PI as a float. |
static float |
INV_TWO_PI
The value 1/(2PI) as a float. |
static float |
PI
The value PI as a float. |
static float |
RAD_TO_DEG
A value to multiply a radian value by, to convert it to degrees. |
static java.util.Random |
rand
A precreated random object for random numbers. |
static float |
TWO_PI
The value 2PI as a float. |
static boolean |
USE_FAST_TRIG
If true, fast trig approximations are used for values such as sin/cos/tan. |
| Method Summary | |
static float |
abs(float fValue)
Returns Absolute value of a float. |
static float |
acos(float fValue)
Returns the arc cosine of an angle given in radians. Special cases: If fValue is smaller than -1, then the result is PI. |
static float |
asin(float fValue)
Returns the arc sine of an angle given in radians. Special cases: If fValue is smaller than -1, then the result is -HALF_PI. |
static float |
atan(float fValue)
Returns the arc tangent of an angle given in radians. |
static float |
atan2(float fY,
float fX)
A direct call to Math.atan2. |
static int |
ccw(Vector2f p0,
Vector2f p1,
Vector2f p2)
Given 3 points in a 2d plane, this function computes if the points going from A-B-C are moving counter clock wise. |
static float |
ceil(float fValue)
Rounds a fValue up. |
static float |
cos(float fValue)
Returns cos of a value. |
static float |
determinant(double m00,
double m01,
double m02,
double m03,
double m10,
double m11,
double m12,
double m13,
double m20,
double m21,
double m22,
double m23,
double m30,
double m31,
double m32,
double m33)
Returns the determinant of a 4x4 matrix. |
static float |
erf(float fX)
|
static float |
erfc(float fX)
|
static float |
exp(float fValue)
Returns E^fValue |
static float |
floor(float fValue)
Returns a number rounded down. |
static float |
gamma(float fX)
|
static float |
incompleteGamma(float fA,
float fX)
|
static float |
incompleteGammaCF(float fA,
float fX)
|
static float |
incompleteGammaS(float fA,
float fX)
|
static float |
invSqrt(float fValue)
Returns 1/sqrt(fValue) |
static boolean |
isPowerOfTwo(int number)
Returns true if the number is a power of 2 (2,4,8,16...) |
static float |
LERP(float f,
float v0,
float v1)
Linear interpolation from v0 to v1 by f percent. |
static float |
log(float fValue)
Returns the log base E of a value. |
static float |
logGamma(float fX)
|
static float |
modBessel0(float fX)
|
static float |
modBessel1(float fX)
|
static float |
nextRandomFloat()
Returns a random float between 0 and 1. |
static int |
pointInsideTriangle(Vector2f t0,
Vector2f t1,
Vector2f t2,
Vector2f p)
Test if a point is inside a triangle. |
static float |
pow(float fBase,
float fExponent)
Returns a number raised to an exponent power. |
static float |
sign(float fValue)
Returns 1 if the number is positive, -1 if the number is negative, and 0 otherwise |
static int |
sign(int iValue)
Returns 1 if the number is positive, -1 if the number is negative, and 0 otherwise |
static float |
sin(float fValue)
Returns sine of a value. |
static float |
sqr(float fValue)
Returns the value squared. |
static float |
sqrt(float fValue)
Returns the square root of a given value. |
static float |
tan(float fValue)
Returns the tangent of a value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final double DBL_EPSILON
public static final float FLT_EPSILON
public static final float PI
public static final float TWO_PI
public static final float HALF_PI
public static final float INV_PI
public static final float INV_TWO_PI
public static final float DEG_TO_RAD
public static final float RAD_TO_DEG
public static final java.util.Random rand
public static boolean USE_FAST_TRIG
| Method Detail |
public static boolean isPowerOfTwo(int number)
number - The number to test.
public static float LERP(float f,
float v0,
float v1)
f - Percent value to use.v0 - Begining value. 0% of fv1 - ending value. 100% of f
public static float acos(float fValue)
fValue - The angle, in radians.
Math.acos(double)public static float asin(float fValue)
fValue - The angle, in radians.
Math.asin(double)public static float atan(float fValue)
fValue - The angle, in radians.
Math.atan(double)
public static float atan2(float fY,
float fX)
fY - fX -
Math.atan2(double, double)public static float ceil(float fValue)
fValue - The value.
Math.ceil(double)public static float cos(float fValue)
fValue - The value to cosine, in raidans.
Math.cos(double)public static float exp(float fValue)
fValue - Value to raise to a power.
Math.exp(double)public static float abs(float fValue)
fValue - The value to abs.
Math.abs(float)public static float floor(float fValue)
fValue - The value to round
Math.floor(double)public static float invSqrt(float fValue)
fValue - The value to process.
Math.sqrt(double)public static float log(float fValue)
fValue - The value to log.
Math.log(double)
public static float pow(float fBase,
float fExponent)
fBase - The base value (IE 2)fExponent - The exponent value (IE 3)
Math.pow(double, double)public static float sin(float fValue)
fValue - The value to sine, in raidans.
Math.sin(double)public static float sqr(float fValue)
fValue - The vaule to square.
public static float sqrt(float fValue)
fValue - The value to sqrt.
Math.sqrt(double)public static float tan(float fValue)
fValue - The value to tangent, in raidans.
Math.tan(double)public static int sign(int iValue)
iValue - The integer to examine.
public static float sign(float fValue)
fValue - The float to examine.
public static float logGamma(float fX)
public static float gamma(float fX)
public static float incompleteGammaS(float fA,
float fX)
public static float incompleteGammaCF(float fA,
float fX)
public static float incompleteGamma(float fA,
float fX)
public static float erf(float fX)
public static float erfc(float fX)
public static float modBessel0(float fX)
public static float modBessel1(float fX)
public static int ccw(Vector2f p0,
Vector2f p1,
Vector2f p2)
p0 - Point 0.p1 - Point 1.p2 - Point 2.
public static int pointInsideTriangle(Vector2f t0,
Vector2f t1,
Vector2f t2,
Vector2f p)
t0 - First point of the triangle.t1 - Second point of the triangle.t2 - Third point of the triangle.p - The point to test.
public static float determinant(double m00,
double m01,
double m02,
double m03,
double m10,
double m11,
double m12,
double m13,
double m20,
double m21,
double m22,
double m23,
double m30,
double m31,
double m32,
double m33)
public static float nextRandomFloat()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||