summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gfx/gl/shadowMapper.cpp7
-rw-r--r--gfx/gl/shadowMapper.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/gfx/gl/shadowMapper.cpp b/gfx/gl/shadowMapper.cpp
index 1787ee6..7649a54 100644
--- a/gfx/gl/shadowMapper.cpp
+++ b/gfx/gl/shadowMapper.cpp
@@ -184,6 +184,13 @@ void
ShadowMapper::DynamicPoint::use(const Location & location) const
{
glUseProgram(*this);
+ setModel(location);
+ const auto model = glm::translate(location.pos) * rotate_ypr(location.rot);
+ glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model));
+}
+void
+ShadowMapper::DynamicPoint::setModel(const Location & location) const
+{
const auto model = glm::translate(location.pos) * rotate_ypr(location.rot);
glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model));
}
diff --git a/gfx/gl/shadowMapper.h b/gfx/gl/shadowMapper.h
index b4793ed..a5c2c7b 100644
--- a/gfx/gl/shadowMapper.h
+++ b/gfx/gl/shadowMapper.h
@@ -34,6 +34,7 @@ public:
DynamicPoint();
void setViewProjection(const glm::mat4 &) const;
void use(const Location &) const;
+ void setModel(const Location &) const;
private:
RequiredUniformLocation viewProjectionLoc;