1 #include <msp/strings/format.h>
2 #include "animatedobject.h"
4 #include "programdata.h"
11 AnimatedObject::AnimatedObject(const Object &o):
15 if(const Technique *tech = object.get_technique())
17 // XXX Should create separate ProgramData for each pass
18 const RenderPass &pass = tech->get_pass(Tag());
19 if(const Program *shprog = pass.get_shader_program())
20 shdata = new ProgramData(*shprog);
24 void AnimatedObject::set_matrix(const Matrix &m)
29 void AnimatedObject::set_pose_matrix(unsigned link, const Matrix &m)
32 shdata->uniform_matrix4(format("pose[%d]", link), m);
35 void AnimatedObject::setup_render(Renderer &renderer, const Tag &) const
37 renderer.matrix_stack() *= matrix;
39 renderer.add_shader_data(shdata);