X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimationplayer.cpp;h=ac16321874a7abd612ad6cf39fdb69cf1fdb8cf4;hp=a929f3c233e846bcc39eedae496bbd7a860e0988;hb=HEAD;hpb=57fc4142e0b19a21f61c60b00f8310d5d2c27871 diff --git a/source/animationplayer.cpp b/source/animationplayer.cpp deleted file mode 100644 index a929f3c2..00000000 --- a/source/animationplayer.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "animatedobject.h" -#include "animationplayer.h" -#include "armature.h" - -using namespace std; - -namespace Msp { -namespace GL { - -void AnimationPlayer::play(AnimatedObject &obj, const Animation &anim) -{ - slots.push_back(Slot(obj, anim)); -} - -void AnimationPlayer::tick(const Time::TimeDelta &dt) -{ - for(list::iterator i=slots.begin(); i!=slots.end(); ) - { - i->iterator += dt; - i->object.set_matrix(i->iterator.get_matrix()); - if(const Armature *armature = i->animation.get_armature()) - { - unsigned max_index = armature->get_max_link_index(); - for(unsigned j=0; jobject.set_pose_matrix(j, i->iterator.get_pose_matrix(j)); - } - - if(i->iterator.is_end()) - slots.erase(i++); - else - ++i; - } -} - - -AnimationPlayer::Slot::Slot(AnimatedObject &o, const Animation &a): - object(o), - animation(a), - iterator(animation) -{ } - -} // namespace GL -} // namespace Msp