diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-04 15:18:32 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-04 15:18:32 +0000 |
commit | 7fc588638feb1a83ab58f78f9e2a9d0d23a083e0 (patch) | |
tree | 6f04693eb61ed14f99b5f4f0ffc3f0b5d9b738a5 /gfx/gl/shadowMapper.cpp | |
parent | Load length, wheelBase and maxSpeed RailVehicleClass properties from XML (diff) | |
download | ilt-7fc588638feb1a83ab58f78f9e2a9d0d23a083e0.tar.bz2 ilt-7fc588638feb1a83ab58f78f9e2a9d0d23a083e0.tar.xz ilt-7fc588638feb1a83ab58f78f9e2a9d0d23a083e0.zip |
DynamicPoint shadow render now supports updating the position without calling use again
Diffstat (limited to 'gfx/gl/shadowMapper.cpp')
-rw-r--r-- | gfx/gl/shadowMapper.cpp | 7 |
1 files changed, 7 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)); } |