summary refs log tree commit diff
path: root/src/Math/MVP.cpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-07-08 03:25:44 +0200
committerMel <einebeere@gmail.com>2023-07-08 03:25:44 +0200
commitfe2baedc760c2f29e2c720f6b1132a2de33c5430 (patch)
treedfbe1c72a17805a3cab6e0d47433e9021890c9ca /src/Math/MVP.cpp
parent41fbca10f6c6cdd9c1623f1347e7ecb40f5e7f59 (diff)
downloadmeowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.tar.zst
meowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.zip
Use own size types
Diffstat (limited to 'src/Math/MVP.cpp')
-rw-r--r--src/Math/MVP.cpp51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/Math/MVP.cpp b/src/Math/MVP.cpp
index de771d3..2f00b8e 100644
--- a/src/Math/MVP.cpp
+++ b/src/Math/MVP.cpp
@@ -4,56 +4,5 @@
 
 namespace Math::MVP {
 
-Matrix<4, 4> model(Vector<3> position, Rotation angles) {
-    auto transformation = Matrix<4, 4>::transformation(position);
-    auto rotation = Matrix<4, 4>::rotation(angles);
-
-    return transformation * rotation;
-}
-
-Matrix<4, 4> view(Vector<3> position, Rotation angles) {
-    auto rotation = Matrix<4, 4>::rotation(angles);
-    auto transformation = Matrix<4, 4>::transformation(-position);
-
-    return rotation * transformation;
-}
-
-Matrix<4, 4> perspective_projection(float aspect, float fov, float near, float far) {
-    auto fov_radians = radians(fov);
-
-    float x_scale = 1.0f / (tan(fov_radians / 2.0f) * aspect);
-    float y_scale = 1.0f / tan(fov_radians / 2.0f);
-
-    float frustum_length = far - near;
-    float z_near = -(far + near) / frustum_length;
-    float z_far = -(2 * far * near) / frustum_length;
-
-    Matrix<4, 4> projection{
-        x_scale, 0.0f,    0.0f,   0.0f,
-        0.0f,    y_scale, 0.0f,   0.0f,
-        0.0f,    0.0f,    z_near, z_far,
-        0.0f,    0.0f,    -1.0f,   0.0f,
-    };
-
-    return projection;
-}
-
-Matrix<4, 4> orthographic_projection(float width, float height, float near, float far) {
-    float x_scale = 2.0f / width;
-    float y_scale = 2.0f / -height;
-
-    float frustum_length = far - near;
-    float z_near = -(far + near) / frustum_length;
-    float z_far = -2 / frustum_length;
-
-    Matrix<4, 4> projection{
-            x_scale, 0.0f,    0.0f,   -1.0f,
-            0.0f,    y_scale, 0.0f,   1.0f,
-            0.0f,    0.0f,    z_near, z_far,
-            0.0f,    0.0f,    0.0f,   1.0f,
-    };
-
-    return projection;
-}
 
 }