|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--shout3d.math.MatUtil
Matrix and rotation Utility Methods
Constructor Summary | |
MatUtil()
|
Method Summary | |
static void |
axisToQuat(float[] fromAA,
float[] toQuat)
convert an axis/angle rotation into a quaternion rotation. |
static void |
axisToQuat(float[] fromAA,
int fromOffset,
float[] toQuat,
int toOffset)
Input is two arrays which may be longer than 4 floats. |
static void |
composeQuats(float[] q1,
float[] q2,
float[] composedQuat)
Creates a third quaternion that is equivalent to the first followed by the second |
static float |
dot(float[] v1,
float[] v2)
Calculates the dot product of two 3-vectors or 4-vectors |
static float[] |
getMatrixAlongPath(Node[] path,
boolean bottomToTop)
Gets the matrix equivalent to concatenating all the matrices along the given path. |
static void |
multDirMatrix(float[] mtx,
float[] v)
Transforms a direction by a 4x4 matrix. |
static float[] |
multMatrix44byMatrix44(float[] mat1,
float[] mat2)
Multiplies two 4x4 matrices, stores the result in the first, and returns that first matrix. |
static void |
multVecMatrix(float[] mtx,
float[] v)
Transforms a point by a 4x4 matrix |
static float |
normalize(float[] v)
Normalizes the given vector. |
static void |
quatToAxis(float[] fromQuat,
float[] toAA)
convert a quaternion rotation into an axis/angle rotation. |
static float[] |
setToIdentityMatrix44(float[] mtx)
Set a 4x4 matrix to be an identity matrix |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public MatUtil()
Method Detail |
public static final float[] setToIdentityMatrix44(float[] mtx)
mtx
- the transformation matrixpublic static final void multVecMatrix(float[] mtx, float[] v)
mtx
- the transformation matrixv
- the point to transform, answer returned in the pointpublic static final void multDirMatrix(float[] mtx, float[] v)
mtx
- the transformation matrixv
- the direction to transform, answer returned in the pointpublic static final float normalize(float[] v)
v
- the vector to normalizepublic static final float dot(float[] v1, float[] v2)
v1
- the first vectorv2
- the second vectorpublic static final void quatToAxis(float[] fromQuat, float[] toAA)
fromQuat
- the quaternion to converttoAA
- the result axis/angle rotationpublic static final void axisToQuat(float[] fromAA, float[] toQuat)
fromAA
- the axis/angle to converttoQuat
- the result quaternion rotationpublic static final void axisToQuat(float[] fromAA, int fromOffset, float[] toQuat, int toOffset)
fromAA
- the array in which axis/angle are located.fromOffset
- offset of first index to use within fromAAtoQuat
- the array in which the quaternion info is to be placedtoOffset
- offset of the first index to fill within toQuatpublic static final void composeQuats(float[] q1, float[] q2, float[] composedQuat)
q1
- the first quaternion to composeq2
- the second quaternion to composecomposedQuat
- the result of composing q1 and q2public static final float[] multMatrix44byMatrix44(float[] mat1, float[] mat2)
public static float[] getMatrixAlongPath(Node[] path, boolean bottomToTop)
the
- path along which to calculate the matrixbottomToTop
- whether the matrix transforms from bottom space to top space or vice versa
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |