diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-14 15:00:50 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-02-14 15:00:50 +0000 |
commit | c8813a31a2a8cd7cc8b4b15fec67e33363d08b52 (patch) | |
tree | 77184e7da652f19f942aafe013cbf62922d927b9 /gfx | |
parent | Clear input stack on exit (diff) | |
download | ilt-c8813a31a2a8cd7cc8b4b15fec67e33363d08b52.tar.bz2 ilt-c8813a31a2a8cd7cc8b4b15fec67e33363d08b52.tar.xz ilt-c8813a31a2a8cd7cc8b4b15fec67e33363d08b52.zip |
Remove unused scale component from Transform
Diffstat (limited to 'gfx')
-rw-r--r-- | gfx/gl/transform.cpp | 6 | ||||
-rw-r--r-- | gfx/gl/transform.h | 15 |
2 files changed, 3 insertions, 18 deletions
diff --git a/gfx/gl/transform.cpp b/gfx/gl/transform.cpp index b7230f7..8aa118b 100644 --- a/gfx/gl/transform.cpp +++ b/gfx/gl/transform.cpp @@ -1,17 +1,15 @@ #include "transform.h" #include <glm/gtx/transform.hpp> -Transform::Transform(glm::vec3 pos, glm::vec3 rot, glm::vec3 scale) : pos {pos}, rot {rot}, scale {scale} { } +Transform::Transform(glm::vec3 pos, glm::vec3 rot) : pos {pos}, rot {rot} { } 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 = rotY * rotX * rotZ; - return posMat * rotMat * scaleMat; + return posMat * rotY * rotX * rotZ; } diff --git a/gfx/gl/transform.h b/gfx/gl/transform.h index f8d8d0d..61b571d 100644 --- a/gfx/gl/transform.h +++ b/gfx/gl/transform.h @@ -5,7 +5,7 @@ class Transform {
public:
- explicit Transform(glm::vec3 pos = {}, glm::vec3 rot = {}, glm::vec3 scale = {1.0F, 1.0F, 1.0F});
+ explicit Transform(glm::vec3 pos = {}, glm::vec3 rot = {});
[[nodiscard]] glm::mat4 GetModel() const;
@@ -33,12 +33,6 @@ public: return rot;
}
- [[nodiscard]] inline glm::vec3 &
- GetScale()
- {
- return scale;
- }
-
inline void
SetPos(glm::vec3 && pos)
{
@@ -51,16 +45,9 @@ public: this->rot = rot;
}
- inline void
- SetScale(glm::vec3 && scale)
- {
- this->scale = scale;
- }
-
private:
glm::vec3 pos;
glm::vec3 rot;
- glm::vec3 scale;
};
#endif
|