X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimationplayer.cpp;h=ac16321874a7abd612ad6cf39fdb69cf1fdb8cf4;hp=9bcb5e5720872d006b28ac6f8a9c1dec7421c26b;hb=HEAD;hpb=164d77011ab4ebe76c9bf2b7ed8d8dd8ebc20e61 diff --git a/source/animationplayer.cpp b/source/animationplayer.cpp deleted file mode 100644 index 9bcb5e57..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; j<=max_index; ++j) - i->object.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