# libgdx/libgdx

Switch branches/tags
Nothing to show
238fe1d Sep 20, 2016
18 contributors

### Users who have contributed to this file

1568 lines (1428 sloc) 65.3 KB
* Matrix4 mat = new Matrix4().trn(position).mul(camera.combined);
*
* A.mul(B) results in A := AB.
*
* * @param matrix The other matrix to multiply by. * @return This matrix for the purpose of chaining operations together. */ public Matrix4 mul (Matrix4 matrix) { mul(val, matrix.val); return this; } /** Premultiplies this matrix with the given matrix, storing the result in this matrix. For example: * *
* A.mulLeft(B) results in A := BA.
*
*      [  M00  M01   0   M02  ]
*      [  M10  M11   0   M12  ]
*      [   0    0    1    0   ]
*      [   0    0    0    1   ]
*
* @param affine the affine matrix * @return This matrix for chaining */ public Matrix4 set (Affine2 affine) { val[M00] = affine.m00; val[M10] = affine.m10; val[M20] = 0; val[M30] = 0; val[M01] = affine.m01; val[M11] = affine.m11; val[M21] = 0; val[M31] = 0; val[M02] = 0; val[M12] = 0; val[M22] = 1; val[M32] = 0; val[M03] = affine.m02; val[M13] = affine.m12; val[M23] = 0; val[M33] = 1; return this; } /** Assumes that this matrix is a 2D affine transformation, copying only the relevant components. The values are mapped as * follows: * *
*      [  M00  M01   _   M02  ]
*      [  M10  M11   _   M12  ]
*      [   _    _    _    _   ]
*      [   _    _    _    _   ]
*
* @param affine the source matrix * @return This matrix for chaining */ public Matrix4 setAsAffine (Affine2 affine) { val[M00] = affine.m00; val[M10] = affine.m10; val[M01] = affine.m01; val[M11] = affine.m11; val[M03] = affine.m02; val[M13] = affine.m12; return this; } /** Assumes that both matrices are 2D affine transformations, copying only the relevant components. The copied values are: * *
*      [  M00  M01   _   M03  ]
*      [  M10  M11   _   M13  ]
*      [   _    _    _    _   ]
*      [   _    _    _    _   ]
*