Use Ogre's animation system
Currently animations are done by manually transforming vertices and normals in software. This causes a noticeable performance hit, particularly when multiple characters are animating at once. Using Ogre's animation system will allow us to take advantage of hardware skinning, or at least a more efficient software skinning path. It will also allow us to use Ogre's AnimationState objects to manage the animation groups (as defined by the original game).
This task has the goals of:
-
Clean up the NIF file loader. The mesh resources need to be handled separately from the skeleton/animation resources, which themselves need to be separate from the other game-related resources (e.g. camera nodes). This will also allow for placing resource limits, letting Ogre unload unused meshes and skeleton/animation-related data when they're not being used, and reload them later when needed.
-
Use separate meshes/entities for NiTriShapes. Some of these pieces aren't actually skinned, but still need to move when the node is animated. Ogre does not allow moving SubEntitiy objects separately from their parent Entity, which prevents that from working. The current work-around is to skin it, requiring more resources to transform the vertices instead of letting the render system specify a single transform before rendering.
-
Load the NIF animations into Ogre's AnimationTracks. This should be simple enough at the basic level. NIFs also contain extra text data that specifies (among other things) the start and stop times of named animation "groups" within the complete track. These can be translated into AnimationState objects, which pretty much serve the same purpose.
-
Create methods to control the animation states from other mw-subsystems. These will likely be based around the scripting methods available for animations, with others made as they're needed.
(RM-345 from redmine: created on 2012-07-19 by Chris Robinson, , closed on 2012-07-26 by Chris Robinson)