From 94311f9c4e82b7475802b1934cc0c5b243e0cd2f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 3 Mar 2021 00:08:47 +0000 Subject: Replace Transform with Location Simpler, unbinds the transformation matrices for location, now done just in the shader. --- gfx/gl/shader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gfx/gl/shader.cpp') diff --git a/gfx/gl/shader.cpp b/gfx/gl/shader.cpp index f30af5c..04d5ac6 100644 --- a/gfx/gl/shader.cpp +++ b/gfx/gl/shader.cpp @@ -8,6 +8,9 @@ #include #include #include +#include +#include +#include #include #include @@ -67,10 +70,11 @@ Shader::setUniform(const GLchar * uniform, glm::vec3 v) const } void -Shader::setModel(glm::mat4 model, Program pid) const +Shader::setModel(const Location & loc, Program pid) const { auto & prog = programs[(int)pid]; glUseProgram(prog.m_program); + const auto model {glm::translate(loc.pos) * rotate_ypr(loc.rot)}; glUniformMatrix4fv(prog.model_uniform, 1, GL_FALSE, &model[0][0]); } -- cgit v1.2.3