APOCALYX is a...

free Game Engine based on OpenGL (MAIL) (SITE) (FORUM) (BLOG)

Monday, July 28, 2008

MDL smooth transitions

I received questions about the smooth transitions between different animations in MDL models. AS explained yesterday, they are only available in the preview of the next release. There are 3 additional functions:
  • number MDLModel:setTransition(number duration, number index, boolean looping = true, boolean reverse = false)

    This function starts the transition from the current frame of the current animation to the first frame of the specified animation. 'index' is the index of the next animation, 'duration' is the time necessary for the transition.

  • number MDLModel:getTransitionTimer()

    This function returns the current transition time, so one knows between 0 and 1 which portion of the transition was already completed.

  • number MDLModel:getStoppedTransition()

    This function returns the last stopped transition (-1 if no stop was reached yet). It is useful during the update() callback to know if the transition is terminated, so the programmer can start the new animation (in fact, the next animation does not start automatically, but on request).

Unluckily there is no demo yet that exemplifies the subject, but I'll include one when the next release will be published. Feel free to ask more explanations.

No comments: