Animation

During our first project we wanted to use animations. This wasn’t really the norm, as we were going to be issued a animationhandler, but not until the next project. So the task of implementing our own system fell to me…. So….. Anyways here’s a bunch of pictures & text concerning its implementation : ) .

In our engine, we have a bunch of support classes for the animation system.

The Animator is the main calculator for bone transforms & such, and is responsible for importing the bone data from fbx files, and constructing internal representations of them.

The way I implemented additive blend was to calculate the relevant keyframe in a regular fashion, and then substract each bone’s corresponding bind pose transform from it. What was left is then added on top of whatever is in the current node’s local transform. — Of course we had to have our animator André Rondahl make animations specifically intended for that purpose.

With that we could do cool things like this:

Animation is a container class used by Animator to store animations. It contains all the keyframe data. They also contain the functionality of calculating keyframe transforms at a point in time & interpolating between them.

Finally, there’s the AnimationController. This is owned by every model instance and is responsible for storing instance related data such as active animations & current bone transforms aswell as bone attachés.

The animation controller has some interesting functionality. One would be that it allows dynamic attach & detach of other model instances to one of it’s (Animators) bones.

Another one would be automatic merge blending. This is done using a stored history of active animations, that is then interpolated from.

This made for smoother transitions:

Versus snapping:

That’s pretty much all the interesting stuff.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s