Builds a new Matrix4 from the following memory layout.
If you consider the matrix vector multiplication in line (V' = V x M), then the following matrix is built (translation [T0,T1,T2] on the bottom) :
| a | b | c | 0 (d) |
| e | f | g | 0 (h) |
| i | j | k | 0 (l) |
| T0 : m | T1 : n | T2 : o | 1 (p) |
| a | e | i | T0 : m |
| b | f | j | T1 : n |
| c | g | k | T2 : o |
| 0 (d) | 0 (h) | 0 (l) | 1 (p) |
The newly created Matrix4.
Optional a: numberOptional b: numberOptional c: numberOptional d: numberOptional e: numberOptional f: numberOptional g: numberOptional h: numberOptional i: numberOptional j: numberOptional k: numberOptional l: numberOptional m: numberOptional n: numberOptional o: numberOptional p: numberA 16 float array that contains the values of the matrix.
Gets the pColum th "column" of the matrix.
This function actually takes the column if the Matrix vector multiplication is in column : V' = M x V .
If you consider the matrix vector multiplication in column (V' = M x V, translation [T0,T1,T2] on the right) :
| a | e | i | T0 : m |
| b | f | j | T1 : n |
| c | g | k | T2 : o |
| 0 (d) | 0 (h) | 0 (l) | 1 (p) |
If you consider the matrix vector multiplication in line (V' = V x M, translation [T0,T1,T2] on the bottom) :
| a | b | c | 0 (d) |
| e | f | g | 0 (h) |
| i | j | k | 0 (l) |
| T0 : m | T1 : n | T2 : o | 1 (p) |
No check is done to ensure pColumn is in the range [0-3].
pOut.
Inverts the transformation and stores the result to pOut.
If the matrix "this" is non-invertible, then pOut stores a copy of "this".
If pOut is omitted, the result is stored in "this".
Returns pOut.
pOut.
Optional pOut: Matrix4Computes the composition of "this" and the matrix represented by the values Mval and stores the result in pOut.
Any point P transformed by the resulting transformation will first be multiplied by "this", and then Mval.
Be P' the transformed point of P :
Depending on your convention : P' = Mval x this x P (hence multiply left)
or P' = P x this x Mval.
If pOut is omitted, the result is stored in "this".
If you consider the matrix vector multiplication in line (V' = V x Mval), then Mval is set to (translation [T0,T1,T2] on the bottom) :
| a | b | c | 0 (d) |
| e | f | g | 0 (h) |
| i | j | k | 0 (l) |
| T0 : m | T1 : n | T2 : o | 1 (p) |
| a | e | i | T0 : m |
| b | f | j | T1 : n |
| c | g | k | T2 : o |
| 0 (d) | 0 (h) | 0 (l) | 1 (p) |
this.multiplyMatrixLeft(pSecondTransform, pOut);
this.multiplyLeft(
pSecondTransform.array[0], pSecondTransform.array[1], pSecondTransform.array[2], pSecondTransform.array[3],
pSecondTransform.array[4], pSecondTransform.array[5], pSecondTransform.array[6], pSecondTransform.array[7],
pSecondTransform.array[8], pSecondTransform.array[9], pSecondTransform.array[10], pSecondTransform.array[11],
pSecondTransform.array[12], pSecondTransform.array[13], pSecondTransform.array[14], pSecondTransform.array[15],
pOut
);
pOut.
Optional pOut: Matrix4Computes the composition of "this" and pSecondTransform and stores the result in pOut.
Any point P transformed by the resulting transformation will first be multiplied by "this", and then pSecondTransform.
Be P' the transformed point of P :
Depending on your convention : P' = pSecondTransform x this x P (hence multiply left)
or P' = P x this x pSecondTransform.
If pOut is omitted, the result is stored in "this".
pOut.
Computes the composition of pFirstTransform and "this" and stores the result in pOut.
Any point P transformed by the resulting transformation will first be multiplied by pFirstTransform, and then "this".
Be P' the transformed point of P :
Depending on your convention : P' = this x pFirstTransform x P (hence multiply right)
or P' = P x pFirstTransform x this.
If pOut is omitted, the result is stored in "this".
pOut.
Computes the composition of the matrix represented by the values Mval and "this" and stores the result in pOut.
Any point P transformed by the resulting transformation will first be multiplied by Mval, and then "this".
Be P' the transformed point of P :
Depending on your convention : P' = this x Mval x P (hence multiply right)
or P' = P x Mval x this.
If pOut is omitted, the result is stored in "this".
If you consider the matrix vector multiplication in line (V' = V x Mval), then Mval is set to (translation [T0,T1,T2] on the bottom) :
| a | b | c | 0 (d) |
| e | f | g | 0 (h) |
| i | j | k | 0 (l) |
| T0 : m | T1 : n | T2 : o | 1 (p) |
| a | e | i | T0 : m |
| b | f | j | T1 : n |
| c | g | k | T2 : o |
| 0 (d) | 0 (h) | 0 (l) | 1 (p) |
this.multiplyMatrixRight(pFirstTransform, pOut);
this.multiplyRight(
pFirstTransform.array[0], pFirstTransform.array[1], pFirstTransform.array[2], pFirstTransform.array[3],
pFirstTransform.array[4], pFirstTransform.array[5], pFirstTransform.array[6], pFirstTransform.array[7],
pFirstTransform.array[8], pFirstTransform.array[9], pFirstTransform.array[10], pFirstTransform.array[11],
pFirstTransform.array[12], pFirstTransform.array[13], pFirstTransform.array[14], pFirstTransform.array[15],
pOut
);
pOut.
Optional pOut: Matrix4Computes the transformation of the vector pDirection by "this" matrix, and stores the result in pOut.
pDirection is considered a direction and thus, this is equivalent to using
multiplyVector4XYZW(pPoint[0],pPoint[1],pPoint[2],0).
If pOut is omitted, then pDirection is changed in place.
Returns pOut.
pOut.
Computes the transformation of the vector (pX,pY,pZ) by "this" matrix, and stores the result in pOut.
(pX,pY,pZ) is considered a direction and thus, this is equivalent to using multiplyVector4XYZW(pX,pY,pZ,0).
Returns pOut.
pOut.
x coordinate of the vector3 to transform.y coordinate of the vector3 to transform.z coordinate of the vector3 to transform.Computes the transformation of the vector pPoint by "this" matrix, and stores the result in pOut.
pPoint is considered a point and thus, this is equivalent to using
multiplyVector4XYZW(pPoint[0],pPoint[1],pPoint[2],1), and computing the homogeneous coordinates of the
resulting Vector4 (i.e. dividing all coordinates by the w coordinate of the vector4).
If pOut is omitted, then pPoint is changed in place.
Returns pOut.
pOut.
Computes the transformation of the vector (pX,pY,pZ) by "this" matrix, and stores the result in pOut.
The vector (pX,pY,pZ) is considered a point and thus, this is equivalent to using multiplyVector4XYZW(pX,pY,pZ,1), and computing the homogeneous coordinates of the resulting Vector4 (i.e. dividing all coordinates by the w coordinate of the vector4).
Returns pOut.
pOut.
x coordinate of the vector3 to transform.y coordinate of the vector3 to transform.z coordinate of the vector3 to transform.Computes the transformation of the vector (pX,pY,pZ,pW) by "this" matrix, and stores the result in pOut.
Returns pOut.
pOut.
y coordinate of the vector4 to transform.z coordinate of the vector4 to transform.w coordinate of the vector4 to transform.Computes the rotation of "this" around the X axis and stores the result in pOut.
This computes the composition of "this" and the rotation of pAngle around X.
Any point P transformed by the resulting transformation will first be multiplied by "this", and then the
rotation around X.
Be P' the transformed point of P, and Rx the rotation around X :
Depending on your convention : P' = Rx x this x P
or P' = P x this x Rx.
If pOut is omitted, the result is stored in "this".
pOut.
Optional pOut: Matrix4Computes the rotation of "this" around the Y axis and stores the result in pOut.
This computes the composition of "this" and the rotation of pAngle around Y.
Any point P transformed by the resulting transformation will first be multiplied by "this", and then the
rotation around Y.
Be P' the transformed point of P, and Ry the rotation around Y :
Depending on your convention : P' = Ry x this x P
or P' = P x this x Ry.
If pOut is omitted, the result is stored in "this".
pOut.
Optional pOut: Matrix4Computes the rotation of "this" around the Z axis and stores the result in pOut.
This computes the composition of "this" and the rotation of pAngle around Z.
Any point P transformed by the resulting transformation will first be multiplied by "this", and then the
rotation around Z.
Be P' the transformed point of P, and Rz the rotation around Z :
Depending on your convention : P' = Rz x this x P
or P' = P x this x Rz.
If pOut is omitted, the result is stored in "this".
pOut.
Optional pOut: Matrix4Sets values for the matrix.
If you consider the matrix vector multiplication in line (V' = V x M), then the following matrix is set (translation [T0,T1,T2] on the bottom) :
| a | b | c | 0 (d) |
| e | f | g | 0 (h) |
| i | j | k | 0 (l) |
| T0 : m | T1 : n | T2 : o | 1 (p) |
| a | e | i | T0 : m |
| b | f | j | T1 : n |
| c | g | k | T2 : o |
| 0 (d) | 0 (h) | 0 (l) | 1 (p) |
this.
Optional a: numberOptional b: numberOptional c: numberOptional d: numberOptional e: numberOptional f: numberOptional g: numberOptional h: numberOptional i: numberOptional j: numberOptional k: numberOptional l: numberOptional m: numberOptional n: numberOptional o: numberOptional p: numberSets the matrix to be the rotation from the given quaternion values [pX,pY,pZ,pW].
this.
x component of the quaternion.y component of the quaternion.z component of the quaternion.w component of the quaternion.Resets the matrix to be a translation.
The rotation/scale part is set to the identity.
this.
x component of the translation.y component of the translation.z component of the translation.
A 4x4 Matrix.
Such a matrix contains a translation and a rotation/scale part. The matrix contains an array of 16 floats, which memory layout is the following.
If you consider the vector (V) matrix (M) multiplication in line : V' = V x M then the memory layout of the matrix is the following, with the translation part [T0,T1,T2] on the bottom :
If on the contrary you consider the vector (V) matrix (M) multiplication in column : V' = M x V then the memory layout of the matrix is the following, with the translation part [T0,T1,T2] on the right :
The multiplication in column is the convention adopted in the Matrix4 class, when a matrix M2 is multiplied on the left of M1, then any point P transformed by the resulting transformation (P') will be first transformed by M1 and then M2 :
P' = M2 x M1 x P.