diff options
-rw-r--r-- | gfx/gl/transform.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gfx/gl/transform.cpp b/gfx/gl/transform.cpp index 8aa118b..c7004ba 100644 --- a/gfx/gl/transform.cpp +++ b/gfx/gl/transform.cpp @@ -1,5 +1,6 @@ #include "transform.h" #include <glm/gtx/transform.hpp> +#include <maths.h> Transform::Transform(glm::vec3 pos, glm::vec3 rot) : pos {pos}, rot {rot} { } @@ -7,9 +8,9 @@ glm::mat4 Transform::GetModel() const { const auto posMat = glm::translate(pos); - 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 rotX = glm::rotate(rot.x, west); + const auto rotY = glm::rotate(rot.y, up); + const auto rotZ = glm::rotate(rot.z, north); return posMat * rotY * rotX * rotZ; } |