public class Ilv3DFloatMatrix extends Object
Constructor and Description |
---|
Ilv3DFloatMatrix()
Creates a new 4 by 4 matrix filled with zeros.
|
Modifier and Type | Method and Description |
---|---|
float |
get(int i,
int j)
Gets the (i,j) 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(Ilv3DRotation rot)
Gets the upper left 3x3 of this matrix as a rotation.Ignores translation component.
|
void |
invertRigid()
Inverts this matrix assuming that it represents a rigid transform (i.e.,
some combination of rotations and translations).
|
void |
makeIdent()
Makes this matrix the identity
|
Ilv3DFloatMatrix |
mul(Ilv3DFloatMatrix b)
Returns this matrix multiplied by matrix b; Creates new matrix
|
void |
mul(Ilv3DFloatMatrix a,
Ilv3DFloatMatrix b)
Set this matrix equal to the product of a and b
|
void |
set(int i,
int j,
float val)
Sets the (i,j) element of this matrix, where i is the row index and j is
the column index
|
void |
setRotation(Ilv3DFloatVector x,
Ilv3DFloatVector y,
Ilv3DFloatVector z)
Sets the upper-left 3x3 of this matrix assuming that the given x, y, and z
vectors form an orthonormal basis
|
void |
setRotation(Ilv3DRotation rot)
Sets the rotation component of this matrix (the upper left 3 by 3 submatrix).
|
void |
setTranslation(Ilv3DFloatVector trans)
Sets the translation component of this matrix (i.e., the three top elements
of the third column)
|
String |
toString()
Prints this matrix
|
void |
xformDir(Ilv3DFloatVector src,
Ilv3DFloatVector dest)
Transforms src using only the upper left 3x3.
|
void |
xformPt(Ilv3DFloatVector src,
Ilv3DFloatVector dest)
Transforms a 3D vector as though it had a homogeneous coordinate and
assuming that this matrix represents only rigid transformations; that is, it is
not a full transformation.
|
public Ilv3DFloatMatrix()
public void makeIdent()
public final float get(int i, int j)
i
- row indexj
- column indexpublic final void set(int i, int j, float val)
i
- row indexj
- column indexval
- the matrix elementpublic final void setTranslation(Ilv3DFloatVector trans)
trans
- The vector containing the translation coordinates.public final void setRotation(Ilv3DRotation rot)
rot
- The rotation to set.public final void setRotation(Ilv3DFloatVector x, Ilv3DFloatVector y, Ilv3DFloatVector z)
x
- X Vector.y
- Y Vector.z
- Z Vector.public void getRotation(Ilv3DRotation rot)
rot
- The Rotf instance to hold the result.public void invertRigid()
public Ilv3DFloatMatrix mul(Ilv3DFloatMatrix b)
b
- The matrix to multiply.public void mul(Ilv3DFloatMatrix a, Ilv3DFloatMatrix b)
a
- The first matrix.b
- The second matrix.public void xformPt(Ilv3DFloatVector src, Ilv3DFloatVector dest)
src
- The vector to multiply.dest
- The vector to store the result.public void xformDir(Ilv3DFloatVector src, Ilv3DFloatVector dest)
src
- The vector to multiply.dest
- The vector to store the result.public void getColumnMajorData(float[] out)
out
- The float array containing the matrix elements© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.