public class Matrix3f extends Object implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
float |
m00
The first matrix element in the first row.
|
float |
m01
The second matrix element in the first row.
|
float |
m02
The third matrix element in the first row.
|
float |
m10
The first matrix element in the second row.
|
float |
m11
The second matrix element in the second row.
|
float |
m12
The third matrix element in the second row.
|
float |
m20
The first matrix element in the third row.
|
float |
m21
The second matrix element in the third row.
|
float |
m22
The third matrix element in the third row.
|
Constructor and Description |
---|
Matrix3f()
Constructs and initializes a Matrix3f to all zeros.
|
Matrix3f(float[] v)
Constructs and initializes a Matrix3f from the specified
nine-element array.
|
Matrix3f(float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
Constructs and initializes a Matrix3f from the specified nine values.
|
Matrix3f(Matrix3d m1)
Constructs a new matrix with the same values as the
Matrix3d parameter.
|
Matrix3f(Matrix3f m1)
Constructs a new matrix with the same values as the
Matrix3f parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
add(float scalar)
Adds a scalar to each component of this matrix.
|
void |
add(float scalar,
Matrix3f m1)
Adds a scalar to each component of the matrix m1 and places
the result into this.
|
void |
add(Matrix3f m1)
Sets the value of this matrix to the matrix sum of itself and
matrix m1.
|
void |
add(Matrix3f m1,
Matrix3f m2)
Sets the value of this matrix to the matrix sum of matrices m1 and m2.
|
Object |
clone()
Creates a new object of the same class as this object.
|
float |
determinant()
Computes the determinant of this matrix.
|
boolean |
epsilonEquals(Matrix3f m1,
float epsilon)
Returns true if the L-infinite distance between this matrix
and matrix m1 is less than or equal to the epsilon parameter,
otherwise returns false.
|
boolean |
equals(Matrix3f m1)
Returns true if all of the data members of Matrix3f m1 are
equal to the corresponding data members in this Matrix3f.
|
boolean |
equals(Object o1)
Returns true if the Object o1 is of type Matrix3f and all of the
data members of o1 are equal to the corresponding data members in
this Matrix3f.
|
void |
getColumn(int column,
float[] v)
Copies the matrix values in the specified column into the array
parameter.
|
void |
getColumn(int column,
Vector3f v)
Copies the matrix values in the specified column into the vector
parameter.
|
float |
getElement(int row,
int column)
Retrieves the value at the specified row and column of this
matrix.
|
float |
getM00()
Get the first matrix element in the first row.
|
float |
getM01()
Get the second matrix element in the first row.
|
float |
getM02()
Get the third matrix element in the first row.
|
float |
getM10()
Get first matrix element in the second row.
|
float |
getM11()
Get second matrix element in the second row.
|
float |
getM12()
Get the third matrix element in the second row.
|
float |
getM20()
Get the first matrix element in the third row.
|
float |
getM21()
Get the second matrix element in the third row.
|
float |
getM22()
Get the third matrix element in the third row .
|
void |
getRow(int row,
float[] v)
Copies the matrix values in the specified row into the array parameter.
|
void |
getRow(int row,
Vector3f v)
Copies the matrix values in the specified row into the vector parameter.
|
float |
getScale()
Performs an SVD normalization of this matrix to calculate
and return the uniform scale factor.
|
int |
hashCode()
Returns a hash code value based on the data values in this
object.
|
void |
invert()
Inverts this matrix in place.
|
void |
invert(Matrix3f m1)
Sets the value of this matrix to the matrix inverse
of the passed matrix m1.
|
void |
mul(float scalar)
Multiplies each element of this matrix by a scalar.
|
void |
mul(float scalar,
Matrix3f m1)
Multiplies each element of matrix m1 by a scalar and places
the result into this.
|
void |
mul(Matrix3f m1)
Sets the value of this matrix to the result of multiplying itself
with matrix m1.
|
void |
mul(Matrix3f m1,
Matrix3f m2)
Sets the value of this matrix to the result of multiplying
the two argument matrices together.
|
void |
mulNormalize(Matrix3f m1)
Multiplies this matrix by matrix m1, does an SVD normalization
of the result, and places the result back into this matrix.
|
void |
mulNormalize(Matrix3f m1,
Matrix3f m2)
Multiplies matrix m1 by matrix m2, does an SVD normalization
of the result, and places the result into this matrix.
|
void |
mulTransposeBoth(Matrix3f m1,
Matrix3f m2)
Multiplies the transpose of matrix m1 times the transpose of matrix
m2, and places the result into this.
|
void |
mulTransposeLeft(Matrix3f m1,
Matrix3f m2)
Multiplies the transpose of matrix m1 times matrix m2, and
places the result into this.
|
void |
mulTransposeRight(Matrix3f m1,
Matrix3f m2)
Multiplies matrix m1 times the transpose of matrix m2, and
places the result into this.
|
void |
negate()
Negates the value of this matrix: this = -this.
|
void |
negate(Matrix3f m1)
Sets the value of this matrix equal to the negation of
of the Matrix3f parameter.
|
void |
normalize()
Performs singular value decomposition normalization of this matrix.
|
void |
normalize(Matrix3f m1)
Perform singular value decomposition normalization of matrix m1
and place the normalized values into this.
|
void |
normalizeCP()
Perform cross product normalization of this matrix.
|
void |
normalizeCP(Matrix3f m1)
Perform cross product normalization of matrix m1 and place the
normalized values into this.
|
void |
rotX(float angle)
Sets the value of this matrix to a counter clockwise rotation
about the x axis.
|
void |
rotY(float angle)
Sets the value of this matrix to a counter clockwise rotation
about the y axis.
|
void |
rotZ(float angle)
Sets the value of this matrix to a counter clockwise rotation
about the z axis.
|
void |
set(AxisAngle4d a1)
Sets the value of this matrix to the matrix conversion of the
(double precision) axis and angle argument.
|
void |
set(AxisAngle4f a1)
Sets the value of this matrix to the matrix conversion of the
(single precision) axis and angle argument.
|
void |
set(float scale)
Sets the value of this matrix to a scale matrix with
the passed scale amount.
|
void |
set(float[] m)
Sets the values in this Matrix3f equal to the row-major
array parameter (ie, the first three elements of the
array will be copied into the first row of this matrix, etc.).
|
void |
set(Matrix3d m1)
Sets the value of this matrix to the float value of the Matrix3d
argument.
|
void |
set(Matrix3f m1)
Sets the value of this matrix to the value of the Matrix3f
argument.
|
void |
set(Quat4d q1)
Sets the value of this matrix to the matrix conversion of the
(single precision) quaternion argument.
|
void |
set(Quat4f q1)
Sets the value of this matrix to the matrix conversion of the
(single precision) quaternion argument.
|
void |
setColumn(int column,
float[] v)
Sets the specified column of this matrix3f to the three values provided.
|
void |
setColumn(int column,
float x,
float y,
float z)
Sets the specified column of this matrix3f to the three values provided.
|
void |
setColumn(int column,
Vector3f v)
Sets the specified column of this matrix3f to the vector provided.
|
void |
setElement(int row,
int column,
float value)
Sets the specified element of this matrix3f to the value provided.
|
void |
setIdentity()
Sets this Matrix3f to identity.
|
void |
setM00(float m00)
Set the first matrix element in the first row.
|
void |
setM01(float m01)
Set the second matrix element in the first row.
|
void |
setM02(float m02)
Set the third matrix element in the first row.
|
void |
setM10(float m10)
Set first matrix element in the second row.
|
void |
setM11(float m11)
Set the second matrix element in the second row.
|
void |
setM12(float m12)
Set the third matrix element in the second row.
|
void |
setM20(float m20)
Set the first matrix element in the third row.
|
void |
setM21(float m21)
Set the second matrix element in the third row.
|
void |
setM22(float m22)
Set the third matrix element in the third row.
|
void |
setRow(int row,
float[] v)
Sets the specified row of this matrix3f to the three values provided.
|
void |
setRow(int row,
float x,
float y,
float z)
Sets the specified row of this matrix3f to the three values provided.
|
void |
setRow(int row,
Vector3f v)
Sets the specified row of this matrix3f to the Vector provided.
|
void |
setScale(float scale)
Sets the scale component of the current matrix by factoring
out the current scale (by doing an SVD) and multiplying by
the new scale.
|
void |
setZero()
Sets this matrix to all zeros.
|
void |
sub(Matrix3f m1)
Sets the value of this matrix to the matrix difference
of itself and matrix m1 (this = this - m1).
|
void |
sub(Matrix3f m1,
Matrix3f m2)
Sets the value of this matrix to the matrix difference
of matrices m1 and m2.
|
String |
toString()
Returns a string that contains the values of this Matrix3f.
|
void |
transform(Tuple3f t)
Multiply this matrix by the tuple t and place the result
back into the tuple (t = this*t).
|
void |
transform(Tuple3f t,
Tuple3f result)
Multiply this matrix by the tuple t and and place the result
into the tuple "result" (result = this*t).
|
void |
transpose()
Sets the value of this matrix to its transpose.
|
void |
transpose(Matrix3f m1)
Sets the value of this matrix to the transpose of the argument matrix.
|
public float m00
public float m01
public float m02
public float m10
public float m11
public float m12
public float m20
public float m21
public float m22
public Matrix3f(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
m00
- the [0][0] elementm01
- the [0][1] elementm02
- the [0][2] elementm10
- the [1][0] elementm11
- the [1][1] elementm12
- the [1][2] elementm20
- the [2][0] elementm21
- the [2][1] elementm22
- the [2][2] elementpublic Matrix3f(float[] v)
v
- the array of length 9 containing in orderpublic Matrix3f(Matrix3d m1)
m1
- the source matrixpublic Matrix3f(Matrix3f m1)
m1
- the source matrixpublic Matrix3f()
public String toString()
public final void setIdentity()
public final void setScale(float scale)
scale
- the new scale amountpublic final void setElement(int row, int column, float value)
row
- the row number to be modified (zero indexed)column
- the column number to be modified (zero indexed)value
- the new valuepublic final void getRow(int row, Vector3f v)
row
- the matrix rowv
- the vector into which the matrix row values will be copiedpublic final void getRow(int row, float[] v)
row
- the matrix rowv
- the array into which the matrix row values will be copiedpublic final void getColumn(int column, Vector3f v)
column
- the matrix columnv
- the vector into which the matrix row values will be copiedpublic final void getColumn(int column, float[] v)
column
- the matrix columnv
- the array into which the matrix row values will be copiedpublic final float getElement(int row, int column)
row
- the row number to be retrieved (zero indexed)column
- the column number to be retrieved (zero indexed)public final void setRow(int row, float x, float y, float z)
row
- the row number to be modified (zero indexed)x
- the first column elementy
- the second column elementz
- the third column elementpublic final void setRow(int row, Vector3f v)
row
- the row number to be modified (zero indexed)v
- the replacement rowpublic final void setRow(int row, float[] v)
row
- the row number to be modified (zero indexed)v
- the replacement rowpublic final void setColumn(int column, float x, float y, float z)
column
- the column number to be modified (zero indexed)x
- the first row elementy
- the second row elementz
- the third row elementpublic final void setColumn(int column, Vector3f v)
column
- the column number to be modified (zero indexed)v
- the replacement columnpublic final void setColumn(int column, float[] v)
column
- the column number to be modified (zero indexed)v
- the replacement columnpublic final float getScale()
public final void add(float scalar)
scalar
- the scalar adderpublic final void add(float scalar, Matrix3f m1)
scalar
- the scalar adder.m1
- the original matrix valuespublic final void add(Matrix3f m1, Matrix3f m2)
m1
- the first matrixm2
- the second matrixpublic final void add(Matrix3f m1)
m1
- the other matrixpublic final void sub(Matrix3f m1, Matrix3f m2)
m1
- the first matrixm2
- the second matrixpublic final void sub(Matrix3f m1)
m1
- the other matrixpublic final void transpose()
public final void transpose(Matrix3f m1)
m1
- the matrix to be transposedpublic final void set(Quat4f q1)
q1
- the quaternion to be convertedpublic final void set(AxisAngle4f a1)
a1
- the axis and angle to be convertedpublic final void set(AxisAngle4d a1)
a1
- the axis and angle to be convertedpublic final void set(Quat4d q1)
q1
- the quaternion to be convertedpublic final void set(float[] m)
m
- the single precision array of length 9public final void set(Matrix3f m1)
m1
- the source matrix3fpublic final void set(Matrix3d m1)
m1
- the source matrix3dpublic final void invert(Matrix3f m1)
m1
- the matrix to be invertedpublic final void invert()
public final float determinant()
public final void set(float scale)
scale
- the scale factor for the matrixpublic final void rotX(float angle)
angle
- the angle to rotate about the X axis in radianspublic final void rotY(float angle)
angle
- the angle to rotate about the Y axis in radianspublic final void rotZ(float angle)
angle
- the angle to rotate about the Z axis in radianspublic final void mul(float scalar)
scalar
- the scalar multiplierpublic final void mul(float scalar, Matrix3f m1)
scalar
- the scalar multiplierm1
- the original matrixpublic final void mul(Matrix3f m1)
m1
- the other matrixpublic final void mul(Matrix3f m1, Matrix3f m2)
m1
- the first matrixm2
- the second matrixpublic final void mulNormalize(Matrix3f m1)
m1
- the matrix on the right hand side of the multiplicationpublic final void mulNormalize(Matrix3f m1, Matrix3f m2)
m1
- the matrix on the left hand side of the multiplicationm2
- the matrix on the right hand side of the multiplicationpublic final void mulTransposeBoth(Matrix3f m1, Matrix3f m2)
m1
- the matrix on the left hand side of the multiplicationm2
- the matrix on the right hand side of the multiplicationpublic final void mulTransposeRight(Matrix3f m1, Matrix3f m2)
m1
- the matrix on the left hand side of the multiplicationm2
- the matrix on the right hand side of the multiplicationpublic final void mulTransposeLeft(Matrix3f m1, Matrix3f m2)
m1
- the matrix on the left hand side of the multiplicationm2
- the matrix on the right hand side of the multiplicationpublic final void normalize()
public final void normalize(Matrix3f m1)
m1
- the matrix values to be normalizedpublic final void normalizeCP()
public final void normalizeCP(Matrix3f m1)
m1
- Provides the matrix values to be normalizedpublic boolean equals(Matrix3f m1)
m1
- the matrix with which the comparison is madepublic boolean equals(Object o1)
public boolean epsilonEquals(Matrix3f m1, float epsilon)
m1
- the matrix to be compared to this matrixepsilon
- the threshold valuepublic int hashCode()
public final void setZero()
public final void negate()
public final void negate(Matrix3f m1)
m1
- the source matrixpublic final void transform(Tuple3f t)
t
- the tuple to be multiplied by this matrix and then replacedpublic final void transform(Tuple3f t, Tuple3f result)
t
- the tuple to be multiplied by this matrixresult
- the tuple into which the product is placedpublic Object clone()
clone
in class Object
OutOfMemoryError
- if there is not enough memory.Cloneable
public final float getM00()
public final void setM00(float m00)
m00
- The m00 to set.public final float getM01()
public final void setM01(float m01)
m01
- The m01 to set.public final float getM02()
public final void setM02(float m02)
m02
- The m02 to set.public final float getM10()
public final void setM10(float m10)
m10
- The m10 to set.public final float getM11()
public final void setM11(float m11)
m11
- The m11 to set.public final float getM12()
public final void setM12(float m12)
m12
- The m12 to set.public final float getM20()
public final void setM20(float m20)
m20
- The m20 to set.public final float getM21()
public final void setM21(float m21)
m21
- The m21 to set.public final float getM22()
public final void setM22(float m22)
m22
- The m22 to set.Copyright © 2016–2022 SciJava. All rights reserved.