|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.joglutils.msg.math.Mat4f
public class Mat4f
A (very incomplete) 4x4 matrix class. Representation assumes row-major order and multiplication by column vectors on the right.
Constructor Summary | |
---|---|
Mat4f()
Creates new matrix initialized to the zero matrix |
|
Mat4f(Mat4f arg)
Creates new matrix initialized to argument's contents |
Method Summary | |
---|---|
float |
get(int i,
int j)
Gets the (i,j)th element of this matrix, where i is the row index and j is the column index |
void |
getColumnMajorData(float[] out)
Copies data in column-major (OpenGL format) order into passed float array, which must have length 16 or greater. |
void |
getRotation(Rotf rot)
Gets the upper left 3x3 of this matrix as a rotation. |
float[] |
getRowMajorData()
Returns the matrix data in row-major format, which is the opposite of OpenGL's convention. |
void |
invert()
Performs general 4x4 matrix inversion. |
void |
invertRigid()
Inverts this matrix assuming that it represents a rigid transform (i.e., some combination of rotations and translations). |
void |
makeIdent()
Sets this matrix to the identity matrix |
Mat4f |
mul(Mat4f b)
Returns this * b; creates new matrix |
void |
mul(Mat4f a,
Mat4f b)
this = a * b |
void |
set(int i,
int j,
float val)
Sets the (i,j)th element of this matrix, where i is the row index and j is the column index |
void |
set(Mat4f arg)
Sets this matrix to be equivalent to the given one |
void |
setRotation(Rotf rot)
Sets the rotation component of this matrix (i.e., the upper left 3x3) without touching any of the other parts of the matrix |
void |
setRotation(Vec3f x,
Vec3f y,
Vec3f z)
Sets the upper-left 3x3 of this matrix assuming that the given x, y, and z vectors form an orthonormal basis |
void |
setScale(Vec3f scale)
Sets the elements (0, 0), (1, 1), and (2, 2) with the appropriate elements of the given three-dimensional scale vector. |
void |
setTranslation(Vec3f trans)
Sets the translation component of this matrix (i.e., the three top elements of the third column) without touching any of the other parts of the matrix |
Matf |
toMatf()
|
String |
toString()
|
void |
transpose()
Transpose this matrix in place. |
void |
xformDir(Vec3f src,
Vec3f dest)
Transforms src using only the upper left 3x3. |
Line |
xformLine(Line line)
Transforms the given line (origin plus direction) by this matrix. |
void |
xformPt(Vec3f src,
Vec3f dest)
Transforms a 3D vector as though it had a homogeneous coordinate and assuming that this matrix represents only rigid transformations; i.e., is not a full transformation. |
void |
xformVec(Vec4f src,
Vec4f dest)
Multiply a 4D vector by this matrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Mat4f()
public Mat4f(Mat4f arg)
Method Detail |
---|
public void makeIdent()
public void set(Mat4f arg)
public float get(int i, int j)
public void set(int i, int j, float val)
public void setTranslation(Vec3f trans)
public void setRotation(Rotf rot)
public void setRotation(Vec3f x, Vec3f y, Vec3f z)
public void getRotation(Rotf rot)
public void setScale(Vec3f scale)
mul
for that.
public void invertRigid()
public void invert() throws SingularMatrixException
SingularMatrixException
- if this matrix is singular (i.e., non-invertible)public Mat4f mul(Mat4f b)
public void mul(Mat4f a, Mat4f b)
public void transpose()
public void xformVec(Vec4f src, Vec4f dest)
public void xformPt(Vec3f src, Vec3f dest)
public void xformDir(Vec3f src, Vec3f dest)
public Line xformLine(Line line)
public void getColumnMajorData(float[] out)
public float[] getRowMajorData()
public Matf toMatf()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |