+ for(ObjectMap::iterator i=objects.begin(); i!=objects.end(); )
+ {
+ bool keep = false;
+ if(i->second.stacked)
+ keep = tick_stacked(i->second, dt);
+ else
+ keep = tick_single(i->second, dt);
+
+ if(!keep)
+ objects.erase(i++);
+ else
+ ++i;
+ }
+}
+
+bool AnimationPlayer::tick_single(ObjectSlot &slot, const Time::TimeDelta &dt)
+{
+ AnimatedObject &obj = slot.object;
+ AnimationSlot &anim = slot.animations.front();
+ anim.iterator += dt;
+ obj.set_matrix(anim.iterator.get_matrix());
+ if(slot.armature)
+ {
+ unsigned max_index = slot.armature->get_max_link_index();
+ for(unsigned i=0; i<=max_index; ++i)
+ obj.set_pose_matrix(i, anim.iterator.get_pose_matrix(i));
+ }
+
+ return !anim.iterator.is_end();
+}
+
+bool AnimationPlayer::tick_stacked(ObjectSlot &slot, const Time::TimeDelta &dt)
+{
+ Matrix matrix = slot.base_matrix;
+ for(AnimationList::iterator i=slot.animations.begin(); i!=slot.animations.end(); ++i)