Matrix4 class

Class representing a 4x4 matrix. The elements of the matrix are stored in column-major order.

@author {@link https://github.com/Mugen87|Mugen87}

Constructors

Matrix4()

Properties

elements Float32List
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clone() Matrix4
Creates a new matrix and copies all values from this matrix.
compose(Vector3 position, Quaternion rotation, Vector3 scale) Matrix4
Composes a matrix from the given position, quaternion and scale.
copy(Matrix4 m) Matrix4
Copies all values from the given matrix to this matrix.
equals(Matrix4 m) bool
Returns true if the given matrix is deep equal with this matrix.
extractBasis(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis) Matrix4
Extracts the basis vectors and stores them to the given vectors.
fromArray(List<double> array, [int offset = 0]) Matrix4
Sets the elements of this matrix from an array.
fromMatrix3(Matrix3 m) Matrix4
Sets the upper-left 3x3 portion of this matrix by the given 3x3 matrix. Other parts of the matrix are equal to the identiy matrix.
fromQuaternion(Quaternion q) Matrix4
Uses the given quaternion to transform the upper left 3x3 part to a rotation matrix. Other parts of the matrix are equal to the identiy matrix.
getInverse(Matrix4 m) Matrix4
Computes the inverse of this matrix and stored the result in the given matrix.
getMaxScale() double
Computes the maximum scale value for all three axis.
identity() Matrix4
Transforms this matrix to an identity matrix.
makeBasis(Vector3 xAxis, Vector3 yAxis, Vector3 zAxis) Matrix4
Makes a basis from the given vectors.
multiply(Matrix4 m) Matrix4
Multiplies this matrix with the given matrix.
multiplyMatrices(Matrix4 a, Matrix4 b) Matrix4
Multiplies two given matrices and stores the result in this matrix.
multiplyScalar(double s) Matrix4
Multiplies the given scalar with this matrix.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
premultiply(Matrix4 m) Matrix4
Multiplies this matrix with the given matrix. So the order of the multiplication is switched compared to {@link Matrix4#multiply}.
scale(Vector3 v) Matrix4
Scales this matrix by the given 3D vector.
set(double n11, double n12, double n13, double n14, double n21, double n22, double n23, double n24, double n31, double n32, double n33, double n34, double n41, double n42, double n43, double n44) Matrix4
Sets the given values to this matrix. The arguments are in row-major order.
setPosition(Vector3 v) Matrix4
Sets the translation part of the 4x4 matrix to the given position vector.
toArray(List<double> array, [int offset = 0]) List<double>
Copies all elements of this matrix to the given array.
toString() String
A string representation of this object.
inherited
transpose() Matrix4
Transposes this matrix.

Operators

operator ==(Object other) bool
The equality operator.
inherited