In CVS I’ve just added a new feature to the animation engine: spline interpolation. This makes all the elements of an animation (position, scale and rotation) change along a spline rather than along a straight line. This can make an animation look alot nicer, and it is especially important for animation of SceneNodes.

Some of you might not have realised, but the way the skeletal animation is implemented in OGRE is very flexible, in that AnimationTrack instances can animate any type of Node, not just Bone objects. I slipped in an extra interface in SceneManager that lets you create and manage scene-level animations, which you can then use to create AnimationTracks tied to SceneNode objects. You can then add keyframes however you like and get the animation to script the whole thing for you. Nice! Swooping cameras, objects that follow a path on their own etc.

The even cooler thing is you can create great effects by combining tracks pointing at related SceneNodes with different transforms. For example, you could have one track which moves a node around one path, and another track which moves the child of that node around another path, e.g. to make it have a wobbly orbit or something around the parent node. This feature has enormous potential for cutscene scripting, in-game object pathing etc.

To turn on spline interpolation, call Animation::setInterpolationMode(Animation::IM_SPLINE). Enjoy it, it’s a bit yummy. 😉