|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.util.VecMathUtils
public final class VecMathUtils
Utilities for vecmath classes.
| Method Summary | ||
|---|---|---|
float |
angle(TupleNf<?> v1,
TupleNf<?> v2)
Returns the (n-space) angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI]. |
|
static void |
cross(TupleNf<?> v1,
TupleNf<?> v2,
TupleNf<?> out)
Sets this vector to be the vector cross product of vectors v1 and v2. |
|
static float |
distance(TupleNf<?> p1,
TupleNf<?> p2)
|
|
static float |
distanceSquared(TupleNf<?> p1,
TupleNf<?> p2)
|
|
static float |
dot(TupleNf<?> v1,
TupleNf<?> v2)
Returns the dot product of vector v1 and vector v2. |
|
static long |
doubleToLongBits(double d)
Returns the representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout, after first mapping -0.0 to 0.0. |
|
static boolean |
epsilonEquals(TupleNf<?> t1,
TupleNf<?> t2,
float epsilon)
Returns true if the L-infinite distance between this vector and vector v1 is less than or equal to the epsilon parameter, otherwise returns false. |
|
static boolean |
equals(TupleNf<?> t1,
TupleNf<?> t2)
Returns true if all of the data members of GVector vector1 are equal to the corresponding data members in this GVector. |
|
static int |
floatToIntBits(float f)
Returns the representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout, after first mapping -0.0 to 0.0. |
|
static float |
getNorm(TupleNf<?> vec)
Returns the square root of the sum of the squares of this vector (its length in n-dimensional space). |
|
static float |
getNormSquared(TupleNf<?> vec)
Returns the sum of the squares of this vector (its length sqaured in n-dimensional space). |
|
static VectorInterface<?,?> |
getVectorFromPool(int size)
|
|
static float |
length(TupleNf<?> vec)
Computes the length of the (x,y,z)-component of this vector. |
|
static float |
lengthSquared(TupleNf<?> vec)
Computes the squared length of this vector. |
|
static void |
normalize(TupleNf<?> v)
Normalizes the given vector. |
|
static void |
putVectorToPool(VectorInterface vector)
Puts a vector back to its pool. |
|
static
|
readMatrix3f(java.io.DataInput in,
M m)
Reads a Tuple3f from the InputStream. |
|
static
|
readTuple3f(java.io.DataInput in,
T t)
Reads a Tuple3f from the InputStream. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final VectorInterface<?,?> getVectorFromPool(int size)
size -
public static final void putVectorToPool(VectorInterface vector)
vector -
public static final float distanceSquared(TupleNf<?> p1,
TupleNf<?> p2)
public static final float distance(TupleNf<?> p1,
TupleNf<?> p2)
public static final float getNormSquared(TupleNf<?> vec)
vec -
public static final float getNorm(TupleNf<?> vec)
vec -
public static final void normalize(TupleNf<?> v)
v - public static final float lengthSquared(TupleNf<?> vec)
vec -
public static final float length(TupleNf<?> vec)
vec -
public static final void cross(TupleNf<?> v1,
TupleNf<?> v2,
TupleNf<?> out)
v1 - the first vectorv2 - the second vector
public static final float dot(TupleNf<?> v1,
TupleNf<?> v2)
v1 - the first vectorv2 - the second vector
public float angle(TupleNf<?> v1,
TupleNf<?> v2)
v1 - The first vectorv2 - The second vector
public static boolean equals(TupleNf<?> t1,
TupleNf<?> t2)
t1 - the tuple with which the comparison is made.t2 - the vector with which the comparison is made.
public static final boolean epsilonEquals(TupleNf<?> t1,
TupleNf<?> t2,
float epsilon)
t1 - the tuple with which the comparison is made.t2 - the vector with which the comparison is made.epsilon - the threshold valuepublic static final int floatToIntBits(float f)
f - an input floating-point number
public static final long doubleToLongBits(double d)
f - an input floating-point number
public static final <T extends Tuple3f> T readTuple3f(java.io.DataInput in,
T t)
throws java.io.IOException
T - in - t -
java.io.IOException
public static final <M extends Matrix3f> M readMatrix3f(java.io.DataInput in,
M m)
throws java.io.IOException
T - in - t -
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||