<commit_before>package de.lessvoid.coregl;


import org.lwjgl.util.vector.Matrix4f;

public class MatrixFactory {
  public Matrix4f createProjection(final float width, final float height) {
    float left = 0;
    float right = width;
    float top = 0;
    float bottom = height;
    float zNear = -9999;
    float zFar = 9999;

    Matrix4f projection = new Matrix4f();
    projection.m00 = 2 / (right-left);
    projection.m30 = - (right+left) / (right-left);
    projection.m11 = 2 / (top-bottom);
    projection.m31 = - (top+bottom) / (top-bottom);
    projection.m22 = -2 / (zFar-zNear);
    projection.m32 = - (zFar+zNear) / (zFar-zNear);
    projection.m33 = 1;
    return projection;
  }
}<commit_msg>add ortho projection to MatrixFactory and made methods static<commit_after>package de.lessvoid.coregl;


import org.lwjgl.util.vector.Matrix4f;

public class MatrixFactory {
  public static Matrix4f createOrtho(final float width, final float height) {
    float left = 0;
    float right = width;
    float top = 0;
    float bottom = height;
    float zNear = -9999;
    float zFar = 9999;

    Matrix4f projection = new Matrix4f();
    projection.m00 = 2 / (right-left);
    projection.m30 = - (right+left) / (right-left);
    projection.m11 = 2 / (top-bottom);
    projection.m31 = - (top+bottom) / (top-bottom);
    projection.m22 = -2 / (zFar-zNear);
    projection.m32 = - (zFar+zNear) / (zFar-zNear);
    projection.m33 = 1;
    return projection;
  }

  public static Matrix4f createProjection(final float width, final float height) {
    float left = 0;
    float right = width;
    float top = 0;
    float bottom = height;
    float zNear = 1;
    float zFar = 10000;

    Matrix4f projection = new Matrix4f();
    projection.m00 = 2 * zNear / (right-left);
    projection.m20 = (right+left) / (right-left);
    projection.m11 = 2 * zNear / (top-bottom);
    projection.m21 = (top+bottom) / (top-bottom);
    projection.m22 = -(zFar + zNear) / (zFar-zNear);
    projection.m32 = - 2 * zFar * zNear / (zFar-zNear);
    projection.m23 = -1;
    return projection;
  }

}
{'fraction_non_alphanumeric': 0.12972714217328865, 'fraction_numerical': 0.04451890856869316, 'mean_word_length': 2.793103448275862, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4621621', 'n_tokens_mistral': 800, 'n_tokens_neox': 730, 'n_words': 185}