From: Mikko Rasa Date: Tue, 14 Nov 2017 11:14:24 +0000 (+0200) Subject: Apply the matrix in ObjectInstance::setup_render X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d297f58d7de73cb92890540ece9ece5f953ebd8c;p=libs%2Fgl.git Apply the matrix in ObjectInstance::setup_render --- diff --git a/source/objectinstance.cpp b/source/objectinstance.cpp index b3fc133d..912ec05f 100644 --- a/source/objectinstance.cpp +++ b/source/objectinstance.cpp @@ -21,5 +21,10 @@ void ObjectInstance::render(Renderer &renderer, const Tag &tag) const object.render(renderer, *this, tag); } +void ObjectInstance::setup_render(Renderer &renderer, const Tag &) const +{ + renderer.transform(matrix); +} + } // namespace GL } // namespaec Msp diff --git a/source/objectinstance.h b/source/objectinstance.h index d85d2db8..906ba2f3 100644 --- a/source/objectinstance.h +++ b/source/objectinstance.h @@ -34,7 +34,7 @@ public: /** Hook function, called from Object just before rendering the mesh. Renderer state will have been pushed before this is called. */ - virtual void setup_render(Renderer &, const Tag &) const { } + virtual void setup_render(Renderer &, const Tag &) const; /** Hook function, called from Object right after rendering the mesh. Since Object takes care of pushing Renderer state, this rarely needs to do