Matrix4
Represents a 4x4 matrix.
The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix: translation, rotation, shear, scale, reflection, or an orthographic or perspective projection. You apply it to a vector by multiplication.
Row-major and column-major ordering: set takes its arguments in row-major order, so a literal in source reads the way you would write the matrix on paper. The values are stored in elements in column-major order. There is no element constructor; use Matrix4().set(...).
Matrices are mutable and not thread-safe. Use each instance from one thread only. Most methods change this and return it for chaining.
Properties
Functions
Sets this matrix to the transformation composed of the given position, rotation (quaternion) and scale.
Copies the translation component of the given matrix m into this matrix's translation component.
Decomposes this matrix into its position, rotation (quaternion) and scale components and stores the result in the given objects.
Computes and returns the determinant of this matrix.
Returns the determinant of the upper-left 3x3 block only.
Extracts the basis of this matrix into the three axis vectors provided.
Extracts the rotation component of the given matrix m into this matrix's rotation component.
Returns the maximum scale value of the three axes.
Sets this matrix to an orthographic projection.
Sets this matrix to a perspective projection.
Sets the rotation component (the upper-left 3x3 matrix) of this matrix to the rotation specified by the given Euler angles euler. The rest of the matrix is set to the identity. Depending on the Euler.order, there are six possible outcomes.
Sets the rotation component of this matrix to the rotation specified by the given Quaternion q. The rest of the matrix is set to the identity.
Sets this matrix as a rotational transformation around the X axis by the given angle theta (in radians).
Sets this matrix as a rotational transformation around the Y axis by the given angle theta (in radians).
Sets this matrix as a rotational transformation around the Z axis by the given angle theta (in radians).
Sets this matrix as a translation transform from the given vector v.
Sets this matrix as a translation transform.
Multiplies every component of the matrix by the given scalar s.
Pre-multiplies this matrix by the given 4x4 matrix m.
Sets the elements of the matrix. The arguments are supposed to be in row-major order.
Sets the upper 3x3 elements of this matrix to the values of the given 3x3 matrix m.
Sets the position component of this matrix from the given vector v, without affecting the rest of the matrix.
Sets the position component of this matrix from the given components, without affecting the rest of the matrix.