Matrix4 class
4D Matrix. Values are stored in column major order.
- Available extensions
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 Float32List.bytesPerElement.
- Matrix4.fromFloat32List(Float32List _m4storage)
- Constructs Matrix4 with given Float32List 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 radiansaround X.factory
- Matrix4.rotationY(double radians)
- 
          Rotation of radiansaround Y.factory
- Matrix4.rotationZ(double radians)
- 
          Rotation of radiansaround 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.
  no setter
- forward → Vector3
- 
  
  no setter
- hashCode → int
- 
  The hash code for this object.
  no setteroverride
- m11 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A first row and first column value.no setter
- m12 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A first row and second column value.no setter
- m13 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A first row and third column value.no setter
- m14 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A first row and fourth column value.no setter
- m21 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A second row and first column value.no setter
- m22 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A second row and second column value.no setter
- m23 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A second row and third column value.no setter
- m24 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A second row and fourth column value.no setter
- m31 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A third row and first column value.no setter
- m32 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A third row and second column value.no setter
- m33 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A third row and third column value.no setter
- m34 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A third row and fourth column value.no setter
- m41 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A fourth row and first column value.no setter
- m42 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A fourth row and second column value.no setter
- m43 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A fourth row and third column value.no setter
- m44 → double
- 
      Available on Matrix4, provided by the Matrix4Extension extension A fourth row and fourth column value.no setter
- right → Vector3
- 
  
  no setter
- row0 ↔ Vector4
- 
  Returns row 0
  getter/setter pair
- row1 ↔ Vector4
- 
  Returns row 1
  getter/setter pair
- row2 ↔ Vector4
- 
  Returns row 2
  getter/setter pair
- row3 ↔ Vector4
- 
  Returns row 3
  getter/setter pair
- runtimeType → Type
- 
  A representation of the runtime type of the object.
  no setterinherited
- storage → Float32List
- 
  The components of the matrix.
  no setter
- up → Vector3
- 
  
  no setter
Methods
- 
  absolute() → Matrix4 
- Returns the component wise absolute value of this.
- 
  absoluteError(Matrix4 correct) → double 
- 
  Returns absolute error between this and correct
- 
  absoluteRotate(Vector3 arg) → Vector3 
- 
  Rotates argby the absolute rotation of this Returnsarg. Primarily used by AABB transformation code.
- 
  add(Matrix4 o) → void 
- 
  Adds oto this.
- 
  applyToVector3Array(List< double> array, [int offset = 0]) → List<double> 
- 
  Multiply this to each set of xyz values in arraystarting atoffset.
- 
  clone() → Matrix4 
- Clone matrix.
- 
  copyFromArray(List< double> array, [int offset = 0]) → void
- 
  Copies elements from arrayinto this starting atoffset.
- 
  copyInto(Matrix4 arg) → Matrix4 
- 
  Copy into arg.
- 
  copyIntoArray(List< num> array, [int offset = 0]) → void
- 
  Copies this into arraystarting 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 this into translation,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.
- 
  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 
- 
  isIdentity() → bool 
- Is this the identity matrix?
- 
  isZero() → bool 
- Is this the zero matrix?
- 
  leftTranslate(dynamic x, [double y = 0.0, double z = 0.0]) → void 
- Multiply this by a translation from the left.
- 
  leftTranslateByDouble(double tx, double ty, double tz, double tw) → void 
- Multiply this by a translation from the left.
- 
  leftTranslateByVector3(Vector3 v3) → void 
- Multiply this by a translation from the left.
- 
  leftTranslateByVector4(Vector4 v4) → void 
- Multiply this by a translation from the left.
- 
  multiplied(Matrix4 arg) → Matrix4 
- 
  Multiply a copy of this with arg.
- 
  multiply(Matrix4 arg) → void 
- 
  Multiply this by arg.
- 
  multiplyTranspose(Matrix4 arg) → void 
- 
  Multiply this with a transposed arg.
- 
  negate() → void 
- Negate this.
- 
  noSuchMethod(Invocation invocation) → dynamic 
- 
  Invoked when a nonexistent method or property is accessed.
  inherited
- 
  perspectiveTransform(Vector3 arg) → Vector3 
- 
  Transform argof type Vector3 using the perspective transformation defined by this.
- 
  relativeError(Matrix4 correct) → double 
- 
  Returns relative error between this and correct
- 
  rotate(Vector3 axis, double angle) → void 
- 
  Rotate this angleradians aroundaxis
- 
  rotate3(Vector3 arg) → Vector3 
- 
  Rotate argof type Vector3 using the rotation defined by this.
- 
  rotated3(Vector3 arg, [Vector3? out]) → Vector3 
- 
  Rotate a copy of argof type Vector3 using the rotation defined by this. 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(dynamic x, [double? y, double? z]) → void 
- Scale this matrix by a Vector3, Vector4, or x,y,z as doubles.
- 
  scaleAdjoint(double scale) → void 
- 
  Converts into Adjugate matrix and scales by scale
- 
  scaleByDouble(double sx, double sy, double sz, double sw) → void 
- Scale this matrix.
- 
  scaleByDouble(double sx, double sy, double sz, double sw) → void 
- 
      Available on Matrix4, provided by the Matrix4Extension extension 
- 
  scaleByVector3(Vector3 v3) → void 
- Scale this matrix.
- 
  scaleByVector3(Vector3 vector) → void 
- 
      Available on Matrix4, provided by the Matrix4Extension extension 
- 
  scaleByVector4(Vector4 v4) → void 
- Scale this matrix.
- 
  scaled(dynamic x, [double? y, double? z]) → Matrix4 
- 
  Create a copy of this scaled by a Vector3, Vector4 or x,y, andz.
- 
  scaledByDouble(double x, double y, double z, double t) → Matrix4 
- 
  Create a copy of this scaled by x,y,z, andt.
- 
  scaledByVector3(Vector3 v3) → Matrix4 
- Create a copy of this scaled by a Vector3.
- 
  scaledByVector4(Vector4 v4) → Matrix4 
- Create a copy of this scaled by a Vector4.
- 
  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) → void 
- 
  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 this into 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 ofrom this.
- 
  toString() → String 
- 
  Returns a printable string
  override
- 
  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 type Vector4 using the transformation defined by this.
- 
  transform2(Vector2 position) → Vector2 
- 
      Available on Matrix4, provided by the Matrix4Extension extension Transformpositionof type Vector2 using the transformation defined by this.
- 
  transform3(Vector3 arg) → Vector3 
- 
  Transform argof type Vector3 using the transformation defined by this.
- 
  transformed(Vector4 arg, [Vector4? out]) → Vector4 
- 
  Transform a copy of argof type Vector4 using the transformation defined by this. If aoutparameter is supplied, the copy is stored inout.
- 
  transformed2(Vector2 position, [Vector2? out]) → Vector2 
- 
      Available on Matrix4, provided by the Matrix4Extension extension Transform a copy ofpositionof type Vector2 using the transformation defined by this. If aoutparameter is supplied, the copy is stored inout.
- 
  transformed3(Vector3 arg, [Vector3? out]) → Vector3 
- 
  Transform a copy of argof type Vector3 using the transformation defined by this. If aoutparameter is supplied, the copy is stored inout.
- 
  translate(dynamic x, [double y = 0.0, double z = 0.0]) → void 
- Translate this matrix by a Vector3, Vector4, or x,y,z as doubles.
- 
  translate2(Vector2 vector) → void 
- 
      Available on Matrix4, provided by the Matrix4Extension extension Translate this matrix by a Vector2.
- 
  translateByDouble(double tx, double ty, double tz, double tw) → void 
- Translate this matrix by x, y, z, w.
- 
  translateByDouble(double tx, double ty, double tz, double tw) → void 
- 
      Available on Matrix4, provided by the Matrix4Extension extension 
- 
  translateByVector3(Vector3 v3) → void 
- Translate this matrix by a Vector3.
- 
  translateByVector4(Vector4 v4) → void 
- Translate this matrix by a Vector4.
- 
  transpose() → void 
- 
  transposed() → Matrix4 
- Returns the tranpose of this.
- 
  transposeMultiply(Matrix4 arg) → void 
- 
  Multiply a transposed this with arg.
- 
  transposeRotation() → void 
- Transposes just the upper 3x3 rotation matrix.
Operators
- 
  operator *(dynamic arg) → dynamic 
- 
  Returns a new vector or matrix by multiplying this with arg.
- 
  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 ==(Object other) → bool 
- 
  Check if two matrices are the same.
  override
- 
  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
Static Methods
- 
  solve(Matrix4 A, Vector4 x, Vector4 b) → void 
- 
  Solve A*x=b.
- 
  solve2(Matrix4 A, Vector2 x, Vector2 b) → void 
- 
  Solve A*x=b.
- 
  solve3(Matrix4 A, Vector3 x, Vector3 b) → void 
- 
  Solve A*x=b.
- 
  tryInvert(Matrix4 other) → Matrix4? 
- 
  Returns a matrix that is the inverse of otherifotheris invertible, otherwisenull.