Are quaternions supposed to be normalized?

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: 39
Joined: Tue Oct 04, 2022 1:21 am

Are quaternions supposed to be normalized?

Post by n00bc0de »

I tried finding an answer to this in the doc. I am working on writing an importer for anim8or files. I am bringing objects in as CSkinnedMesh objects and wanted to know if the rotation keys in irrlicht are expected to be normalized.
CuteAlien
Admin
Posts: 9670
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Are quaternions supposed to be normalized?

Post by CuteAlien »

Depends - most functions by now seem to normalize(). Aside from getMatrixFast which doesn't do that (by design). Sadly never got defined if it's functions expect it to be normalized and if/or the results should be normalized. Someone seems to have added normalize calls to functions in 2017 and I added lerpN and some point to have a lerp which returns a normalized quaternion. And when doing that I wrote most functions would expect that - except now I look at it most functions seem to already normalize themself and my commit didn't mention which function would go wrong :-(
So.. .uhm, guess I have to go over the list once more at some point and find out if there are any more which expect normalized input.

For importer - just be safe and normalize. Won't be the biggest cost for an importer I guess.
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
n00bc0de
Posts: 39
Joined: Tue Oct 04, 2022 1:21 am

Re: Are quaternions supposed to be normalized?

Post by n00bc0de »

Thanks for the quick reply. I will normalize when building my custom mesh.
Post Reply