* @param fov The field of view in degrees
* @param aspectRatio The aspect ratio
* @return This matrix for the purpose of chaining methods together. */
public static Matrix4f setToProjection (Matrix4f m, float near, float far, float fov, float aspectRatio) {
if (m==null)
m = new Matrix4f();
m.setIdentity();
float l_fd = (float)(1.0 / Math.tan((fov * (Math.PI / 180)) / 2.0));
float l_a1 = (far + near) / (near - far);
float l_a2 = (2 * far * near) / (near - far);
m.m00 = l_fd / aspectRatio;