summaryrefslogtreecommitdiff
path: root/transform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'transform.cpp')
-rw-r--r--transform.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/transform.cpp b/transform.cpp
deleted file mode 100644
index 7b256af..0000000
--- a/transform.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "transform.h"
-#include "camera.h"
-#include <glm/gtx/transform.hpp>
-
-Transform::Transform(glm::vec3 pos, glm::vec3 rot, glm::vec3 scale) : pos {pos}, rot {rot}, scale {scale} { }
-
-glm::mat4
-Transform::GetModel() const
-{
- const auto posMat = glm::translate(pos);
- const auto scaleMat = glm::scale(scale);
- const auto rotX = glm::rotate(rot.x, glm::vec3(1.0, 0.0, 0.0));
- const auto rotY = glm::rotate(rot.y, glm::vec3(0.0, 1.0, 0.0));
- const auto rotZ = glm::rotate(rot.z, glm::vec3(0.0, 0.0, 1.0));
- const auto rotMat = rotX * rotY * rotZ;
-
- return posMat * rotMat * scaleMat;
-}
-
-glm::mat4
-Transform::GetMVP(const Camera & camera) const
-{
- const auto VP = camera.GetViewProjection();
- const auto M = GetModel();
-
- return VP * M;
-}