public class Matrix44 extends Object
This class holds an array of 16 floating-point numbers to describe the 4x4 matrix.
| 构造器 | 说明 |
|---|---|
Matrix44() |
Default constructor used to create a
Matrix44 instance. |
Matrix44(Matrix44 srcMatrix) |
A constructor used to create a
Matrix44 instance by using an existing matrix. |
Matrix44(Matrix44 matrixA,
Matrix44 matrixB) |
A constructor used to create a
Matrix44 instance by using two specified matrices. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
double |
determinant() |
Calculates the determinant of this
Matrix44. |
float |
get(int row,
int col) |
Obtains the value at a specified position in this
Matrix44 and returns a float number. |
double |
getDouble(int row,
int col) |
Obtains a double value at a specified position in this
Matrix44. |
float |
getFloat(int row,
int col) |
Obtains the float value at a specified position in this
Matrix44. |
boolean |
hasPerspective() |
Checks whether this
Matrix44 contains perspective elements. |
boolean |
invert(Matrix44 inverse) |
Inverts this
Matrix44. |
boolean |
isIdentity() |
Checks whether this
Matrix44 is an identity matrix. |
boolean |
isScale() |
Checks whether this
Matrix44 contains scaling or whether it is an identity matrix. |
boolean |
isScaleTranslate() |
Checks whether this
Matrix44 contains only translation and scaling or whether it is an identity matrix. |
boolean |
isTranslate() |
Checks whether this
Matrix44 contains translation or whether it is an identity matrix. |
void |
postConcat(Matrix44 matrixM) |
Post-multiplies this
Matrix44 with a specified matrix
and saves the multiplication result in this Matrix44. |
void |
postScale(float scale) |
Post-multiplies this
Matrix44 with the specified scale. |
void |
postScale(float sx,
float sy,
float sz) |
Post-multiplies this
Matrix44 with the specified scale. |
void |
postTranslate(float dx,
float dy,
float dz) |
Post-multiplies this
Matrix44 with the specified translation. |
void |
preConcat(Matrix44 matrixM) |
Pre-multiplies this
Matrix44 with a specified matrix
and saves the multiplication result in this Matrix44. |
void |
preScale(float scale) |
Pre-multiplies this
Matrix44 with the specified scale. |
void |
preScale(float sx,
float sy,
float sz) |
Pre-multiplies this
Matrix44 with the specified scale. |
void |
preTranslate(float dx,
float dy,
float dz) |
Pre-multiplies this
Matrix44 with the specified translation. |
void |
reset() |
Resets this
Matrix44 to an identity matrix. |
void |
set(int row,
int col,
float value) |
Sets a value of the float type for a specified position in this
Matrix44. |
void |
setConcat(Matrix44 matrixA,
Matrix44 matrixB) |
Sets this
Matrix44 to the multiplication result of two specified matrices. |
void |
setDouble(int row,
int col,
double value) |
Sets a double value for a specified position in this
Matrix44. |
void |
setFloat(int row,
int col,
float value) |
Sets a float value for a specified position in this
Matrix44. |
void |
setIdentity() |
Sets this
Matrix44 to an identity matrix. |
void |
setRotateAbout(float x,
float y,
float z,
float radians) |
Rotates about the vector [x, y, z] by a specified radian.
|
void |
setRotateAboutUnit(float x,
float y,
float z,
float radians) |
Rotates about the vector [x, y, z] as a unit vector by a specified radian.
|
void |
setRotateDegreesAbout(float x,
float y,
float z,
float degrees) |
Rotates about the vector [x, y, z] by a specified angle.
|
void |
setScale(float scale) |
Scales this
Matrix44 by the specified size. |
void |
setScale(float sx,
float sy,
float sz) |
Scales this
Matrix44 by the specified size. |
void |
setTranslate(float dx,
float dy,
float dz) |
Translates this
Matrix44 with the specified length. |
void |
transpose() |
Transposes this
Matrix44. |
public Matrix44()
Matrix44 instance.public Matrix44(Matrix44 srcMatrix)
Matrix44 instance by using an existing matrix.
Specifically, the values of the existing matrix are copied to the created Matrix44 instance.
srcMatrix - Indicates the existing matrix.public Matrix44(Matrix44 matrixA, Matrix44 matrixB)
Matrix44 instance by using two specified matrices.
Specifically, the two specified matrices are multiplied, and the values of the product are copied to the
created Matrix44 instance.
matrixA - Indicates one specified matrix for multiplication.matrixB - Indicates the other specified matrix for multiplication.public boolean isIdentity()
Matrix44 is an identity matrix.true if the matrix is an identity matrix; returns false otherwise.public boolean isTranslate()
Matrix44 contains translation or whether it is an identity matrix.true if the matrix contains translation or it is an identity matrix; returns
false otherwise.public boolean isScaleTranslate()
Matrix44 contains only translation and scaling or whether it is an identity matrix.true if the matrix contains translation and scaling or it is an identity matrix; returns
false otherwise.public boolean isScale()
Matrix44 contains scaling or whether it is an identity matrix.true if the matrix contains scaling or it is an identity matrix; returns false
otherwise.public boolean hasPerspective()
Matrix44 contains perspective elements.true if the matrix contains perspective elements; returns false otherwise.public void setIdentity()
Matrix44 to an identity matrix.public void reset()
Matrix44 to an identity matrix.public float get(int row,
int col)
Matrix44 and returns a float number.row - Indicates the row of the specified position.col - Indicates the column of the specified position.public void set(int row,
int col,
float value)
Matrix44.row - Indicates the row of the specified position.col - Indicates the column of the specified position.value - Indicates the value to set.public double getDouble(int row,
int col)
Matrix44.row - Indicates the row of the specified position.col - Indicates the column of the specified position.public void setDouble(int row,
int col,
double value)
Matrix44.row - Indicates the row of the specified position.col - Indicates the column of the specified position.value - Indicates the double value to set.public float getFloat(int row,
int col)
Matrix44.row - Indicates the row of the specified position.col - Indicates the column of the specified position.public void setFloat(int row,
int col,
float value)
Matrix44.row - Indicates the row of the specified position.col - Indicates the column of the specified position.value - Indicates the float value to set.public void setTranslate(float dx,
float dy,
float dz)
Matrix44 with the specified length.dx - Indicates the length to translate on the x axis.dy - Indicates the length to translate on the y axis.dz - Indicates the length to translate on the z axis.public void preTranslate(float dx,
float dy,
float dz)
Matrix44 with the specified translation.dx - Indicates the length to translate on the x axis.dy - Indicates the length to translate on the y axis.dz - Indicates the length to translate on the z axis.public void postTranslate(float dx,
float dy,
float dz)
Matrix44 with the specified translation.dx - Indicates the length to translate on the x axis.dy - Indicates the length to translate on the y axis.dz - Indicates the length to translate on the z axis.public void setScale(float sx,
float sy,
float sz)
Matrix44 by the specified size.sx - Indicates the size to scale on the x axis.sy - Indicates the size to scale on the y axis.sz - Indicates the size to scale on the z axis.public void preScale(float sx,
float sy,
float sz)
Matrix44 with the specified scale.sx - Indicates the size to scale on the x axis.sy - Indicates the size to scale on the y axis.sz - Indicates the size to scale on the z axis.public void postScale(float sx,
float sy,
float sz)
Matrix44 with the specified scale.sx - Indicates the size to scale on the x axis.sy - Indicates the size to scale on the y axis.sz - Indicates the size to scale on the z axis.public void setScale(float scale)
Matrix44 by the specified size.scale - Indicates the size to scale. The value is shared by the x, y, and z axes.public void preScale(float scale)
Matrix44 with the specified scale.scale - Indicates the size to scale. The value is shared by the x, y, and z axes.public void postScale(float scale)
Matrix44 with the specified scale.scale - Indicates the size to scale. The value is shared by the x, y, and z axes.public void setRotateDegreesAbout(float x,
float y,
float z,
float degrees)
x - Indicates the first element of the vector to rotate.y - Indicates the second element of the vector to rotate.z - Indicates the third element of the vector to rotate.degrees - Indicates the number of degrees to rotate.public void setRotateAbout(float x,
float y,
float z,
float radians)
x - Indicates the first element of the vector to rotate.y - Indicates the second element of the vector to rotate.z - Indicates the third element of the vector to rotate.radians - Indicates the number of radians to rotate.public void setRotateAboutUnit(float x,
float y,
float z,
float radians)
x - Indicates the first element of the vector to rotate.y - Indicates the second element of the vector to rotate.z - Indicates the third element of the vector to rotate.radians - Indicates the number of radians to rotate.public void setConcat(Matrix44 matrixA, Matrix44 matrixB)
Matrix44 to the multiplication result of two specified matrices.matrixA - Indicates one matrix for multiplication.matrixB - Indicates the other matrix for multiplication.public void preConcat(Matrix44 matrixM)
Matrix44 with a specified matrix
and saves the multiplication result in this Matrix44.matrixM - Indicates the specified matrix.public void postConcat(Matrix44 matrixM)
Matrix44 with a specified matrix
and saves the multiplication result in this Matrix44.matrixM - Indicates the specified matrix.public boolean invert(Matrix44 inverse)
Matrix44.inverse - Indicates the matrix to hold the inverse of this Matrix44.true if this Matrix44 is invertible; returns false otherwise.public void transpose()
Matrix44.public double determinant()
Matrix44.