|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--render.Matrix
Provides functionality for 4x4 3D matrix manipulations. It's thread-safe.
Constructor Summary | |
Matrix()
Default constructor. |
|
Matrix(double[] a)
Constructor takes an array of 16 elements to populate the 4x4 matrix. |
Method Summary | |
void |
copy(Matrix src)
Copies contents from matrix src to the object matrix. |
double[] |
get()
Returns a copy of matrix (thread-safe)/ |
double |
get(int i,
int j)
Returns matrix value at m[i, j]. |
double[] |
getUnsafe()
Returns the actual array containing the matrix (not thread-safe). |
void |
identity()
Sets the object matrix to the identity matrix. |
static void |
identity(Matrix m)
Sets the desired matrix to the identity matrix. |
void |
invert(Matrix msrc)
Inverts the 4x4 matrix and stores the result in the object matrix. |
void |
postMultiply(Matrix mb)
Postmultiplies the object matrix by mb and stores the result in the object matrix; As a result, the translation, scaling and rotation operations contained in mb are effectively performed after those in the object matrix . |
void |
preMultiply(Matrix mb)
Premultiplies the object matrix by mb and stores the result in the object; As a result, the translation, scaling and rotation operations contained in mb are effectively performed before those in the object . |
void |
rotate(double theta,
double x,
double y,
double z)
Modifies the object matrix to rotate by angle theta about axis x,y,z. |
void |
rotateX(double theta)
Modifies the object matrix to rotate about the X axis by angle theta. |
void |
rotateY(double theta)
Modifies the object matrix to rotate about the Y axis by angle theta. |
void |
rotateZ(double theta)
Modifies the object matrix to rotate about the Z axis by angle theta. |
void |
scale(double x,
double y,
double z)
Scales the transformation matrix by x,y,z in the respective directions. |
void |
set(int i,
int j,
double d)
Sets matrix value at m[i,j] to d. |
java.lang.String |
toString()
|
java.lang.String |
toString(Matrix mm)
Converts the transformation matrix to a String. |
void |
translate(double x,
double y,
double z)
Applies a translation by x, y, z to the obeject matrix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Matrix()
public Matrix(double[] a)
a
- 4x4 quaternion valuesMethod Detail |
public final double get(int i, int j)
i
- row indexj
- column index
public final void set(int i, int j, double d)
i
- row indexj
- column indexd
- the new valuepublic final double[] getUnsafe()
get(int, int)
public final double[] get()
getUnsafe()
public static final void identity(Matrix m)
m
- the matrix to be modifiedpublic final void identity()
public final void copy(Matrix src)
src
- original matrix to be copiedpublic final void preMultiply(Matrix mb)
mb
- the multiplier matrixpublic final void postMultiply(Matrix mb)
mb
- the multiplier matrixpublic final void translate(double x, double y, double z)
x
- amount of translation along the x axisy
- amount of translation along the y axisz
- amount of translation along the z axispublic final void rotateX(double theta)
theta
- angle of rotation in radianspublic final void rotateY(double theta)
theta
- angle of rotation in radianspublic final void rotateZ(double theta)
theta
- angle of rotation in radianspublic final void rotate(double theta, double x, double y, double z)
theta
- angle of rotation in radiansx
- 1st coord of rotation axisy
- 2nd coord of rotation axisz
- 3rd coord of rotation axispublic final void scale(double x, double y, double z)
x
- scale factor along the x axisy
- scale factor along the y axisz
- scale factor along the z axispublic final void invert(Matrix msrc)
msrc
- original matrix to be invertedpublic final java.lang.String toString(Matrix mm)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |