]> git.tdb.fi Git - libs/gl.git/blobdiff - source/animationplayer.cpp
Also set uniforms in tick_stacked
[libs/gl.git] / source / animationplayer.cpp
index 6148ed006bd0ebdfe0e27b15c0971b2bc7f56ac9..ffb902a8f555e51ecd250c9a99422af8e9d35451 100644 (file)
@@ -71,6 +71,11 @@ bool AnimationPlayer::tick_single(ObjectSlot &slot, const Time::TimeDelta &dt)
        AnimationSlot &anim = slot.animations.front();
        anim.iterator += dt;
        obj.set_matrix(anim.iterator.get_matrix());
+
+       unsigned n_uniforms = anim.animation.get_n_uniforms();
+       for(unsigned i=0; i<n_uniforms; ++i)
+               obj.set_uniform(anim.animation.get_uniform_name(i), anim.iterator.get_uniform(i));
+
        if(slot.armature)
        {
                unsigned max_index = slot.armature->get_max_link_index();
@@ -88,6 +93,10 @@ bool AnimationPlayer::tick_stacked(ObjectSlot &slot, const Time::TimeDelta &dt)
        {
                i->iterator += dt;
                matrix *= i->iterator.get_matrix();
+
+               unsigned n_uniforms = i->animation.get_n_uniforms();
+               for(unsigned j=0; j<n_uniforms; ++j)
+                       slot.object.set_uniform(i->animation.get_uniform_name(j), i->iterator.get_uniform(j));
        }
        slot.object.set_matrix(matrix);