HE_Mesh
5.0.0
|
Static Public Member Functions | |
static double | fastAbs (final double x) |
static double | max (final double x, final double y) |
static double | min (final double x, final double y) |
static int | max (final int x, final int y) |
static int | min (final int x, final int y) |
static double | max (final double x, final double y, final double z) |
static double | min (final double x, final double y, final double z) |
static final int | floor (final float x) |
static final float | fastLog2 (final float i) |
static final float | fastPow2 (final float i) |
static final float | fastPow (final float a, final float b) |
static final float | fastInvSqrt (float x) |
static final float | fastSqrt (final float x) |
static int | getExp (final double v) |
static double | hypot (final double a, final double b) |
static double | logBase2 (final double value) |
static boolean | isPowerOfTwo (final int value) |
static int | powerOfTwoCeiling (final int reference) |
static int | powerOfTwoFloor (final int reference) |
static double | clamp (final double v, final double min, final double max) |
static int | clamp (final int v, final int min, final int max) |
A collection of fast and approximated math functions. Not as robust as the JAVA implementations when dealing with special values (NaN etc). Some functions only give an approximation.
|
static |
Clamps a value to a given range.
v | the value to clamp. |
min | the floor. |
max | the ceiling |
|
static |
Clamps an integer value to a given range.
v | the value to clamp. |
min | the floor. |
max | the ceiling |
|
static |
Fast absolute value.
x | the x |
|
static |
Fast inverse sqrt approximation for floats.
x | the x |
|
static |
Fast log2 approximation for floats.
i | the i |
|
static |
Fast power approximation for floats.
a | the a |
b | exponent |
|
static |
Fast square power approximation for floats.
i | the i |
|
static |
Fast sqrt approximation for floats.
x | the x |
|
static |
Largest integer smaller than value.
x | the x |
|
static |
v |
|
static |
sqrt(a^2 + b^2) without under/overflow. *
a | |
b |
|
static |
Convenience method for testing whether a value is a power of two.
value | the value to test for power of 2 |
|
static |
Convenience method to compute the log base 2 of a value.
value | the value to take the log of. |
|
static |
Fast max.
x | the x |
y | the y |
|
static |
Fast max.
x | the x |
y | the y |
|
static |
Maximum of three values.
x | the x |
y | the y |
z | the z |
|
static |
Fast min.
x | the x |
y | the y |
|
static |
Fast min.
x | the x |
y | the y |
|
static |
Minimum of three values.
x | the x |
y | the y |
z | the z |
|
static |
Returns the value that is the nearest power of 2 greater than or equal to the given value.
reference | the reference value. The power of 2 returned is greater than or equal to this value. |
|
static |
Returns the value that is the nearest power of 2 less than or equal to the given value.
reference | the reference value. The power of 2 returned is less than or equal to this value. |