Cool Feel free to swipe my animation loading code. It does the interpolation to prevent jerky movement.jhooks1 wrote:Yes, it works! Now to make it look smoother.
If you're not using separate entities, the shape's vertices will need to be weighted to the last node defined before it, otherwise it won't animate with the bone[1]. The shape's vertices shouldn't be transformed since it will be connected to the bone, which is initially at the skeleton's root, and move with it.For shapes without skins, the best solution at this time may be to just modify buffer positions. Most creatures/npc parts containing a skeleton do not have a shape like this, so it shouldn't slow us down to much
There is a bit more to how unskinned trishapes are connected to the bone, though, which I haven't figured out. For instance, with "meshes/wolf/xskinnpc.nif" I have to rotate the head using
Code: Select all
rot.FromEulerAnglesZYX(Ogre::Degree(0), Ogre::Degree(90), Ogre::Degree(15));
[1] Do note, though, that there seems to be a very noticeable drop in performance when I weighted the whole werewolf head to the head bone, even with just one skeleton instance and one copy of each mesh. Attaching the unskinned trishape to the bone using attachObjectToBone performs much, much better, but requires separate entities to be built for each trishape.