From e4caa1251ae452c380804ce518226abfdf1ede83 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 14 Feb 2021 15:12:46 +0000 Subject: Use consts for Transform --- gfx/gl/transform.cpp | 7 ++++--- 1 file 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 +#include 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; } -- cgit v1.2.3