Can you add multiple rotation keys to the same frame?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
n00bc0de
Posts: 38
Joined: Tue Oct 04, 2022 1:21 am

Can you add multiple rotation keys to the same frame?

Post by n00bc0de »

I am trying to add 3 rotation keys to each frame (x,y, and z). Do I need to combine all my rotations into 1 key? I tried doing a rotation key for each axis but it only sets it for the first axis and ignores the other ones in that frame.
CuteAlien
Admin
Posts: 9643
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Can you add multiple rotation keys to the same frame?

Post by CuteAlien »

Yeah, looking at CSkinnedMesh::getFrameData it only seems to take one index per frame. So they have indeed to be combined. I think you can directly do that with quaternions - multiply them in the order in which they need to be applied and you end up with a quaternion with the combined rotation (same with matrices if you work with those).

In theory the animation system could do that itself in it's cleanup where it calls stuff like dropBadKeys. Just would need another test for identical keys and then multiply them in the order in which they got added and remove all but first one. But would need a patch for that - for now you'll have to do this yourself.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply