X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanimatedobject.cpp;h=390b90b869ce6acc9eb5a5a93a6fbe701776429e;hb=refs%2Fheads%2Fmaster;hp=0cc367861e905faa3023aa2d8a79dd266ef4f0cc;hpb=57fc4142e0b19a21f61c60b00f8310d5d2c27871;p=libs%2Fgl.git diff --git a/source/animatedobject.cpp b/source/animatedobject.cpp deleted file mode 100644 index 0cc36786..00000000 --- a/source/animatedobject.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include "animatedobject.h" -#include "object.h" -#include "programdata.h" -#include "renderer.h" -#include "technique.h" - -namespace Msp { -namespace GL { - -AnimatedObject::AnimatedObject(const Object &o): - ObjectInstance(o), - shdata(0) -{ - if(const Technique *tech = object.get_technique()) - { - // XXX Should create separate ProgramData for each pass - const RenderPass &pass = tech->get_pass(Tag()); - if(const Program *shprog = pass.get_shader_program()) - shdata = new ProgramData(*shprog); - } -} - -void AnimatedObject::set_matrix(const Matrix &m) -{ - matrix = m; -} - -void AnimatedObject::set_pose_matrix(unsigned link, const Matrix &m) -{ - if(shdata) - shdata->uniform_matrix4(format("pose[%d]", link), m); -} - -void AnimatedObject::setup_render(Renderer &renderer, const Tag &) const -{ - renderer.matrix_stack() *= matrix; - if(shdata) - renderer.add_shader_data(shdata); -} - -} // namespace GL -} // namespace Msp