4D Matrix. Values are stored in column major order.
Static Methods
Constructors
- Matrix4(double arg0, double arg1, double arg2, double arg3, double arg4, double arg5, double arg6, double arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15)
-
Constructs a new mat4.
factory - Matrix4.columns(Vector4 arg0, Vector4 arg1, Vector4 arg2, Vector4 arg3)
-
Constructs a new mat4 from columns.
factory - Matrix4.compose(Vector3 translation, Quaternion rotation, Vector3 scale)
-
Constructs Matrix4 from
translation,rotationandscale.factory - Matrix4.copy(Matrix4 other)
-
Copies values from
other.factory - Matrix4.diagonal3(Vector3 scale)
-
Scale matrix.
factory - Matrix4.diagonal3Values(double x, double y, double z)
-
Scale matrix.
factory - Matrix4.fromBuffer(ByteBuffer buffer, int offset)
-
Constructs Matrix4 with a storage that views given
bufferstarting atoffset.offsethas to be multiple of Float64List.BYTES_PER_ELEMENT. - Matrix4.fromFloat64List(Float64List _m4storage)
-
Constructs Matrix4 with given Float64List as storage.
- Matrix4.fromList(List<double> values)
-
New matrix from
values.factory - Matrix4.identity()
-
Identity matrix.
factory - Matrix4.inverted(Matrix4 other)
-
Constructs a matrix that is the inverse of
other.factory - Matrix4.outer(Vector4 u, Vector4 v)
-
Outer product of
uandv.factory - Matrix4.rotationX(double radians)
-
Rotation of
radians_around X.factory - Matrix4.rotationY(double radians)
-
Rotation of
radians_around Y.factory - Matrix4.rotationZ(double radians)
-
Rotation of
radians_around Z.factory - Matrix4.skew(double alpha, double beta)
-
Skew matrix around X axis (alpha) and Y axis (beta).
factory - Matrix4.skewX(double alpha)
-
Skew matrix around X axis
factory - Matrix4.skewY(double beta)
-
Skew matrix around Y axis.
factory - Matrix4.translation(Vector3 translation)
-
Translation matrix.
factory - Matrix4.translationValues(double x, double y, double z)
-
Translation matrix.
factory - Matrix4.zero()
-
Zero matrix.
Properties
- dimension → int
-
Dimension of the matrix.
read-only - forward → Vector3
-
read-only
- hashCode → int
-
read-only
- right → Vector3
-
read-only
- row0 → Vector4
-
Returns row 0
read / write - row1 → Vector4
-
Returns row 1
read / write - row2 → Vector4
-
Returns row 2
read / write - row3 → Vector4
-
Returns row 3
read / write - storage → Float64List
-
The components of the matrix.
read-only - up → Vector3
-
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator *(
arg) → dynamic -
Returns a new vector or matrix by multiplying
thiswitharg. -
operator +(
Matrix4 arg) → Matrix4 -
Returns new matrix after component wise
this+arg -
operator -(
Matrix4 arg) → Matrix4 -
Returns new matrix after component wise
this-arg -
operator ==(
other) → bool -
Check if two matrices are the same.
-
operator [](
int i) → double -
Access the element of the matrix at the index
i. -
operator []=(
int i, double v) → void -
Set the element of the matrix at the index
i. -
operator unary-(
) → Matrix4 -
Returns new matrix -this
Methods
-
absolute(
) → Matrix4 -
Returns the component wise absolute value of this.
-
absoluteError(
Matrix4 correct) → double -
Returns absolute error between
thisandcorrect -
absoluteRotate(
Vector3 arg) → Vector3 -
Rotates
argby the absolute rotation ofthisReturnsarg. Primarily used by AABB transformation code. -
add(
Matrix4 o) → void -
Adds
otothis. -
applyToVector3Array(
List<double> array, [ int offset = 0 ]) → List<double> -
Multiply
thisto each set of xyz values inarraystarting atoffset. -
clone(
) → Matrix4 -
Clone matrix.
-
copyFromArray(
List<double> array, [ int offset = 0 ]) → void -
Copies elements from
arrayintothisstarting atoffset. -
copyInto(
Matrix4 arg) → Matrix4 -
Copy into
arg. -
copyIntoArray(
List<num> array, [ int offset = 0 ]) → void -
Copies
thisintoarraystarting atoffset. -
copyInverse(
Matrix4 arg) → double -
Set this matrix to be the inverse of
arg -
copyRotation(
Matrix3 rotation) → void -
Copies the rotation matrix from this homogeneous transformation matrix into
rotation. -
decompose(
Vector3 translation, Quaternion rotation, Vector3 scale) → void -
Decomposes
thisintotranslation,rotationandscalecomponents. -
determinant(
) → double -
Returns the determinant of this matrix.
-
dotColumn(
int j, Vector4 v) → double -
Returns the dot product of column
jandv. -
dotRow(
int i, Vector4 v) → double -
Returns the dot product of row
iandv. -
entry(
int row, int col) → double -
Value at
row,col. -
getColumn(
int column) → Vector4 -
Gets the
columnof the matrix -
getMaxScaleOnAxis(
) → double -
Returns the max scale value of the 3 axes.
-
getNormalMatrix(
) → Matrix3 -
Returns the normal matrix from this homogeneous transformation matrix. The normal matrix is the transpose of the inverse of the top-left 3x3 part of this 4x4 matrix.
-
getRotation(
) → Matrix3 -
Returns the rotation matrix from this homogeneous transformation matrix.
-
getRow(
int row) → Vector4 -
Gets the
rowof the matrix -
getTranslation(
) → Vector3 -
Returns the translation vector from this homogeneous transformation matrix.
-
index(
int row, int col) → int -
Return index in storage for
row,colvalue. -
infinityNorm(
) → double -
Returns infinity norm of the matrix. Used for numerical analysis.
-
invert(
) → double -
Invert
this. -
invertRotation(
) → double -
leftTranslate(
x, [ double y = 0.0, double z = 0.0 ]) → void -
Multiply
thisby a translation from the left. The translation can be specified with aVector3,Vector4, or x, y, z. -
multiplied(
Matrix4 arg) → Matrix4 -
Multiply a copy of
thiswitharg. -
multiply(
Matrix4 arg) → void -
Multiply
thisbyarg. -
multiplyTranspose(
Matrix4 arg) → void -
Multiply
thiswith a transposedarg. -
negate(
) → void -
Negate
this. -
perspectiveTransform(
Vector3 arg) → Vector3 -
Transform
argof typeVector3using the perspective transformation defined bythis. -
relativeError(
Matrix4 correct) → double -
Returns relative error between
thisandcorrect -
rotate(
Vector3 axis, double angle) → void -
Rotate this
angleradians aroundaxis -
rotate3(
Vector3 arg) → Vector3 -
Rotate
argof typeVector3using the rotation defined bythis. -
rotated3(
Vector3 arg, [ Vector3 out ]) → Vector3 -
Rotate a copy of
argof typeVector3using the rotation defined bythis. If aoutparameter is supplied, the copy is stored inout. -
rotateX(
double angle) → void -
Rotate this
angleradians around X -
rotateY(
double angle) → void -
Rotate this matrix
angleradians around Y -
rotateZ(
double angle) → void -
Rotate this matrix
angleradians around Z -
scale(
x, [ double y, double z ]) → void -
Scale this matrix by a
Vector3,Vector4, or x,y,z -
scaleAdjoint(
double scale) → void -
Converts into Adjugate matrix and scales by
scale -
scaled(
x, [ double y = null, double z = null ]) → Matrix4 -
Create a copy of
thisscaled by aVector3,Vector4orx,y, andz. -
setColumn(
int column, Vector4 arg) → void -
Assigns the
columnof the matrixarg -
setColumns(
Vector4 arg0, Vector4 arg1, Vector4 arg2, Vector4 arg3) → void -
Sets the entire matrix to the column values.
-
setDiagonal(
Vector4 arg) → void -
Sets the diagonal of the matrix to be
arg. -
setEntry(
int row, int col, double v) → dynamic -
Set value at
row,colto bev. -
setFrom(
Matrix4 arg) → void -
Sets the entire matrix to the matrix in
arg. -
setFromTranslationRotation(
Vector3 arg0, Quaternion arg1) → void -
Sets the matrix from translation
arg0and rotationarg1. -
setFromTranslationRotationScale(
Vector3 translation, Quaternion rotation, Vector3 scale) → void -
Sets the matrix from
translation,rotationandscale. -
setIdentity(
) → void -
Makes
thisinto the identity matrix. -
setOuter(
Vector4 u, Vector4 v) → void -
setRotation(
Matrix3 r) → void -
Sets the rotation matrix in this homogeneous transformation matrix.
-
setRotationX(
double radians) → void -
Sets the upper 3x3 to a rotation of
radiansaround X -
setRotationY(
double radians) → void -
Sets the upper 3x3 to a rotation of
radiansaround Y -
setRotationZ(
double radians) → void -
Sets the upper 3x3 to a rotation of
radiansaround Z -
setRow(
int row, Vector4 arg) → void -
Assigns the
rowof the matrixarg -
setTranslation(
Vector3 t) → void -
Sets the translation vector in this homogeneous transformation matrix.
-
setTranslationRaw(
double x, double y, double z) → void -
Sets the translation vector in this homogeneous transformation matrix.
-
setUpper2x2(
Matrix2 arg) → void -
Sets the upper 2x2 of the matrix to be
arg. -
setValues(
double arg0, double arg1, double arg2, double arg3, double arg4, double arg5, double arg6, double arg7, double arg8, double arg9, double arg10, double arg11, double arg12, double arg13, double arg14, double arg15) → void -
Sets the matrix with specified values.
-
setZero(
) → void -
Zeros
this. -
splatDiagonal(
double arg) → void -
Sets the diagonal to
arg. -
sub(
Matrix4 o) → void -
Subtracts
ofromthis. -
toString(
) → String -
Returns a printable string
-
trace(
) → double -
Returns the trace of the matrix. The trace of a matrix is the sum of the diagonal entries.
-
transform(
Vector4 arg) → Vector4 -
Transform
argof typeVector4using the transformation defined bythis. -
transform3(
Vector3 arg) → Vector3 -
Transform
argof typeVector3using the transformation defined bythis. -
transformed(
Vector4 arg, [ Vector4 out ]) → Vector4 -
Transform a copy of
argof typeVector4using the transformation defined bythis. If aoutparameter is supplied, the copy is stored inout. -
transformed3(
Vector3 arg, [ Vector3 out ]) → Vector3 -
Transform a copy of
argof typeVector3using the transformation defined bythis. If aoutparameter is supplied, the copy is stored inout. -
translate(
x, [ double y = 0.0, double z = 0.0 ]) → void -
Translate this matrix by a
Vector3,Vector4, or x,y,z -
transpose(
) → void -
transposed(
) → Matrix4 -
Returns the tranpose of this.
-
transposeMultiply(
Matrix4 arg) → void -
Multiply a transposed
thiswitharg. -
transposeRotation(
) → void -
Transposes just the upper 3x3 rotation matrix.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited